V
V
Vlad Morkovkin2021-08-13 13:22:45
Node.js
Vlad Morkovkin, 2021-08-13 13:22:45

How to manage webhooks with discord.js?

How to find a webhook in a channel by its url and send a message through it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-08-14
@Vlad808

for this, it is not necessary to specify the channel, the URL will be enough:

const { MessageEmbed, WebhookClient } = require('discord.js');

const url = "url_вебхука";

const webhookClient = new WebhookClient({ id: url.split("/")[5], token: url.split("/")[6]});

webhookClient.send({
  content: 'контент',
  username: 'имя_пользователя',
  avatarURL: 'url_аватара',
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question