Python
Python
DIAdiscord.js - Imagine an app
Created by Python on 10/12/2024 in #djs-questions
Detecting the double server boost
For the second time cause the guildMemberUpdate not trigger so the collection doesn't have a data about the member and condition will returns false
11 replies
DIAdiscord.js - Imagine an app
Created by Python on 10/12/2024 in #djs-questions
Detecting the double server boost
But i found another solution: Add member to the set in the guildMemberUpdate event and remove the member which is added to the set in messageCreate event like this in the first line:
if (collection.has(message.author.id) {
return collection.delete(message.author.id)
}
if (collection.has(message.author.id) {
return collection.delete(message.author.id)
}
11 replies
DIAdiscord.js - Imagine an app
Created by Python on 10/12/2024 in #djs-questions
Detecting the double server boost
Yes i want to messageCreate only for second time boost
11 replies
DIAdiscord.js - Imagine an app
Created by Python on 10/12/2024 in #djs-questions
Detecting the double server boost
Because it is public bot may someone doesn't activate the System Boost Message and i want detect the first time boost without any requirement
11 replies
DIAdiscord.js - Imagine an app
Created by Python on 10/12/2024 in #djs-questions
Detecting the double server boost
To implement this solution, I think this way good for it: Create a new Set to track members who have been given the Nitro boost. Use the guildMemberUpdate event to add the boosted member to the Set, and remove them after a few seconds. In the messageCreate event, introduce a 1-second delay and check each message and ensure that the message type is equal to 8 and that the message.author is not present in the Set. What about it? Is there any better way? Actually i don't need to know when boost removed!
11 replies
DIAdiscord.js - Imagine an app
Created by Python on 5/13/2024 in #djs-voice
Audio Player and Voice Connection
Honestly i don't care about the created audio player, I wanna remove it just for prevent memory leaking :FeelsBadMan:
13 replies
DIAdiscord.js - Imagine an app
Created by Python on 5/13/2024 in #djs-voice
Audio Player and Voice Connection
Actually i create the player to check that the provided resource is playable or not And if is not returns a message and also removes the created player because i don't need it anymore
13 replies
DIAdiscord.js - Imagine an app
Created by Python on 5/13/2024 in #djs-voice
Audio Player and Voice Connection
Thanks, how can i remove the player?
13 replies
DIAdiscord.js - Imagine an app
Created by Python on 5/13/2024 in #djs-voice
Audio Player and Voice Connection
But in the docs says the connection.destory() removing everything about the connection
13 replies
DIAdiscord.js - Imagine an app
Created by Python on 5/13/2024 in #djs-voice
Audio Player and Voice Connection
Oh thanks, Does it make sense that i add player.stop() before destroying the connection?
13 replies
DIAdiscord.js - Imagine an app
Created by Python on 5/9/2024 in #djs-voice
Stop playing audio without voiceStatesUpdate event
Yes i solved it, Thanks
3 replies
DIAdiscord.js - Imagine an app
Created by Python on 5/9/2024 in #djs-voice
On start playing audio event
But I can't understand why this way solved the problem and also are there any better ways?
7 replies
DIAdiscord.js - Imagine an app
Created by Python on 5/9/2024 in #djs-voice
On start playing audio event
What I meant by sending the log twice was that the first time it was actually doing it before the audio was played, but the second time it was exactly at the same time as the playing audio. And also the code above caused that first unrelated log to not be sent anymore
7 replies
DIAdiscord.js - Imagine an app
Created by Python on 5/9/2024 in #djs-voice
On start playing audio event
Like this code:
connection.on(VoiceConnectionStatus.Ready, () => {
connection.subscribe(player);
player.play(resource);
});
connection.on(VoiceConnectionStatus.Ready, () => {
connection.subscribe(player);
player.play(resource);
});
7 replies
DIAdiscord.js - Imagine an app
Created by Python on 5/9/2024 in #djs-voice
On start playing audio event
No I was joined the voice channel and then i used this command But when i added player.play(resource) and connection.subsrcibe(player) to the VoiceConnectionStatusReady event in the connection.on(), actually the start playing audio event send a log once and exactly works for me
7 replies
DIAdiscord.js - Imagine an app
Created by Python on 5/9/2024 in #djs-voice
On start playing audio event
And i use the version 0.16.1 with node.js v21
7 replies