mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 21:40:49 +02:00
Delete in say, XiaoBot -> Xiao
This commit is contained in:
@@ -24,9 +24,11 @@ module.exports = class WebhookCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, { content }) {
|
||||
if (msg.channel.type === 'text') await msg.delete();
|
||||
try {
|
||||
await snekfetch.post(`https://discordapp.com/api/webhooks/${WEBHOOK_ID}/${WEBHOOK_TOKEN}`).send({ content });
|
||||
if (msg.channel.type === 'text' && msg.deletable) await msg.delete();
|
||||
await snekfetch
|
||||
.post(`https://discordapp.com/api/webhooks/${WEBHOOK_ID}/${WEBHOOK_TOKEN}`)
|
||||
.send({ content });
|
||||
return null;
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
|
||||
Reference in New Issue
Block a user