mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-09 01:04:16 +02:00
msg
This commit is contained in:
@@ -25,8 +25,8 @@ module.exports = class EasterEggCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { tag } = args;
|
||||
return message.say(eastereggs[tag]);
|
||||
return msg.say(eastereggs[tag]);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = class GiveFlowerCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
return message.say('Ooh, what a pretty flower. What, I may have it? Thanks! I like flowers, yes? ♪');
|
||||
run(msg) {
|
||||
return msg.say('Ooh, what a pretty flower. What, I may have it? Thanks! I like flowers, yes? ♪');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = class LennyCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
return message.say('( ͡° ͜ʖ ͡°)');
|
||||
run(msg) {
|
||||
return msg.say('( ͡° ͜ʖ ͡°)');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,14 +16,14 @@ module.exports = class MathCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { expression } = args;
|
||||
try {
|
||||
const solved = math.eval(expression);
|
||||
return message.say(solved)
|
||||
.catch(() => message.say('Invalid statement.'));
|
||||
return msg.say(solved)
|
||||
.catch(() => msg.say('Invalid statement.'));
|
||||
} catch (err) {
|
||||
return message.say('Invalid statement.');
|
||||
return msg.say('Invalid statement.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,16 +11,16 @@ module.exports = class NitroCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor('Discord Nitro')
|
||||
.setThumbnail('https://pbs.twimg.com/profile_images/814184180649197568/y2eZcVMq.jpg')
|
||||
.setColor(0x748BD9)
|
||||
.setURL('https://discordapp.com/nitro')
|
||||
.setDescription('This Message can only be viewed by members with Discord Nitro.\n[More Information](https://discordapp.com/nitro)');
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,10 +10,10 @@ module.exports = class SpamCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
return message.channel.send({files: ['https://i.imgur.com/2JFu5xE.jpg']});
|
||||
run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
return msg.channel.send({files: ['https://i.imgur.com/2JFu5xE.jpg']});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,12 +31,12 @@ module.exports = class StrawpollCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
async run(msg, args) {
|
||||
const { title, choices } = args;
|
||||
if (choices.length < 2)
|
||||
return message.say('You provided less than two choices.');
|
||||
return msg.say('You provided less than two choices.');
|
||||
if (choices.length > 31)
|
||||
return message.say('You provided more than thirty choices.');
|
||||
return msg.say('You provided more than thirty choices.');
|
||||
try {
|
||||
const { body } = await request
|
||||
.post('https://strawpoll.me/api/v2/polls')
|
||||
@@ -44,10 +44,10 @@ module.exports = class StrawpollCommand extends Command {
|
||||
title: title,
|
||||
options: choices
|
||||
});
|
||||
return message.say(`${body.title}\nhttp://strawpoll.me/${body.id}`);
|
||||
return msg.say(`${body.title}\nhttp://strawpoll.me/${body.id}`);
|
||||
}
|
||||
catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -12,10 +12,10 @@ module.exports = class TodayCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
try {
|
||||
const { text } = await request
|
||||
.get('http://history.muffinlabs.com/date')
|
||||
@@ -29,9 +29,9 @@ module.exports = class TodayCommand extends Command {
|
||||
.setTitle(`On this day (${parsed.date})...`)
|
||||
.setTimestamp()
|
||||
.setDescription(`${events[random].year}: ${events[random].text}`);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,10 +15,10 @@ module.exports = class WouldYouRatherCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
try {
|
||||
const { body } = await request
|
||||
.get('http://www.rrrather.com/botapi');
|
||||
@@ -27,9 +27,9 @@ module.exports = class WouldYouRatherCommand extends Command {
|
||||
.setURL(body.link)
|
||||
.setColor(0x9797FF)
|
||||
.setDescription(`${body.choicea} OR ${body.choiceb}?`);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user