Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bot.afk = new Map();
- bot.on("message", async message => {
- if (message.author.bot) return;
- if (message.channel.type === "dm") {
- message.author.send("coming soon ;)");
- }
- if (!message.content.startsWith(prefix)) return;
- let messageArray = message.content.split(" ");
- let cmd = messageArray[0];
- let args = messageArray.slice(1);
- let commandfile = bot.commands.get(cmd.slice(prefix.length));
- if (commandfile) commandfile.run(bot, message, args);
- if (message.content.includes(message.mentions.users.first())) {
- let mentioned = bot.afk.get(message.mentions.users.first().id);
- if (mentioned)
- message.channel.send(
- `**${mentioned.usertag} is currently afk. Reason: ${mentioned.reason}**`
- );
- }
- let afkcheck = bot.afk.get(message.author.id);
- if (afkcheck)
- return [
- bot.afk.delete(message.author.id),
- message.reply(`I have removed you afk`).then(msg => msg.delete(10000))
- ];
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement