Answers for "webhook discord.js"

0

webhook discord.js

client.on("message", async message => {
  if (message.author.bot) return;
  if (message.webhookID) return;
  if (!message.content.startsWith(prefix)) return;
    let command = message.content.split(" ")[0];
    command = command.slice(prefix.length);
    let args = message.content.split(" ").slice(1);
    if (command == "قلله") {

  const avatar = message.author.avatarURL()
  let args = message.content.split(" ").slice(1);
  const webhooks = await message.channel.fetchWebhooks();
    const webhook = webhooks.first();

  if (!webhook) {
    webhook = await message.channel.createWebhook(`Islam webhook`, {
      avatar: client.user.displayAvatarURL()
    });
  }

    try {
        await webhook.send(args.join(""), {
            username: message.author.username,
            avatarURL: avatar,}

        );} catch (error) {console.error('Error trying to send: ', error);}}
});
Posted by: Guest on June-19-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language