RobbyV
RobbyV
DIAdiscord.js - Imagine an app
Created by RobbyV on 8/13/2023 in #djs-questions
member.dmChannel.awaitMessages() breaking when updating from v14.11 to v14.12
I currently have the following code which works perfectly in discord.js v14.11 however when I upgraded to v14.12, I started getting the following error Cannot read properties of null (reading 'awaitMessages'). This can't be an issue with the code since when I downgrade back to v14.11 it starts working perfectly again so I'm not sure what's going on.
let member = await client.users.fetch(memberId)
let message = await member.dmChannel.awaitMessages({ filter, max: 1, time: timeOutTime, errors: ['time'] });
let member = await client.users.fetch(memberId)
let message = await member.dmChannel.awaitMessages({ filter, max: 1, time: timeOutTime, errors: ['time'] });
23 replies
DIAdiscord.js - Imagine an app
Created by RobbyV on 5/30/2023 in #djs-questions
Unknown interaction for some commands in only one server
I have a bot that is sharded and is in a couple thousand servers and for some reason, in one server whenever a command is run, it shows "Unknown interaction" in the console while for the user it shows "Sending Command..." for a few seconds before updating to "This application did not respond.", I can't seem to figure out why this is happening as it even happens for commands that have deferReply on the first line and the error says unknown interaction right on that first line that defers the reply.
11 replies
DIAdiscord.js - Imagine an app
Created by RobbyV on 6/25/2022 in #djs-questions
Constant holding a collection of invites changing without being changed
I explained exactly what's going on in the comments of the code below, any help would be greatly appreciated.
client.on("guildMemberAdd", async (member) => {
let guild = member.guild
const oldInvites = await (Invites.get(guild.id) || new Collection()).clone()
console.log(oldInvites) // Logs old invites
console.log(Invites.get(guild.id)) // Logs old invites
const newInvites = await guild.invites.fetch().catch(() => { });
console.log(oldInvites) // Logs new invites for some reason???
console.log(Invites.get(guild.id)) // Logs new invites for some reason???
console.log(newInvites) // Logs new invites
})
client.on("guildMemberAdd", async (member) => {
let guild = member.guild
const oldInvites = await (Invites.get(guild.id) || new Collection()).clone()
console.log(oldInvites) // Logs old invites
console.log(Invites.get(guild.id)) // Logs old invites
const newInvites = await guild.invites.fetch().catch(() => { });
console.log(oldInvites) // Logs new invites for some reason???
console.log(Invites.get(guild.id)) // Logs new invites for some reason???
console.log(newInvites) // Logs new invites
})
28 replies