Skip to content

Instantly share code, notes, and snippets.

@goteusz-maszyk
Created April 9, 2022 09:53
Show Gist options
  • Save goteusz-maszyk/47e92cb3aa89fdd14255753ef83eb71a to your computer and use it in GitHub Desktop.
Save goteusz-maszyk/47e92cb3aa89fdd14255753ef83eb71a to your computer and use it in GitHub Desktop.
Simple webhook cli sender with discordjs
const { WebhookClient } = require('discord.js');
const readline = require('readline');
const client = new WebhookClient({ url: "https://discord.com/api/webhooks/123/token" })
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.on('line', line => {
client.send({
content: line,
username: "UserName",
avatarURL: "https://example.com/your/avatar/url.png"
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment