it's me...
it's me...
DIAdiscord.js - Imagine an app
Created by it's me... on 5/3/2024 in #djs-questions
need help
I realize that my code may be unreadable, but LFG-Message.js im creating VC
const voiceChannel = await createEventVoiceChannel(message.guild, message.channel, message.author, voiceChannelCounter);
const voiceChannel = await createEventVoiceChannel(message.guild, message.channel, message.author, voiceChannelCounter);
then creating Embed
const eventObject = getEventObject(message.guild, eventAuthor, authorBungieID, message.content, thumbnailURL, voiceChannel, remainingSlots, membersRaidStatsArray.join('\n'));
const eventObject = getEventObject(message.guild, eventAuthor, authorBungieID, message.content, thumbnailURL, voiceChannel, remainingSlots, membersRaidStatsArray.join('\n'));
then sent embed in message.channel
const eventMessage = await message.channel.send(eventObject);
const eventMessage = await message.channel.send(eventObject);
then i save messageId and other event info in DB
const newEvent = new eventSchema({
messageId: eventMessage.id,
messageChannelId: message.channel.id,
eventDescription: message.content,
voiceChannelId: voiceChannel.id,
voiceChannelCounter: voiceChannelCounter,
authorId: message.author.id,
});
const newEvent = new eventSchema({
messageId: eventMessage.id,
messageChannelId: message.channel.id,
eventDescription: message.content,
voiceChannelId: voiceChannel.id,
voiceChannelCounter: voiceChannelCounter,
authorId: message.author.id,
});
LFG-Voice.js Then onVoiceStateUpdate im find event info in DB by voiceChannel.id
const event = await eventSchema.findOne({ voiceChannelId: voiceChannel.id });
const event = await eventSchema.findOne({ voiceChannelId: voiceChannel.id });
Then find other info
const { thumbnailURL } = channelParams[event.messageChannelId];
let remainingSlots = voiceChannel.userLimit - voiceChannel.members.size;

const eventAuthor = await updateAndGetEventAuthor(event, voiceChannel, voiceStateMember);
const authorBungieID = await getAuthorBungieID(eventAuthor.id);
const membersRaidStats = await getMembersRaidStats(voiceChannel, eventAuthor.id, event.messageChannelId);

const membersRaidStatsArray = Array.isArray(membersRaidStats)? membersRaidStats : [membersRaidStats];
const { thumbnailURL } = channelParams[event.messageChannelId];
let remainingSlots = voiceChannel.userLimit - voiceChannel.members.size;

const eventAuthor = await updateAndGetEventAuthor(event, voiceChannel, voiceStateMember);
const authorBungieID = await getAuthorBungieID(eventAuthor.id);
const membersRaidStats = await getMembersRaidStats(voiceChannel, eventAuthor.id, event.messageChannelId);

