[ 💖 ] ElBretxa
[ 💖 ] ElBretxa
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by [ 💖 ] ElBretxa on 2/24/2024 in #djs-questions
Reply interaction after editing voice channel perms
There is a button inside a voice channel's text channel. I need to reply to the interaction after editing the channel's permissions, but it says it has already been acknowledge. But then I try doing a followUp, and it says it hasn't been replied. but I am able to reply to the interaction before I edit the channel's perms. Buttons names are unique, as they contain the channel's id in them too. Interaction has already been acknowledged:
const vcChannel = int.guild.channels.cache.get(channelID);

if (vcChannel instanceof VoiceChannel) {
// Set permissions to deny the mentioned user from viewing the channel
vcChannel.permissionOverwrites.edit(everyoneRoleId, {
Connect: false,
})
.then(() => {
const embed = new EmbedBuilder()
.setColor('#0099ff') // Set the color of the embed
.setDescription(`<@${member.id}>, el canal ha sido bloqueado correctamente.`) // Set the description

// Send the embed with the image attachment
int.reply({
embeds: [embed],
ephemeral: true,
});
})
}
const vcChannel = int.guild.channels.cache.get(channelID);

if (vcChannel instanceof VoiceChannel) {
// Set permissions to deny the mentioned user from viewing the channel
vcChannel.permissionOverwrites.edit(everyoneRoleId, {
Connect: false,
})
.then(() => {
const embed = new EmbedBuilder()
.setColor('#0099ff') // Set the color of the embed
.setDescription(`<@${member.id}>, el canal ha sido bloqueado correctamente.`) // Set the description

// Send the embed with the image attachment
int.reply({
embeds: [embed],
ephemeral: true,
});
})
}
The reply to this interaction has not been sent or deferred:
const vcChannel = int.guild.channels.cache.get(channelID);

if (vcChannel instanceof VoiceChannel) {
// Set permissions to deny the mentioned user from viewing the channel
vcChannel.permissionOverwrites.edit(everyoneRoleId, {
Connect: false,
})
.then(() => {
const embed = new EmbedBuilder()
.setColor('#0099ff') // Set the color of the embed
.setDescription(`<@${member.id}>, el canal ha sido bloqueado correctamente.`) // Set the description

// Send the embed with the image attachment
int.followUp({
embeds: [embed],
ephemeral: true,
});
})
}
const vcChannel = int.guild.channels.cache.get(channelID);

