Amir
Amir
DIAdiscord.js - Imagine a bot
Created by Amir on 6/7/2024 in #djs-questions
How do I know which gateway intents I need for a certain event in Discord.js?
Thanks
10 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/7/2024 in #djs-questions
How do I know which gateway intents I need for a certain event in Discord.js?
You mean something like this?:
const events = {
channelCreate: ['GuildModeration'],
channelUpdate: ['GuildModeration'],
threadCreate: ['GuildModeration'],
threadUpdate: ['GuildModeration'],
messageCreate: ['GuildMessages', 'MessageContent'],
messageUpdate: ['GuildMessages', 'MessageContent']
};
const events = {
channelCreate: ['GuildModeration'],
channelUpdate: ['GuildModeration'],
threadCreate: ['GuildModeration'],
threadUpdate: ['GuildModeration'],
messageCreate: ['GuildMessages', 'MessageContent'],
messageUpdate: ['GuildMessages', 'MessageContent']
};
10 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/7/2024 in #djs-questions
How do I know which gateway intents I need for a certain event in Discord.js?
Yes, that's exactly what I mean. Is there any built-in method to see which intents an event requires? It takes too much time to search for them one by one.
10 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/7/2024 in #djs-questions
How do I know which gateway intents I need for a certain event in Discord.js?
I'm working on a no-code bot-maker project, and I need to include all event nodes in it. So, do I have to find and include the necessary gateway intents for each event one by one?
10 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/5/2024 in #djs-questions
Simplifying the API request process
I think this is too complicated; I'll try to find another way. Thanks BTW
19 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/5/2024 in #djs-questions
Simplifying the API request process
Yes sure
19 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/5/2024 in #djs-questions
Simplifying the API request process
Thanks BTW
19 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/5/2024 in #djs-questions
Simplifying the API request process
Yes. But that's not the problem. I want to send API requests like this:
createdAPIclient[category_here][method_name_here](request_parameters_here);
createdAPIclient[category_here][method_name_here](request_parameters_here);
api.channels.createMessage({ channelId, 'xxxxxxxx', content: 'Hello World' });
api.channels.createMessage({ channelId, 'xxxxxxxx', content: 'Hello World' });
Currently I have to send them like this:
createdAPIclient[category_here][method_name_here](required_parameters_here, request_parameters_here);
createdAPIclient[category_here][method_name_here](required_parameters_here, request_parameters_here);
api.channels.createMessage('channelId', { content: 'Hello World' });
api.channels.createMessage('channelId', { content: 'Hello World' });
The difference is simple; in the first one, we can include all parameters in a single object.
19 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/5/2024 in #djs-questions
Simplifying the API request process
Or just how to get the API method required for a route?
19 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/5/2024 in #djs-questions
Simplifying the API request process
Or maybe we can use another method to do this?
19 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/5/2024 in #djs-questions
Simplifying the API request process
$ npm list discord.js @discordjs/core @discordjs/rest && node -v [email protected] C:\Program Files\Git\projects\botstudio ├─┬ @discordjs/[email protected] │ ├── @discordjs/[email protected] deduped │ └─┬ @discordjs/[email protected] │ └── @discordjs/[email protected] deduped ├── @discordjs/[email protected] └─┬ [email protected] └── @discordjs/[email protected] deduped v22.1.0
19 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/5/2024 in #djs-questions
Simplifying API Requests
Thanks; I've got my answers.
9 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/5/2024 in #djs-questions
Simplifying API Requests
Thanks! That's exactly what I meant, but can I use it without installing another package? Just using 'discord.js'
9 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/5/2024 in #djs-questions
Simplifying API Requests
Perhaps consider leveraging one of Discord.js's built-in methods to determine the required request method for each endpoint.
9 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/5/2024 in #djs-questions
Simplifying API Requests
I just want to see if it's possible to not specify the request method each time when sending requests.
9 replies
DIAdiscord.js - Imagine a bot
Created by Amir on 6/5/2024 in #djs-questions
Simplifying API Requests
$ npm list discord.js && node -v [email protected] C:\Program Files\Git\projects\botstudio └── [email protected] v22.1.0
9 replies