SanderDijkxhoorn

Untitled

Jul 16th, 2019
12,698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const client = new Discord.Client();
  3.  
  4. let prefix = "!";
  5.  
  6.  
  7. client.on("message", message => {
  8. let args = message.content.split(" ").slice(1);
  9. if (message.content.startsWith(prefix + "test")) {
  10. message.channel.createWebhook("Example Webhook", "https://i.imgur.com/p2qNFag.png")
  11. .then(webhook => webhook.edit("Example Webhook", "https://i.imgur.com/p2qNFag.png")
  12. .then(wb => message.author.send(`Here is your webhook https://canary.discordapp.com/api/webhooks/${wb.id}/${wb.token}`))
  13. .catch(console.error))
  14. .catch(console.error);
  15. mentionHook = new Discord.WebhookClient(`${wb.id}`, `${wb.token}`);
  16. mentionHook.send("You were mentioned!");
  17. }
  18. });
Add Comment
Please, Sign In to add comment