if (vcChannel instanceof VoiceChannel) {
// Set permissions to deny the mentioned user from viewing the channel
vcChannel.permissionOverwrites.edit(everyoneRoleId, {
Connect: false,
})
.then(() => {
const embed = new EmbedBuilder()
.setColor('#0099ff') // Set the color of the embed
.setDescription(`<@${member.id}>, el canal ha sido bloqueado correctamente.`) // Set the description

// Send the embed with the image attachment
int.followUp({
embeds: [embed],
ephemeral: true,
});
})
}
4 replies
CC#
Created by [ 💖 ] ElBretxa on 6/17/2023 in #help
❔ Merge dll into exe
I have recently made an app to set the discord's Rich Presence, and I want to be able to distribute it easily, so I was looking forward into merging 2 dlls into the .exe. I have tried multiple times and I havent been successful, so help would be appreciated
4 replies
DIAdiscord.js - Imagine an app
Created by [ 💖 ] ElBretxa on 1/1/2023 in #djs-questions
HTTPERROR [FetchError]
After running the bot for a while, it stops working and if I try to use a command again I would get HTTPERROR
HTTPError [FetchError]: request to https://discord.com/api/v9/interactions/1058902412041146498/aW50ZXJhY3Rpb246MTODpXYTNXTkJnQzdxckZxTld3a0ZNYkZBczl4VnJmS3ZIWjZiZEU2dVFUczBZZGRWRzUzQTRQTHV6Qmw3aFJudExBS1V6cVhGSjlzYkNYZlFRMFpuY21RSmdKNU94VTRVTjY3Ug/callback failed, reason: getaddrinfo ENOTFOUND discord.com
at RequestHandler.execute (C:\Users\ElBretxa\Desktop\personalbot\node_modules\discord.js\src\rest\RequestHandler.js:201:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RequestHandler.push (C:\Users\ElBretxa\Desktop\personalbot\node_modules\discord.js\src\rest\RequestHandler.js:51:14)
at async CommandInteraction.reply (C:\Users\ElBretxa\Desktop\personalbot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:99:5) {
code: 500,
method: 'post',
path: '/interactions/1058902412041146498/aW50ZXJhY3Rpb246MTA1ODkwMjQxMjA0MTE0NjQ5ODpXZxTld3a0ZNYkZBczl4VnJmS3ZIWjZiZEU2dVFUczBZZGRWRzUzmw3aFJudExBS1V6cVhGSjlzYkNYZlFRMFpuY21RSmdKNU94VTRVTjY3Ug/callback',
requestData: { json: { type: 4, data: [Object] }, files: [] }
} Promise {
<rejected> HTTPError [FetchError]: request to https://discord.com/api/v9/interactions/1058902412041146498/aW50ZXJhY3Rpb246MTA1ODkwMjQxMjA0MTE0NjQ5ODpXYTNXTkJnQzdxckZxTld3a0ZQTRQMk5OMXhlQ0V5MTlTY082cVNvRE1jTU5JQXpYVlh3THV6Qmw3aFJudExBSdKNU94VTRVTjY3Ug/callback failed, reason: getaddrinfo ENOTFOUND discord.com
at RequestHandler.execute (C:\Users\ElBretxa\Desktop\personalbot\node_modules\discord.js\src\rest\RequestHandler.js:201:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RequestHandler.push (C:\Users\ElBretxa\Desktop\personalbot\node_modules\discord.js\src\rest\RequestHandler.js:51:14)
at async CommandInteraction.reply (C:\Users\ElBretxa\Desktop\personalbot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:99:5) {
code: 500,
method: 'post',
path: '/interactions/1058902412041146498/aW50ZXJhY3Rpb246MTA1ODkwMjQxMjA0MTE0NjQ5ODpXYTNXTkJnQzdxckZxTld3a0ZNYkZBczl4VnJmS3ZIWjZiZEU2dVFUczBvRE1jTU5JQXpYVlh3THV6Qmw3aFJudExBS1V6cVhGSjlzYkNYZlFRMFpuY21RSmdKNU94VTRVTjY3Ug/callback',
requestData: { json: [Object], files: [] }
}
}
HTTPError [FetchError]: request to https://discord.com/api/v9/interactions/1058902412041146498/aW50ZXJhY3Rpb246MTODpXYTNXTkJnQzdxckZxTld3a0ZNYkZBczl4VnJmS3ZIWjZiZEU2dVFUczBZZGRWRzUzQTRQTHV6Qmw3aFJudExBS1V6cVhGSjlzYkNYZlFRMFpuY21RSmdKNU94VTRVTjY3Ug/callback failed, reason: getaddrinfo ENOTFOUND discord.com
at RequestHandler.execute (C:\Users\ElBretxa\Desktop\personalbot\node_modules\discord.js\src\rest\RequestHandler.js:201:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RequestHandler.push (C:\Users\ElBretxa\Desktop\personalbot\node_modules\discord.js\src\rest\RequestHandler.js:51:14)
at async CommandInteraction.reply (C:\Users\ElBretxa\Desktop\personalbot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:99:5) {
code: 500,
method: 'post',
path: '/interactions/1058902412041146498/aW50ZXJhY3Rpb246MTA1ODkwMjQxMjA0MTE0NjQ5ODpXZxTld3a0ZNYkZBczl4VnJmS3ZIWjZiZEU2dVFUczBZZGRWRzUzmw3aFJudExBS1V6cVhGSjlzYkNYZlFRMFpuY21RSmdKNU94VTRVTjY3Ug/callback',
requestData: { json: { type: 4, data: [Object] }, files: [] }
} Promise {
<rejected> HTTPError [FetchError]: request to https://discord.com/api/v9/interactions/1058902412041146498/aW50ZXJhY3Rpb246MTA1ODkwMjQxMjA0MTE0NjQ5ODpXYTNXTkJnQzdxckZxTld3a0ZQTRQMk5OMXhlQ0V5MTlTY082cVNvRE1jTU5JQXpYVlh3THV6Qmw3aFJudExBSdKNU94VTRVTjY3Ug/callback failed, reason: getaddrinfo ENOTFOUND discord.com
at RequestHandler.execute (C:\Users\ElBretxa\Desktop\personalbot\node_modules\discord.js\src\rest\RequestHandler.js:201:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RequestHandler.push (C:\Users\ElBretxa\Desktop\personalbot\node_modules\discord.js\src\rest\RequestHandler.js:51:14)
at async CommandInteraction.reply (C:\Users\ElBretxa\Desktop\personalbot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:99:5) {
code: 500,
method: 'post',
path: '/interactions/1058902412041146498/aW50ZXJhY3Rpb246MTA1ODkwMjQxMjA0MTE0NjQ5ODpXYTNXTkJnQzdxckZxTld3a0ZNYkZBczl4VnJmS3ZIWjZiZEU2dVFUczBvRE1jTU5JQXpYVlh3THV6Qmw3aFJudExBS1V6cVhGSjlzYkNYZlFRMFpuY21RSmdKNU94VTRVTjY3Ug/callback',
requestData: { json: [Object], files: [] }
}
}
What is the reason for this? I actually run a command in a channel, and keeps deleting the channel messages and sends updated query server info when a player joins and leave the game server. I also get RTC Connecting in my main discord when my bot stops working, and I can join any call until I stop it and restart discord.
15 replies
DIAdiscord.js - Imagine an app
Created by [ 💖 ] ElBretxa on 12/9/2022 in #djs-questions
Send a const in a code block
Need to send a constant inside a code block
const number = 5;
await interaction.channel.send("
const number = 5;
await interaction.channel.send("
{number}
")
")
4 replies
DIAdiscord.js - Imagine an app
Created by [ 💖 ] ElBretxa on 11/26/2022 in #djs-voice
Audio not playing
const Discord = require("discord.js")
const { Server, RCON, MasterServer } = require('@fabricio-191/valve-server-query');
const { joinVoiceChannel } = require("@discordjs/voice")
const { createAudioPlayer } = require('@discordjs/voice');
const { createAudioResource } = require('@discordjs/voice');


module.exports = {
name: "up",
description: "will @everyone when server goes up",
options: [
{
name: "ip",
type: 3,
description: "server query ip",
required: true
}
],
timeout: 5000,
run: async (interaction, client) => {
await interaction.reply('Will @everyone once server is up')
const voiceChannel = interaction.member.voice.channel
const ip = interaction.options.get("ip").value

const ipsemidone = ip.split(":")

const buff = 1
while (buff == 1){
try{
const server = await Server({
ip: ipsemidone[0],//`'${ipsemidone[0]}'`,
port: parseInt(ipsemidone[1]),//parseInt(ipsemidone[1]),
timeout: 700,
});
break
}catch(err){
console.log('server is down')
}
}

console.log('Server UP')
await interaction.channel.send('@everyone SERVER UP!')

const connection = joinVoiceChannel({
channelId: interaction.member.voice.channelId,
guildId: interaction.guildId,
adapterCreator: interaction.guild.voiceAdapterCreator
})
const player = createAudioPlayer();
const resource = createAudioResource('C:\Users\ElBretxa\Desktop\Music-Slash-Bot-main\voicebooking-speech.mp3');
player.play(resource);


await interaction.channel.send('@everyone SERVER UP!')

//connection.destroy();
}
}
const Discord = require("discord.js")
const { Server, RCON, MasterServer } = require('@fabricio-191/valve-server-query');
const { joinVoiceChannel } = require("@discordjs/voice")
const { createAudioPlayer } = require('@discordjs/voice');
const { createAudioResource } = require('@discordjs/voice');


module.exports = {
name: "up",
description: "will @everyone when server goes up",
options: [
{
name: "ip",
type: 3,
description: "server query ip",
required: true
}
],
timeout: 5000,
run: async (interaction, client) => {
await interaction.reply('Will @everyone once server is up')
const voiceChannel = interaction.member.voice.channel
const ip = interaction.options.get("ip").value

const ipsemidone = ip.split(":")

const buff = 1
while (buff == 1){
try{
const server = await Server({
ip: ipsemidone[0],//`'${ipsemidone[0]}'`,
port: parseInt(ipsemidone[1]),//parseInt(ipsemidone[1]),
timeout: 700,
});
break
}catch(err){
console.log('server is down')
}
}

console.log('Server UP')
await interaction.channel.send('@everyone SERVER UP!')

const connection = joinVoiceChannel({
channelId: interaction.member.voice.channelId,
guildId: interaction.guildId,
adapterCreator: interaction.guild.voiceAdapterCreator
})
const player = createAudioPlayer();
const resource = createAudioResource('C:\Users\ElBretxa\Desktop\Music-Slash-Bot-main\voicebooking-speech.mp3');
player.play(resource);


await interaction.channel.send('@everyone SERVER UP!')

//connection.destroy();
}
}
The bot joins the voice channel, but it doesnt play anything. I think I followed the steps from the resourses so just linking them wont help.
3 replies