Emoji steal command.

i hate coding and trying to find code that does work i litrally have tears anyways @ShompiFlen
26 Replies
d.js toolkit
d.js toolkit6mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
ShompiFlen
ShompiFlen6mo ago
okay wait because i said i would help you code one but if you are not willing to then im not gonna help
みのあ
みのあ6mo ago
yay i can send you what i have, it no workey
ShompiFlen
ShompiFlen6mo ago
sure
みのあ
みのあ6mo ago
if i fix one error i run into another and another and another and another and another ect ect
} 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.');
}
} 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.');
}
ShompiFlen
ShompiFlen6mo ago
okay... so where does this fail what happens when you try to use it
みのあ
みのあ6mo ago
i think it needs to be converted to base64 due to the emoji add api
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'
}
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'
}
ShompiFlen
ShompiFlen6mo ago
what version of discord.js are you using on this project? take a look at package.json
みのあ
みのあ6mo ago
14.14.4 i think
みのあ
みのあ6mo ago
i just noticed my package and package lock is missing im confused
ShompiFlen
ShompiFlen6mo ago
you dont have a package.json in your project folder?
みのあ
みのあ6mo ago
i did idk what happend
ShompiFlen
ShompiFlen6mo ago
might have to install dependencies again if you can't recover that
みのあ
みのあ6mo ago
its wtv i have a backup on github ill get later
Want results from more Discord servers?
Add your server