mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 06:42:51 +02:00
Delete in say, XiaoBot -> Xiao
This commit is contained in:
@@ -9,7 +9,7 @@ module.exports = class Base64Command extends Command {
|
||||
aliases: ['base-64'],
|
||||
group: 'text-edit',
|
||||
memberName: 'base64',
|
||||
description: 'Converts text to Base64.',
|
||||
description: 'Converts text to/from Base64.',
|
||||
details: `**Modes**: ${modes.join(', ')}`,
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = class BinaryCommand extends Command {
|
||||
name: 'binary',
|
||||
group: 'text-edit',
|
||||
memberName: 'binary',
|
||||
description: 'Converts text to binary.',
|
||||
description: 'Converts text to/from binary.',
|
||||
details: `**Modes**: ${modes.join(', ')}`,
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -7,18 +7,23 @@ module.exports = class SayCommand extends Command {
|
||||
aliases: ['copy', 'echo'],
|
||||
group: 'text-edit',
|
||||
memberName: 'say',
|
||||
description: 'Make XiaoBot say what you wish.',
|
||||
description: 'Make me say what you want, master.',
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like XiaoBot to say?',
|
||||
prompt: 'What text would you like me to say?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { text }) {
|
||||
return msg.say(text);
|
||||
async run(msg, { text }) {
|
||||
try {
|
||||
if (msg.channel.type === 'text' && msg.deletable) await msg.delete();
|
||||
return msg.say(text);
|
||||
} catch (err) {
|
||||
return msg.say(text);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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