#User Permission Issues

1 messages · Page 1 of 1 (latest)

trail moss
#

I am having this error:

Error occurred executing welcome set-message.
Discord.Interactions.InteractionException: Error occurred executing welcome set-message.
 ---> System.ArgumentException: Unknown channel type. (Parameter 'channel')
   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 Commands.WelcomeGroup.SetCustomWelcomeMessage(String message) in /app/commands/welcome-group/welcomeCommands.cs:line 80
   at Discord.Interactions.Builders.ModuleClassBuilder.<>c__DisplayClass11_0.<<CreateCallback>g__ExecuteCallback|1>d.MoveNext()
   --- End of inner exception stack trace ---

from this line:

if (Context.Guild.GetUser(Context.User.Id).GetPermissions(Context.Guild.SystemChannel).ManageChannel == false)
wary night
#

did you by chance turn off welcome messages in the guild? and/or don't have a channel set to have those sent?

trail moss
#

hmm a good thought but I just trested it and while it does cause an error which I need to accont for it happens later on

wary night
#

hmmm, maybe try manually casting the SystemChannel to an IGuildChannel? taking a wild shot in the dark here as its the only other thing I can think of when reading "Unknown channel type"

trail moss
#

hmm I will look into it and get back to you

slow ocean
#

I'm not super familiar with what a System Channel is. But according to the source code, the method GetPermissions can't accept any of the following channel types:

  • Guild Directory
  • News
  • News Thread
  • Private Thread
  • Public Thread
  • Store

I'm assuming threads aren't able to be system channels, not sure about the others. Just in case you're using one of those, it's not going to work.

wary night
#

System Channel is the channel set for guild welcome automated welcome messages. It's a TextChannel

slow ocean
#

I see

timid jacinth
#

Make sure you're using the latest version

trail moss
#

I am using

#

3.15.3

#

so I do not think so

trail moss
#

I still cannot figure this out

timid jacinth
#

I was saying it's a bug in the library