Maxi130
Maxi130
DIAdiscord.js - Imagine an app
Created by Maxi130 on 1/15/2024 in #djs-questions
How do I get premium_type of a user or is there no way in discord.js?
I looked in the docs, but couldn't find anything. The user is not partial and fully fetched. I tested it with curl and it is accessible without 0Auth2 https://discord.com/developers/docs/resources/user#user-object-user-structure https://discord.com/developers/docs/resources/user#user-object-premium-types
5 replies
DIAdiscord.js - Imagine an app
Created by Maxi130 on 1/15/2024 in #djs-questions
message.mentions.users being incomplete
When using message.mentions.users user who are not in the guild/cached by the bot, aren't in the collection. I pinged them using <@id> and <@!id> instead of using discords built in selector, if that matters. The pings are shown correctly on my client.
10 replies
DIAdiscord.js - Imagine an app
Created by Maxi130 on 1/2/2024 in #djs-questions
message.channel.totalMesssgeSent returning undefined
Message and message.channel are the value that they are supposed to be. I have the MessageContent, Guilds and MessageCreate intents. I do not have any partials,
9 replies
DIAdiscord.js - Imagine an app
Created by Maxi130 on 10/9/2023 in #djs-questions
How do I properly use a built in emoji?
No description
8 replies
DIAdiscord.js - Imagine an app
Created by Maxi130 on 9/16/2023 in #djs-questions
How do I fire an event once a rate limit has been reached?
I'm aware that discord.js handles right limits, but I want to be sure that it doesn't change the channel topic, because of a rate limit.
2 replies
DIAdiscord.js - Imagine an app
Created by Maxi130 on 4/22/2023 in #djs-questions
data.choices[0][MODEL_TYPE_CONVERT]: Only dictionaries may be used in a ModelType
That is what I am responding with:
interaction.respond({ name: "a", value: "AA" })
interaction.respond({ name: "a", value: "AA" })
What am I doing wrong?
6 replies
DIAdiscord.js - Imagine an app
Created by Maxi130 on 2/11/2023 in #djs-questions
[Solved] guildMemberUpdate event only firing after second nickname change
I'm trying to detect when someone changes their nickname.
const Discord = require('discord.js')
const Client = new Discord.Client({ allowedMentions: [], intents: [Discord.GatewayIntentBits.GuildMembers] })
Client.login("MYTOKEN")
Client.once('ready', () => {
console.log("Online")
})
Client.on('guildMemberUpdate', (oldMember, newMember) => {
console.log("Test")
})
const Discord = require('discord.js')
const Client = new Discord.Client({ allowedMentions: [], intents: [Discord.GatewayIntentBits.GuildMembers] })
Client.login("MYTOKEN")
Client.once('ready', () => {
console.log("Online")
})
Client.on('guildMemberUpdate', (oldMember, newMember) => {
console.log("Test")
})
Output:
"Online"
*Nickname change*
*Nickname change2*
"Test"
*Nickname change3*
"Test"
"Online"
*Nickname change*
*Nickname change2*
"Test"
*Nickname change3*
"Test"
17 replies
DIAdiscord.js - Imagine an app
Created by Maxi130 on 8/27/2022 in #djs-questions
Convert discord.js collection to json with keeping keys and values
I already tried Collection.toJSON() but it removes the key name and converts it into an array. Code:
console.log(Collection)
console.log(Collection.toJSON())
console.log(Collection)
console.log(Collection.toJSON())
Output:
Collection(1) [Map] { 1 => '506039613731897344' }
[ '506039613731897344' ]
Collection(1) [Map] { 1 => '506039613731897344' }
[ '506039613731897344' ]
15 replies
DIAdiscord.js - Imagine an app
Created by Maxi130 on 8/6/2022 in #djs-questions
Error WebSocket was closed before the connection was established
Version: ^13.8.1 (I will try upgrading but I don't think this is the issue)
node:events:505
throw er; // Unhandled 'error' event
^

Error: WebSocket was closed before the connection was established
at WebSocket.close (/home/discord/Order Management/node_modules/ws/lib/websocket.js:285:14)
at WebSocketShard.destroy (/home/discord/Order Management/node_modules/discord.js/src/client/websocket/WebSocketShard.js:806:27)
at WebSocketShard.onClose (/home/discord/Order Management/node_modules/discord.js/src/client/websocket/WebSocketShard.js:370:12)
at WebSocket.onClose (/home/discord/Order Management/node_modules/ws/lib/event-target.js:210:18)
at WebSocket.emit (node:events:527:28)
at WebSocket.emitClose (/home/discord/Order Management/node_modules/ws/lib/websocket.js:258:10)
at Receiver.receiverOnFinish (/home/discord/Order Management/node_modules/ws/lib/websocket.js:1158:20)
at Receiver.emit (node:events:527:28)
at finish (node:internal/streams/writable:754:10)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on WebSocket instance at:
at emitErrorAndClose (/home/discord/Order Management/node_modules/ws/lib/websocket.js:993:13)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
node:events:505
throw er; // Unhandled 'error' event
^

Error: WebSocket was closed before the connection was established
at WebSocket.close (/home/discord/Order Management/node_modules/ws/lib/websocket.js:285:14)
at WebSocketShard.destroy (/home/discord/Order Management/node_modules/discord.js/src/client/websocket/WebSocketShard.js:806:27)
at WebSocketShard.onClose (/home/discord/Order Management/node_modules/discord.js/src/client/websocket/WebSocketShard.js:370:12)
at WebSocket.onClose (/home/discord/Order Management/node_modules/ws/lib/event-target.js:210:18)
at WebSocket.emit (node:events:527:28)
at WebSocket.emitClose (/home/discord/Order Management/node_modules/ws/lib/websocket.js:258:10)
at Receiver.receiverOnFinish (/home/discord/Order Management/node_modules/ws/lib/websocket.js:1158:20)
at Receiver.emit (node:events:527:28)
at finish (node:internal/streams/writable:754:10)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on WebSocket instance at:
at emitErrorAndClose (/home/discord/Order Management/node_modules/ws/lib/websocket.js:993:13)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
6 replies