custom status!
This commit is contained in:
parent
9088813f54
commit
daade3ed2b
1 changed files with 52 additions and 0 deletions
52
commands/System/status.js
Normal file
52
commands/System/status.js
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
const validStatuses = [
|
||||||
|
{
|
||||||
|
internal: 'online',
|
||||||
|
display: 'online',
|
||||||
|
emoji: ':zap:'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
internal: 'idle',
|
||||||
|
display: 'idle',
|
||||||
|
emoji: ':beach_umbrella:'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
internal: 'dnd',
|
||||||
|
display: 'do-not-disturb',
|
||||||
|
emoji: ':mute:'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
internal: 'invisible',
|
||||||
|
display: 'invisible',
|
||||||
|
emoji: ':ghost:'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const validStatusRegex = new RegExp(`^(${validStatuses.map(status => status.internal).join('|')})$`);
|
||||||
|
const validStatusString = validStatuses.map(status => `\`${status.internal}\``).join(', ');
|
||||||
|
|
||||||
|
exports.run = async (client, message, args, level) => {
|
||||||
|
if (args.length < 1 || !validStatusRegex.test(args[0])) {
|
||||||
|
(await message.reply(`please provide a status to set from this list: ${validStatusString}`)).delete(5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
message.delete();
|
||||||
|
|
||||||
|
const status = validStatuses.find(status => status.internal === args[0].toLowerCase());
|
||||||
|
client.user.setStatus(status.internal);
|
||||||
|
|
||||||
|
(await message.channel.send(`${status.emoji} Set status to ${status.display}.`)).delete(5000);
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.conf = {
|
||||||
|
enabled: true,
|
||||||
|
guildOnly: false,
|
||||||
|
aliases: [],
|
||||||
|
permLevel: "User"
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.help = {
|
||||||
|
name: "status",
|
||||||
|
category: "System",
|
||||||
|
description: "Sets the bot's status. Pretty straightforward.",
|
||||||
|
usage: `status <${validStatuses.map(status => status.internal).join('|')}>`
|
||||||
|
};
|
Loading…
Reference in a new issue