#channels have a few typeguarding methods
1 messages · Page 1 of 1 (latest)
Thanks, but that probably won't help me with my current issue
I'm currently developing a Template Base and I would love to support Typescript in the best way possible and never use the any type. But currently i'm experiencing this issue:
This is in my interactionCreate event which takes a interaction of the type CommandInteraction as argument but the channel can still be a DMChannel but normally that event would not occure because it is only executed it the event got fired in a guild
well if you had elaborated on the issue from the start I could have pointed you to <CommandInteraction>.inGuild()
Documentation suggestion for @robust condor:
CommandInteraction#inGuild()
Indicates whether this interaction is received from a guild.
Documentation suggestion for @robust condor:
CommandInteraction#inCachedGuild()
Indicates whether or not this interaction is both cached and received from a guild.