Akihiro
DIAdiscord.js - Imagine an app
•Created by Akihiro on 8/1/2023 in #djs-questions
Waiting the end of a collector (response or timeout) before sending another one
Hello there ~
Each time a user send a DM to my Bot, I want it to send an embed with buttons or reaction which represents the various possible actions.
However, I don't want the bot to send X times this embed if the user send X messages in a raw. I want to wait that the last embed get an answer or time out. So, is there a way to check that there is already an existing embed that is waiting for a response ?
2 replies
DIAdiscord.js - Imagine an app
•Created by Akihiro on 1/18/2023 in #djs-questions
Get embed data from discohook link
Hello there ~ !
I'm trying to implement a command that permits to easily send embeds as the bots.
For that I need something easy for users to create/build an embed.
I did see that some bots are using discohook links to get the data of an Embed.
Does anyone know how this is working ?
node v16.15.0
4 replies
DIAdiscord.js - Imagine an app
•Created by Akihiro on 12/26/2022 in #djs-questions
find user, in the cache or not ?
Hello !
I'm doing a lot of commands that are fetching for a target user and I'm using atm these functions :
-
client.users.fetch(id);
-message.guild.members.fetch(targetUserId);
However I realize that this one throws exceptions when it does not find any user which I find a bit disturbing (putting try-catch everywhere is not very fun)
I also see some peoples fetching from the cache of the client or the guild and fetch in this way does not seem to generate an Exception.
But before going from one to the other way, I would like to know what is the difference between cached and non-cached data. Is there even one ? And does this somehow impact the search for fetch()
functions ?7 replies
DIAdiscord.js - Imagine an app
•Created by Akihiro on 12/25/2022 in #djs-questions
[✅]lastMessage is null when lastMessageId is not ? [DM channel]
Hello !
As explained in this title, I'm using dmChannel in a command, just that atm :
Here is the output
I only have
GatewayIntentBits.DirectMessages
as DM related intent atm. Am I missing something ?
node version : 16.15.012 replies
DIAdiscord.js - Imagine an app
•Created by Akihiro on 12/20/2022 in #djs-questions
Managing command access depending on roles
Hello !
I would ask what's the best way to give (or not) access to a command, depending on a specific roles. I know this ins't very "many-server" friendly.
But since my actual bot is just for a test server, this is ok !
Why do I want to do that ? Mainly to allow that for example when a user with an
Intern
role do !help
this show only the commands they have acces as an Intern
, and thus when another user with an Employee
role do the same, !help
will show all commands they have acces as an Employee
(and also as an Inter
since the employee is supposed to have more permissions).
The only idea I can think of is to have either :
A list for each role with special permissions containing all accessible commands.
Or, for each command, a list of the IDs of the roles that have access to it
What is the best solution and are there others ?
By "best", I mean, something easily maintainable
node version : 16.15.07 replies
DIAdiscord.js - Imagine an app
•Created by Akihiro on 8/31/2022 in #djs-questions
Delete bot Message in a DM Channel !
Hey !
I'd know if it's possible to clear all messages from the bot in a DM channel !
I tried in many way, but nothing succeed !
Does anyone have any leads and more importantly, are these messages really deletable?
Thanks !
8 replies