feat(WebhookClient): allow creation of clients via URLs (#6192)

This commit is contained in:
Justin
2021-07-29 18:48:43 +08:00
committed by GitHub
parent 42a0313034
commit e000af5c98
4 changed files with 39 additions and 6 deletions

View File

@@ -97,7 +97,7 @@ client.on('messageCreate', async message => {
if (message.author.id !== owner) return;
const match = message.content.match(/^do (.+)$/);
const hooks = [
{ type: 'WebhookClient', hook: new WebhookClient(webhookChannel, webhookToken) },
{ type: 'WebhookClient', hook: new WebhookClient({ id: webhookChannel, token: webhookToken }) },
{ type: 'TextChannel#fetchWebhooks', hook: await message.channel.fetchWebhooks().then(x => x.first()) },
{ type: 'Guild#fetchWebhooks', hook: await message.guild.fetchWebhooks().then(x => x.first()) },
];