Advertisement
3MoSteve

Add Emoji

Dec 7th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. const owners = ["OWNER ID"];
  2.  
  3. client.on("message", async message => {
  4. if (!message.guild || message.author.bot) return null;
  5. const [command, ...args] = message.content.trim().split(" ");
  6. if (command == `*add`) {
  7. if (!owners.includes(message.author.id)) return message.reply("Access denied.");
  8. if (!args[0] || !args[1]) return message.channel.send(`**Usage: ${command} <Message ID> <Emoji>**\nIf The message is not in this channel mention the channel: **${command} <Channel ID> <Message ID> <Emoji>**`);
  9. var channel, msgid, emoji;
  10. if (args[2]) {
  11. channel = client.channels.cache.get(args[0]);
  12. if (!channel) return message.reply("I can't find the channel.")
  13. msgid = args[1];
  14. emoji = args[2];
  15. } else {
  16. channel = message.channel;
  17. msgid = args[0];
  18. emoji = args[1];
  19. }
  20. try {
  21. const msg = await channel.messages.fetch(msgid);
  22. await msg.react(emoji);
  23. await message.reply("Done .")
  24. } catch (e) {
  25. if (e.message == 'Unknown Emoji') return message.channel.send(`The Emoji couldn't be found.`)
  26. message.channel.send(`I can't find the message.`);
  27. }
  28. }
  29. });
  30. //Add Emoji command By 3Mo_Steve
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement