Browse Source

Add command to add emojis

master
Abheek Dhawan 4 years ago
parent
commit
b5eb0cf28c
  1. 16
      bot.js

16
bot.js

@ -98,9 +98,25 @@ client.on("message", async message => {
aboutBot(message); aboutBot(message);
} else if (message.content.toLowerCase().startsWith(`${prefix}roleinfo`)) { } else if (message.content.toLowerCase().startsWith(`${prefix}roleinfo`)) {
roleInfo(message); roleInfo(message);
} else if (message.content.toLowerCase().startsWith(`${prefix}addemoji`)) {
addEmoji(message);
} }
}); });
async function addEmoji(message) {
if (!message.member.hasPermission('MANAGE_EMOJIS')) {
message.reply(`you don't have the correct permissions to manage emojis!`);
return;
}
let splitMessage = message.content.split(" ");
if (splitMessage.length > 2) {
message.guild.emojis.create(splitMessage[1], splitMessage[2])
.then(emoji => message.reply(`created new emoji "${emoji.name}"`))
.catch(error => message.reply(error));
} else {
message.reply("the format should be `$addEmoji [URL] [name]`");
}
}
async function aboutBot(message) { async function aboutBot(message) {
const uptimeDays = client.uptime / 86400000; const uptimeDays = client.uptime / 86400000;
let serverCount; let serverCount;

Loading…
Cancel
Save