const membersRaidStatsArray = Array.isArray(membersRaidStats)? membersRaidStats : [membersRaidStats];
Then create new emded
const eventObject = getEventObject(voiceChannel.guild, eventAuthor, authorBungieID, event.eventDescription, thumbnailURL, voiceChannel, remainingSlots, membersRaidStatsArray.join('\n'));
const eventObject = getEventObject(voiceChannel.guild, eventAuthor, authorBungieID, event.eventDescription, thumbnailURL, voiceChannel, remainingSlots, membersRaidStatsArray.join('\n'));
Then fetch message and update it with eventObejct (new Embed)
const eventMessage = await eventChannel.messages.fetch(event.messageId).catch(() => null);
await eventMessage.edit(eventObject);
const eventMessage = await eventChannel.messages.fetch(event.messageId).catch(() => null);
await eventMessage.edit(eventObject);
11 replies
DIAdiscord.js - Imagine an app
Created by it's me... on 5/3/2024 in #djs-questions
need help
in first attempt all works fine, because i wait bot message before joining in VC, and bot successfully update embed but in second attempt i join in VC right before bot message, then he tries to update message, but message doesent exist yet
11 replies
DIAdiscord.js - Imagine an app
Created by it's me... on 5/3/2024 in #djs-questions
need help
No, the only problem is that the bot is trying to update a non-existent message (because it takes half a second longer than the channel to create it). Embed is created successfully and sent to the right channel, when I go to the voice channel the bot tries to update the Embed with my information. Here is a video demo of the error
11 replies
DIAdiscord.js - Imagine an app
Created by it's me... on 5/3/2024 in #djs-questions
need help
The only solution I have found is to create a closed channel and then open it ( after the bot sends embed ) But I couldn't do it
11 replies
DIAdiscord.js - Imagine an app
Created by it's me... on 5/3/2024 in #djs-questions
need help
Screenshot from LFG-Message.js Line 83-84
11 replies
DIAdiscord.js - Imagine an app
Created by it's me... on 5/3/2024 in #djs-questions
need help
No description
11 replies
DIAdiscord.js - Imagine an app
Created by it's me... on 5/3/2024 in #djs-questions
need help
im aslo trying to create closed channel, then update permissions it successfully console.log ids but i still get error LFG-Message.js https://srcshare.io/6634b987c56cf36b82477a1a Error
849626183262797854
1217201760805060658
1220042458453381181
TypeError [InvalidType]: Supplied parameter is not a User nor a Role.
at PermissionOverwriteManager.upsert (C:\Users\ыффц\Desktop\bot\node_modules\discord.js\src\managers\PermissionOverwriteManager.js:101:30)
at PermissionOverwriteManager.edit (C:\Users\ыффц\Desktop\bot\node_modules\discord.js\src\managers\PermissionOverwriteManager.js:150:17)
at handleNewEvent (C:\Users\ыффц\Desktop\bot\src\events\messageCreate\LFG-Message.js:92:50)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async module.exports (C:\Users\ыффц\Desktop\bot\src\events\messageCreate\LFG-Message.js:21:7)
at async Client.<anonymous> (C:\Users\ыффц\Desktop\bot\node_modules\commandkit\dist\index.js:731:33) {
code: 'InvalidType'
}
TypeError: Cannot read properties of null (reading 'messageChannelId')
at updateEvent (C:\Users\ыффц\Desktop\bot\src\events\voiceStateUpdate\LFG-Voice.js:46:48)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async updateOrDeleteEvent (C:\Users\ыффц\Desktop\bot\src\events\voiceStateUpdate\LFG-Voice.js:27:5)
at async module.exports (C:\Users\ыффц\Desktop\bot\src\events\voiceStateUpdate\LFG-Voice.js:16:7)
at async Client.<anonymous> (C:\Users\ыффц\Desktop\bot\node_modules\commandkit\dist\index.js:731:33)
849626183262797854
1217201760805060658
1220042458453381181
TypeError [InvalidType]: Supplied parameter is not a User nor a Role.
at PermissionOverwriteManager.upsert (C:\Users\ыффц\Desktop\bot\node_modules\discord.js\src\managers\PermissionOverwriteManager.js:101:30)
at PermissionOverwriteManager.edit (C:\Users\ыффц\Desktop\bot\node_modules\discord.js\src\managers\PermissionOverwriteManager.js:150:17)
at handleNewEvent (C:\Users\ыффц\Desktop\bot\src\events\messageCreate\LFG-Message.js:92:50)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async module.exports (C:\Users\ыффц\Desktop\bot\src\events\messageCreate\LFG-Message.js:21:7)
at async Client.<anonymous> (C:\Users\ыффц\Desktop\bot\node_modules\commandkit\dist\index.js:731:33) {
code: 'InvalidType'
}
TypeError: Cannot read properties of null (reading 'messageChannelId')
at updateEvent (C:\Users\ыффц\Desktop\bot\src\events\voiceStateUpdate\LFG-Voice.js:46:48)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async updateOrDeleteEvent (C:\Users\ыффц\Desktop\bot\src\events\voiceStateUpdate\LFG-Voice.js:27:5)
at async module.exports (C:\Users\ыффц\Desktop\bot\src\events\voiceStateUpdate\LFG-Voice.js:16:7)
at async Client.<anonymous> (C:\Users\ыффц\Desktop\bot\node_modules\commandkit\dist\index.js:731:33)
11 replies
DIAdiscord.js - Imagine an app
Created by it's me... on 5/3/2024 in #djs-questions
need help
[email protected] node v20.11.1
11 replies
DIAdiscord.js - Imagine an app
Created by it's me... on 5/3/2024 in #djs-questions
need help
11 replies