You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I double checked the docs and couldn't find any useful information.
Verify Issue Source
I verified the issue was caused by Discord.Net.
Check your intents
I double checked that I have the required intents.
Description
Everything is in the title.
Calling ChannelExtensions.GetChannelType on SocketForumChannel returns null instead of ChannelType.Forum.
While I'm well aware that this method can return null because of the type annotation, I find strange that it doesn't handle the case of a SocketForumChannel.
Version
3.8.1
Working Version
No response
Logs
Stack trace from the sample code:
System.InvalidOperationException: Nullable object must have a value.
at System.Nullable`1.get_Value()
at bot.Modules.SynchronizationModule.ReadyHandler() in /home/l4p1n/Code/CLI/discord-bot/bot/Modules/SynchronizationModule.cs:line 38
The channel type the code crashes on is SocketForumChannel. Its contents is irrelevant for this report.
Sample
// Note: The prerequisite code to initialize a client has been cut out// Replace zero with a real, existing forum channel ID.ulongforumChannelId=0;// _client is a DiscordSocketClientvarforumChannel= _client.GetChannel(forumChannelId)as SocketForumChannel;
Console.WriteLine($"Channel type number of channel ID {forumChannel.Name}"+$"is {(int)forumChannel.GetChannelType()}");// The snippet throws an exception with a stack trace similar to the// one provided in the "Logs" section
Packages
Not relevant. I can fill that in if requested.
The text was updated successfully, but these errors were encountered:
Check The Docs
Verify Issue Source
Check your intents
Description
Everything is in the title.
Calling
ChannelExtensions.GetChannelType
onSocketForumChannel
returnsnull
instead ofChannelType.Forum
.While I'm well aware that this method can return null because of the type annotation, I find strange that it doesn't handle the case of a
SocketForumChannel
.Version
3.8.1
Working Version
No response
Logs
Stack trace from the sample code:
The channel type the code crashes on is
SocketForumChannel
. Its contents is irrelevant for this report.Sample
Packages
Not relevant. I can fill that in if requested.
The text was updated successfully, but these errors were encountered: