VLADY 🛡
VLADY 🛡
DIAdiscord.js - Imagine an app
Created by VLADY 🛡 on 11/11/2023 in #djs-voice
How to make the bot leave a voice chat?
I have tried several options:
let connection = getVoiceConnection(interaction.guild.id);
if (connection === undefined) {
await interaction.reply("I am not in a vc!");
return;
};
connection.destroy();
let connection = getVoiceConnection(interaction.guild.id);
if (connection === undefined) {
await interaction.reply("I am not in a vc!");
return;
};
connection.destroy();
interaction.guild.members.me.voice.channel.leave()
interaction.guild.members.me.voice.channel.leave()
interaction.guild.member.voice.channel.leave()
interaction.guild.member.voice.channel.leave()
none working.
14 replies
DIAdiscord.js - Imagine an app
Created by VLADY 🛡 on 9/2/2023 in #djs-questions
[discord-rpc] Prevent multiple listeners
guys I have a question
app.post('/extension-call', (req, res) => {
if (req.body.playing === true) {

updateRpc(req.body.name, req.body.icon, 'Playing')
}
else {
updateRpc(null, null, 'Browsing')
}
});
app.post('/extension-call', (req, res) => {
if (req.body.playing === true) {

updateRpc(req.body.name, req.body.icon, 'Playing')
}
else {
updateRpc(null, null, 'Browsing')
}
});
and inside updateRpc I have client.login using client id, setactivity function and etc, how to do so it does not create multiple listeners except only one?
function updatePresence() {
return client.setActivity({
details: rpc.details,
state: rpc.state,
largeImageKey: rpc.assets.largeImageKey,
largeImageText: rpc.assets.largeImageText,
smallImageKey: rpc.assets.smallImageKey,
smallImageText: rpc.assets.smallImageText,
buttons:
[{
label: rpc.buttons.primary.buttonLabelText,
url: rpc.buttons.primary.buttonRedirectUrl
},
{
label: rpc.buttons.secondary.buttonLabelText,
url: rpc.buttons.secondary.buttonRedirectUrl
}
],
startTimestamp: new Date()


}, process.pid)
}
client.on('ready', async () => {
onStartup();
});
if(/* here */) client.login({ clientId: config.clientId }).catch();
}
function updatePresence() {
return client.setActivity({
details: rpc.details,
state: rpc.state,
largeImageKey: rpc.assets.largeImageKey,
largeImageText: rpc.assets.largeImageText,
smallImageKey: rpc.assets.smallImageKey,
smallImageText: rpc.assets.smallImageText,
buttons:
[{
label: rpc.buttons.primary.buttonLabelText,
url: rpc.buttons.primary.buttonRedirectUrl
},
{
label: rpc.buttons.secondary.buttonLabelText,
url: rpc.buttons.secondary.buttonRedirectUrl
}
],
startTimestamp: new Date()


}, process.pid)
}
client.on('ready', async () => {
onStartup();
});
if(/* here */) client.login({ clientId: config.clientId }).catch();
}
4 replies
DIAdiscord.js - Imagine an app
Created by VLADY 🛡 on 11/11/2022 in #djs-questions
[Question] How to create application Commands (Apps)
Hi, I'd like to build an App command for Message (type 3) but I couldn't find any docs for this.
5 replies