Emoji steal command.
i hate coding and trying to find code that does work i litrally have tears anyways @ShompiFlen
npm list discord.js and node node -v version?✅ Marked as resolved by OPmessage.guild.emojis.create(emojiURL, emojiName); this function takes an object in v14npm init then npm install discord.js that would be if you didn't install any other dependencies.emojis.create({attachment: urlToEmoji, name: emojiName})emojiArg, not sure what that isemojiName variable to parseEmoji and then use the result of that to get the name} else if (command === 'emojisteal') {
if (!message.member.permissions.has('ManageEmojisAndStickers') &&
message.author.id !== process.env.OWNER_ID) {
return message.channel.send("You don't have permission to use this command.");
}
const [emojiArg] = args;
if (!emojiArg || !emojiArg.match(/^<a?:\w+:\d+>$/)) {
return message.reply('Please provide a valid emoji.');
}
const [, emojiName, emojiId] = emojiArg.match(/<a?:\w+:(\d+)>/);
const emojiURL = `https://cdn.discordapp.com/emojis/${emojiId}`;
try {
const emoji = await message.guild.emojis.create(emojiURL, emojiName);
message.reply(`Emoji ${emoji} has been added to the guild.`);
} catch (error) {
console.error('Error adding emoji to the guild:', error);
message.reply('An error occurred while adding the emoji to the guild.');
}Error adding emoji to the guild: TypeError [ReqResourceType]: The resource must be a string, Buffer or a valid file stream.
at GuildEmojiManager.create (C:\Users\Minoa\node_modules\discord.js\src\managers\GuildEmojiManager.js:54:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Client.<anonymous> (C:\Users\Minoa\Desktop\bot\index.js:2911:23) {
code: 'ReqResourceType'
}message.guild.emojis.create(emojiURL, emojiName);npm initnpm install discord.js.emojis.create({attachment: urlToEmoji, name: emojiName})emojiArgemojiName