ChannelCreate with my bot TS
DiscordJS: 14.5.0 Node: 16.16.0
(property) Guild.channels: GuildChannelManager | undefined
No overload matches this call.
Overload 2 of 2, '(options: GuildChannelCreateOptions): Promise<TextChannel> | undefined', gave the following error.
Type 'String' is not assignable to type 'CategoryChannelResolvable | null | undefined'.
Overload 2 of 2, '(options: GuildChannelCreateOptions): Promise<TextChannel> | undefined', gave the following error.
Type 'String' is not assignable to type 'string | GuildMember | Role | User | Message<boolean> | ThreadMember'.
Overload 2 of 2, '(options: GuildChannelCreateOptions): Promise<TextChannel> | undefined', gave the following error.
Type 'String' is not assignable to type 'string | GuildMember | Role | User | Message<boolean> | ThreadMember'.ts(2769)
index.d.ts(4901, 3): The expected type comes from property 'parent' which is declared here on type 'GuildChannelCreateOptions'
index.d.ts(2118, 10): The expected type comes from property 'id' which is declared here on type 'OverwriteResolvable'
index.d.ts(2118, 10): The expected type comes from property 'id' which is declared here on type 'OverwriteResolvable'
the IDs for Category, botrole and the everyone role are saved in a mongoDB
9 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.why is
Data.Category
type String
with a capital?
Oh, its a mongoose type isnt ityes
Yeah the mongoose
String
type is not the same as the native string
yea there all typed as
String
in the member?.id im also getting an error saying:
Property 'id' does not exist on type 'GuildMember | APIInteractionGuildMember'.
Property 'id' does not exist on type 'APIInteractionGuildMember'.
You havent typeguarded the interaction as being
inCachedGuild()
its a button interaction, if (!interaction.isButton()) return; is at the top of it
Okay, that doesn't change my answer
ButtonInteraction#inCachedGuild()
Indicates whether or not this interaction is both cached and received from a guild.