Korrumz2
Korrumz2
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
nvm
27 replies
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
oh
27 replies
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
I'll close
27 replies
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
Yeah
27 replies
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
i replaced guildId with guild.id
27 replies
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
lol i fixed it somehow xDD
27 replies
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
just I don't think the rest is necessary
27 replies
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
import { type ColorResolvable, EmbedBuilder } from "discord.js";
import { startRadio } from "utils/startRadio";
export async function voiceStateUpdate(client, oldState, newState) {
let description = "";
let color = "";

const embed = new EmbedBuilder().setTimestamp();

if (oldState.channel !== newState.channel) {
if (!oldState.channel && newState.channel) {
description = `User ${newState.member.user.username} **joined channel** <#${newState.channel.id}> \`[${newState.channel.name}]\``;
color = "Green";

await startRadio(client, newState.guildId)
} else if (oldState.channel && !newState.channel) {
description = `User ${newState.member.user.username} **left channel** <#${oldState.channel.id}> \`[${oldState.channel.name}]\``;
color = "Green";
} else {
description = `User ${newState.member.user.username} **moved from** <#${oldState.channel.id}> \`[${newState.channel.name}]\` to <#${newState.channel.id}> [${newState.channel.name}]`;
color = "Yellow";
}
} else {
const availableStateKeys = {
serverDeaf: "defeaned (by admin)",
serverMute: "muted (by admin)",
selfDeaf: "deafened",
selfMute: "muted",
selfVideo: "started video",
};
for (const key in availableStateKeys) {
if (oldState[key] !== newState[key]) {
embed.setDescription(
`User ${newState.member.user.username} was **${
newState[key] ? "un" : ""
}${availableStateKeys[key]}** in \`${
oldState.channel.name
}\``,
);
}
}
}

if (description) {
embed.setDescription(description);
embed.setColor(color as ColorResolvable);

client.channels.cache
.get("1071407744894128178")
.send({ embeds: [embed] });
}
}
import { type ColorResolvable, EmbedBuilder } from "discord.js";
import { startRadio } from "utils/startRadio";
export async function voiceStateUpdate(client, oldState, newState) {
let description = "";
let color = "";

const embed = new EmbedBuilder().setTimestamp();

if (oldState.channel !== newState.channel) {
if (!oldState.channel && newState.channel) {
description = `User ${newState.member.user.username} **joined channel** <#${newState.channel.id}> \`[${newState.channel.name}]\``;
color = "Green";

await startRadio(client, newState.guildId)
} else if (oldState.channel && !newState.channel) {
description = `User ${newState.member.user.username} **left channel** <#${oldState.channel.id}> \`[${oldState.channel.name}]\``;
color = "Green";
} else {
description = `User ${newState.member.user.username} **moved from** <#${oldState.channel.id}> \`[${newState.channel.name}]\` to <#${newState.channel.id}> [${newState.channel.name}]`;
color = "Yellow";
}
} else {
const availableStateKeys = {
serverDeaf: "defeaned (by admin)",
serverMute: "muted (by admin)",
selfDeaf: "deafened",
selfMute: "muted",
selfVideo: "started video",
};
for (const key in availableStateKeys) {
if (oldState[key] !== newState[key]) {
embed.setDescription(
`User ${newState.member.user.username} was **${
newState[key] ? "un" : ""
}${availableStateKeys[key]}** in \`${
oldState.channel.name
}\``,
);
}
}
}

if (description) {
embed.setDescription(description);
embed.setColor(color as ColorResolvable);

client.channels.cache
.get("1071407744894128178")
.send({ embeds: [embed] });
}
}
27 replies
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
if I hadn't called it in voiceStateUpdate, I wouldn't have got response from console.logs
27 replies
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
in the docs only they are there
27 replies
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
wait, it's not like these methods are only in @discord.js/voice?
27 replies
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
they both exist
27 replies
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
and no, I have no error
27 replies
DIAdiscord.js - Imagine an app
Created by Korrumz2 on 5/20/2024 in #djs-voice
Bot is not joining voice channel after executing function in voiceStateUpdate event
and also idk why in the @discordjs/voice documentation basically every page I go to returns a 404 error
27 replies
DIAdiscord.js - Imagine an app
Created by alesi on 2/28/2023 in #djs-questions
How to create an embed with pagination?
I hope I have explained everything well
25 replies
DIAdiscord.js - Imagine an app
Created by alesi on 2/28/2023 in #djs-questions
How to create an embed with pagination?
Just "interaction failed" message
25 replies
DIAdiscord.js - Imagine an app
Created by alesi on 2/28/2023 in #djs-questions
How to create an embed with pagination?
without any error
25 replies
DIAdiscord.js - Imagine an app
Created by alesi on 2/28/2023 in #djs-questions
How to create an embed with pagination?
(Buttons do not work after restarting the bot)
25 replies
DIAdiscord.js - Imagine an app
Created by alesi on 2/28/2023 in #djs-questions
How to create an embed with pagination?
I already have a handler for pagination on collectors that works on a similar principle, but it doesn't quite work
25 replies
DIAdiscord.js - Imagine an app
Created by alesi on 2/28/2023 in #djs-questions
How to create an embed with pagination?
This code uses collectors, and I wrote that there are not supposed to be any
25 replies