Created
April 9, 2022 09:53
-
-
Save goteusz-maszyk/47e92cb3aa89fdd14255753ef83eb71a to your computer and use it in GitHub Desktop.
Simple webhook cli sender with discordjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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