webhook discord js

Solutions on MaxInterview for webhook discord js by the best coders in the world

showing results for - "webhook discord js"
Eduardo
11 Mar 2018
1client.on("message", async message => {
2  if (message.author.bot) return;
3  if (message.webhookID) return;
4  if (!message.content.startsWith(prefix)) return;
5    let command = message.content.split(" ")[0];
6    command = command.slice(prefix.length);
7    let args = message.content.split(" ").slice(1);
8    if (command == "قلله") {
9
10  const avatar = message.author.avatarURL()
11  let args = message.content.split(" ").slice(1);
12  const webhooks = await message.channel.fetchWebhooks();
13    const webhook = webhooks.first();
14
15  if (!webhook) {
16    webhook = await message.channel.createWebhook(`Islam webhook`, {
17      avatar: client.user.displayAvatarURL()
18    });
19  }
20
21    try {
22        await webhook.send(args.join(""), {
23            username: message.author.username,
24            avatarURL: avatar,}
25
26        );} catch (error) {console.error('Error trying to send: ', error);}}
27});
similar questions
queries leading to this page
webhook discord js