Closed Johns3n closed 9 months ago
Nevermind, refactored the class into this and it works! :) Hope if someone else has this problem they come across this issue:
import { ArgsOf, Discord, On } from "discordx";
@Discord()
export class Common {
@On({ event: "voiceStateUpdate" })
onVoiceStateUpdate([oldState, newState]: ArgsOf<"voiceStateUpdate">){
console.log(oldState.channelId);
console.log(newState.channelId);
}
}
What happened?
I have the following listener command in my bot:
And i have the
IntentsBitField.Flags.GuildVoiceStates
in my main.ts file and when i run the above command that console outputs the following for me:but when i try to access ANY member on the oldstate object like
oldState.channelId
it returns "undefined" in the console log. When my bot joined i made it have all the priviliged gateways enabled and also it joined in the "bot" scope and also had "administrator" as it's bot's permissions.Am I doing something wrong in trying to access the oldState's and newState's (which does the same) channelId with the above code?
Reproduction
installed discordX as per specs made bot join created class from "what happend" field
Package
discordx
Version
Stable
Relevant log output
No response
Code of Conduct