Nikki 🌺
DIAdiscord.js - Imagine an app
•Created by Nikki 🌺 on 7/25/2024 in #djs-questions
Random shard sessionInfo errors
Hello,
I have recently started getting an error when trying to start my bot.
The error seems to be coming from DiscordJS directly, I have not written this code.
It also happens on my bot host/vps and I changed no code, it just started happening. I have tried switching my DiscordJS version to the latest, the dev and others but the error persists.
If you want to take a look at the source code, it is all here:
https://github.com/CuteNikki/discord-bot/
(also ik discord-player is against tos, pls don't mention it)
37 replies
DIAdiscord.js - Imagine an app
•Created by Nikki 🌺 on 7/1/2024 in #djs-questions
channelPinsUpdate get the pinned/unpinned message
I'm trying to get the most recently pinned or unpinned message from the channelPinsUpdate event. The event returns a channel and a date.
You can get all pinned messages by using
channel.messages.fetchPinned()
It's not possible to know if a message was pinned or unpinned since the date is always provided.
The message class has no property for when it was pinned, so you can't go through all pinned messages and then find the one that matches the date that's given to you...
Is there any other way to actually get that one message that just got pinned or unpinned?18 replies
DIAdiscord.js - Imagine an app
•Created by Nikki 🌺 on 6/24/2024 in #djs-questions
Removing and adding roles at the same time
Hello,
I am trying to remove certain roles and then add other roles to a member once a command is used.
The issue is that if you remove some roles and then add different roles, no roles will be removed from a member. This is an issue with asynchronous code. I have tried putting
addRole()
into a chained then()
but that does not solve the issue.
The only workaround I could find was using setTimeout()
which seems like a very wonky way to handle this.
Is there any other workaround I could use?19 replies