Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unknown channel type on Forum #2643

Closed
3 tasks done
Exorion1er opened this issue Mar 29, 2023 · 3 comments · Fixed by #2647
Closed
3 tasks done

[Bug]: Unknown channel type on Forum #2643

Exorion1er opened this issue Mar 29, 2023 · 3 comments · Fixed by #2647
Labels

Comments

@Exorion1er
Copy link

Exorion1er commented Mar 29, 2023

Check The Docs

  • 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

When the sample method is invoked with a channel type Forum (IForumChannel), it throws an error "Unknown channel type".
It doesn't throw any error when used in a post inside that same Forum.
The channel is not null, I debugged it to make sure.

This is my first bot using Discord-net so I might be doing something obviously wrong ? Sorry if that's the case.

Version

3.9.0
(Also checked with 3.10.0, same issue)

Working Version

No response

Logs

System.ArgumentException
HResult=0x80070057
Message=Unknown channel type. Arg_ParamName_Name
Source=Discord.Net.Core
StackTrace:
at Discord.ChannelPermissions.All(IChannel channel)
at Discord.Permissions.ResolveChannel(IGuild guild, IGuildUser user, IGuildChannel channel, UInt64 guildPermissions)
at Discord.WebSocket.SocketGuildUser.GetPermissions(IGuildChannel channel)
at Fidobot.Controllers.CommandsController.d__1.MoveNext() in D:\Data\Projects\Fidobot\Controllers\CommandsController.cs:line 61
at Fidobot.Controllers.CommandsController.d__2.MoveNext() in D:\Data\Projects\Fidobot\Controllers\CommandsController.cs:line 96

Sample

private static async Task<bool> DoesUserHavePerms(IGuildChannel channel, SocketSlashCommand cmd) {
  IGuildUser user = (IGuildUser)cmd.User;
  if (user.GetPermissions(channel).ManageThreads) {
    return true;
  }
  await cmd.RespondAsync("**ERROR:** You don't have the necessary permissions on this channel to execute that command.");
  return false;
}

Packages

None

@Exorion1er Exorion1er added the bug label Mar 29, 2023
@Exorion1er
Copy link
Author

After some digging I found this which doesn't contain Forum.
This is all guess work tho.

@quinchs
Copy link
Member

quinchs commented Mar 29, 2023

@Misha-133 can you take a look?

@Misha-133
Copy link
Member

@Misha-133 can you take a look?

Yup
Was going to look at this after I'm done with the audit log event

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants