diff --git a/commands/general/addemoji.js b/commands/general/addemoji.js new file mode 100644 index 0000000..32ab812 --- /dev/null +++ b/commands/general/addemoji.js @@ -0,0 +1,36 @@ +const { Message, Client, Permissions } = require("discord.js"); +const Discord = require('discord.js') + +module.exports = { + name: "addemoji", + aliases: [''], + /** + * + * @param {Client} client + * @param {Message} message + * @param {String[]} args + */ + run: async (client, message, args) => { + if(!message.member.permissions.has(Permissions.FLAGS.MANAGE_EMOJIS_AND_STICKERS, Permissions.FLAGS.ADMINISTRATOR)) + // if someone dont hv perm it will send this message + message.channel.send("You don't have permission to use that command."); + + else { + if (!args.length) return message.channel('Please specify an emoji!!') + + for (const emojis of args) { + const getEmoji = Discord.Util.parseEmoji(emojis); + + if (getEmoji.id) { + const emojiExt = getEmoji.animated ? ".gif" : ".png"; + const emojiURL = `https://cdn.discordapp.com/emojis/${getEmoji.id + emojiExt}` + + message.guild.emojis.create(emojiURL, getEmoji.name).then(emoji => + message.channel.send(`Successfully added: ${emoji} - ${emoji.name} to the server!!`)) + } + } + + + }; + } +} \ No newline at end of file diff --git a/events/guildMemberAdd.js b/events/guildMemberAdd.js index 1421f5e..655ee07 100644 --- a/events/guildMemberAdd.js +++ b/events/guildMemberAdd.js @@ -5,10 +5,10 @@ const discord = require('discord.js'); client.on('guildMemberAdd', async guildmember =>{ const guild = client.guilds.cache.get('427865794467069962'); - const welcomechannel =client.channels.cache.get('427875246801027072') - if(guild == guildmember.guild.id ) + const welcomechannel = client.channels.cache.get('427875246801027072') + if(guild == '427865794467069962') { - welcomechannel.send(`<:hi:858281121611513897> Welcome! **${guildmember.user}** has just joined the server! Grab some roles from: <#427873938333499404> and let us know who you are within <#427874873898041346>`); + welcomechannel.send(` Welcome! **${guildmember.user}** has just joined the server! Grab some roles from <#427873938333499404> and let us know who you are within <#427874873898041346>`); }