mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 05:51:42 +02:00
A variety of fixes and a change in the way errors are handled.
This commit is contained in:
@@ -19,7 +19,7 @@ module.exports = class EmbedCommand extends Command {
|
||||
run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS'))
|
||||
return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { text } = args;
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor(message.author.username, message.author.avatarURL)
|
||||
|
||||
@@ -12,6 +12,7 @@ module.exports = class SayCommand extends Command {
|
||||
group: 'textedit',
|
||||
memberName: 'say',
|
||||
description: 'Make XiaoBot say what you wish.',
|
||||
guildOnly: true,
|
||||
args: [{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like XiaoBot to say?',
|
||||
@@ -21,7 +22,10 @@ module.exports = class SayCommand extends Command {
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES'))
|
||||
return message.say('This Command requires the `Manage Messages` Permission.');
|
||||
const { text } = args;
|
||||
message.delete();
|
||||
return message.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ module.exports = class WebhookCommand extends Command {
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES'))
|
||||
return message.say(':x: Error! I don\'t have the Manage Messages Permission!');
|
||||
return message.say('This Command requires the `Manage Messages` Permission.');
|
||||
const { text } = args;
|
||||
try {
|
||||
message.delete();
|
||||
@@ -38,7 +38,7 @@ module.exports = class WebhookCommand extends Command {
|
||||
});
|
||||
return null;
|
||||
} catch (err) {
|
||||
return message.say(':x: Error! Message failed to send!');
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user