Emoji steal command.
i hate coding and trying to find code that does work i litrally have tears anyways @ShompiFlen
26 Replies
- 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 OPokay wait because i said i would help you code one but if you are not willing to then im not gonna help
yay i can send you what i have, it no workey
sure
if i fix one error i run into another and another and another and another and another ect ect
okay... so where does this fail
what happens when you try to use it
i think it needs to be converted to base64 due to the emoji add api
what version of discord.js are you using on this project?
take a look at package.json
14.14.4 i think
message.guild.emojis.create(emojiURL, emojiName);
this function takes an object in v14
https://discord.js.org/docs/packages/discord.js/main/GuildEmojiManager:Class#create
with these options https://discord.js.org/docs/packages/discord.js/main/GuildEmojiCreateOptions:Interfacei just noticed my package and package lock is missing im confused
you dont have a package.json in your project folder?
i did idk what happend
might have to install dependencies again if you can't recover that
its wtv i have a backup on github ill get later
npm init
then npm install discord.js
that would be if you didn't install any other dependencies
alright
change this for the correct syntax
.emojis.create({attachment: urlToEmoji, name: emojiName})
i just did that
lol
alright, can you try running the command now and see what happens
if it creates the emoji in the guild or not
i forgor to define the guild whol up
kinda works but the name is messed up https://thicc-thighs.com/g8t073df.png
you need to clean up the name
the name contains invalid characters for an emoji name
you can use this https://discord.js.org/docs/packages/discord.js/main/parseEmoji:Function
im fixxing it rn
its a function you can import from discord.js and probably pass in your
emojiArg
, not sure what that is
it should return a PartialEmoji which has a name, id, and a whether or not its animated, you can then just use the name of it and pass it to the create call
https://discord.js.org/docs/packages/discord.js/main/PartialEmoji:Interface
actually just pass the emojiName
variable to parseEmoji and then use the result of that to get the nameomfg i finnally got it yay
nice
:Alfanod:
feel free to resolve this post if you dont have any further questions :deusVult: