Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何删除discord.js中的webhook?_Discord.js - Fatal编程技术网

如何删除discord.js中的webhook?

如何删除discord.js中的webhook?,discord.js,Discord.js,我想在discord.js中创建一个&模仿[user][句子]命令,并且我想在完成该命令后删除webhook。我有以下代码: message.channel.createWebhook("Webhook Test", "https://images.app.goo.gl/2rvCG9hndnTYbQqU9") .then(webhook => webhook.edit({channel: message.channel}) .then(wbhk =&

我想在discord.js中创建一个
&模仿[user][句子]
命令,并且我想在完成该命令后删除webhook。我有以下代码:

message.channel.createWebhook("Webhook Test", "https://images.app.goo.gl/2rvCG9hndnTYbQqU9")
.then(webhook => webhook.edit({channel: message.channel})
.then(wbhk => wbhk.send('Testing message'))
.then(wb => wb./*What do I put here to delete the webhook?*/).catch(console.error)
我四处寻找了几个小时,除了discord.js文档之外,找不到任何关于此的信息。

要删除一个,您可以使用:

message.channel.createWebhook(“Webhook测试”)https://images.app.goo.gl/2rvCG9hndnTYbQqU9")
.then(webhook=>webhook.edit({channel:message.channel})
.然后(webhook=>{
return webhook.send('Testing message')。然后(message=>webhook);//将webhook而不是消息返回给下一个。然后调用
})
.then(webhook=>webhook.delete()).catch(console.error)
要删除,您可以使用:

message.channel.createWebhook(“Webhook测试”)https://images.app.goo.gl/2rvCG9hndnTYbQqU9")
.then(webhook=>webhook.edit({channel:message.channel})
.然后(webhook=>{
return webhook.send('Testing message')。然后(message=>webhook);//将webhook而不是消息返回给下一个。然后调用
})
.then(webhook=>webhook.delete()).catch(console.error)

不知道为什么你仍然返回时突然需要花括号,但是我的投票:)我只是喜欢在每件事周围放括号:p.很高兴我能帮忙!不知道为什么你仍然返回时突然需要花括号,但是我的投票:)我只是喜欢在每件事周围放括号:p。很高兴我能帮忙!