Gabriel
DIAdiscord.js - Imagine an app
•Created by Sans on 5/17/2024 in #djs-questions
sticky message sometimes isn't sticky
you can try console logging some text before and after specific code lines to see where exactly is the problem.
7 replies
DIAdiscord.js - Imagine an app
•Created by Sans on 5/17/2024 in #djs-questions
sticky message sometimes isn't sticky
no errors?
7 replies
DIAdiscord.js - Imagine an app
•Created by ofseal on 5/8/2024 in #djs-questions
How can I make it so that when users are blocked from accessing the bot, it leaves their server?
add
async
before interaction
:
client.on("", async interaction => ...)
33 replies
DIAdiscord.js - Imagine an app
•Created by ofseal on 5/8/2024 in #djs-questions
How can I make it so that when users are blocked from accessing the bot, it leaves their server?
your function needs to be async
33 replies
DIAdiscord.js - Imagine an app
•Created by ofseal on 5/8/2024 in #djs-questions
How can I make it so that when users are blocked from accessing the bot, it leaves their server?
maybe add an
await
?
await interaction.guild.leave().then(...)
33 replies
DIAdiscord.js - Imagine an app
•Created by ofseal on 5/8/2024 in #djs-questions
How can I make it so that when users are blocked from accessing the bot, it leaves their server?
is there no error in the console?
33 replies
DIAdiscord.js - Imagine an app
•Created by ofseal on 5/8/2024 in #djs-questions
How can I make it so that when users are blocked from accessing the bot, it leaves their server?
also there's another mistake: the variable
guild
is no where to be found? you should use interaction.guild.leave().then(...)
33 replies
DIAdiscord.js - Imagine an app
•Created by ofseal on 5/8/2024 in #djs-questions
How can I make it so that when users are blocked from accessing the bot, it leaves their server?
how exactly do you check if it works or not?
33 replies
DIAdiscord.js - Imagine an app
•Created by ofseal on 5/8/2024 in #djs-questions
How can I make it so that when users are blocked from accessing the bot, it leaves their server?
you can access the guild obj via
interaction.guild
, so that would be if (blockedUsers.includes(interaction.guild.ownerId)) ...
33 replies
DIAdiscord.js - Imagine an app
•Created by ofseal on 5/8/2024 in #djs-questions
How can I make it so that when users are blocked from accessing the bot, it leaves their server?
in this case, you're checking if the user that ran the command is blocked
33 replies
DIAdiscord.js - Imagine an app
•Created by ofseal on 5/8/2024 in #djs-questions
How can I make it so that when users are blocked from accessing the bot, it leaves their server?
if you don't have the guild, then you can't fetch data or use the
.leave()
method (or any other one).33 replies
DIAdiscord.js - Imagine an app
•Created by ofseal on 5/8/2024 in #djs-questions
How can I make it so that when users are blocked from accessing the bot, it leaves their server?
to leave the server, you can use
guild.leave()
. that's exactly what you've found.33 replies
DIAdiscord.js - Imagine an app
•Created by ofseal on 5/8/2024 in #djs-questions
How can I make it so that when users are blocked from accessing the bot, it leaves their server?
You need the Guild object in order to get the owner's ID
33 replies
DIAdiscord.js - Imagine an app
•Created by ofseal on 5/8/2024 in #djs-questions
How can I make it so that when users are blocked from accessing the bot, it leaves their server?
Upon entering a guild or when the bot receives the
interactionCreate
, you can check whenever or not the owner of the guild is blocked or not.33 replies
DIAdiscord.js - Imagine an app
•Created by ShowCast on 5/6/2024 in #djs-questions
Develop with Entitlements
My solution would be to use a websocket. Just redirect the data you receive from
Events.entitlementCreate
on the main bot to the dev one.4 replies
DIAdiscord.js - Imagine an app
•Created by marks on 5/4/2024 in #djs-questions
Is there any way to handle a poll ending?
here's a very stupid solution:
- track new messages via
Events.messageCreate
and add them to an array if the message contains a poll
- check periodically if Date.now() > poll.expiresTimestamp
. If so, then do whatever you want with that poll.
you could also check if Events.messageUpdate
is triggered when a poll is closed.5 replies
DIAdiscord.js - Imagine an app
•Created by sproj003 ♿ on 5/7/2024 in #djs-questions
Bot permission in channel
Hey! Fetch functions are promises so you should wait for a response:
6 replies