Delete in say, XiaoBot -> Xiao

This commit is contained in:
Daniel Odendahl Jr
2018-04-26 11:23:56 +00:00
parent dbfd09e4c9
commit b022621132
8 changed files with 21 additions and 14 deletions
+1 -1
View File
@@ -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: [
{
+1 -1
View File
@@ -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: [
{
+9 -4
View File
@@ -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);
}
}
};
+4 -2
View File
@@ -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!`);