lilserf / bot-on-the-clocktower

Bot to assist with playing Blood on the Clocktower via Discord
MIT License
22 stars 4 forks source link

Error #167

Closed BrianKindly closed 1 year ago

BrianKindly commented 1 year ago

Trying to "endgame" and get this:

Interaction error [Guild: 1118289526083825725 Channel: 1129197902548455454] Exception: UnauthorizedException Message: Unauthorized: 403 : Missing Permissions Stack trace: at Bot.Core.Interaction.BaseInteractionErrorHandler1.TryProcessReportingErrorsAsync(TKey key, IMember requester, Func2 process) in /home/runner/work/bot-on-the-clocktower/bot-on-the-clocktower/Bot.Core/Interaction/BaseInteractionErrorHandler.cs:line 68

magroader commented 1 year ago

Typically a "Missing Permissions" error would mean that you don't have the authority to do something, such as adding/removing the roles from storytellers or players. This would happen if you aren't in charge of any roles ABOVE the storyteller/player roles in the server's role list (and aren't a server admin).

We are supposed to have a specific error message for this explaining what's going on. But it looks like maaaaybe we missed the error message in this case.

@lilserf This might be due to EndGameForTownAsync not using MemberHelper.RevokeRoleLoggingErrorsAsync. I'll go check on that!

BrianKindly commented 1 year ago

We tried both methods. Same error via DM. The game still hasn’t “ended” which I read was supposed to happen after a few hours anyway? On Jul 14, 2023, at 09:34, Colin C. @.***> wrote: Is that all it gave you? I would have expected a longer error message than that. Did it send you the message in a private message, or did the error appear in the channel where you used endgame? Did you click the button or use a /endgame slash command?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

magroader commented 1 year ago

@BrianKindly Do you have access to the owner of the server? Is the "Bot on the Clocktower" role below the Storyteller / Player roles in the Roles list? I'm trying to figure out what may have gone wrong here.

Yes the game is supposed to end eventually after a few hours of inactivity. Ending a game mostly means removing the Roles from all the players / storytellers in the game. If there's a problem removing those Roles (as there seems to be here) then the game won't appear to end simply because you'll still be able to see the Dark Alley, Cottages, etc.

BrianKindly commented 1 year ago

It is below those roles. Thinking about it now, I would assume it’s supposed to be above them. It did every other function fine aside from ending the game. On Jul 14, 2023, at 14:01, Colin C. @.***> wrote: @BrianKindly Do you have access to the owner of the server? Is the "Bot on the Clocktower" role below the Storyteller / Player roles in the Roles list? I'm trying to figure out what may have gone wrong here. Yes the game is supposed to end eventually after a few hours of inactivity. Ending a game mostly means removing the Roles from all the players / storytellers in the game. If there's a problem removing those Roles (as there seems to be here) then the game won't appear to end simply because you'll still be able to see the Dark Alley, Cottages, etc.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

magroader commented 1 year ago

Ah yes, a bot is not allowed remove roles ABOVE it in the roles list, so that's almost certainly the issue. You'll need to drag it up higher. Let me know if that works!

I've made the error message when this happens a little bit better, at least, so that should be a bit less confusing next time.

BrianKindly commented 1 year ago

Thank you, great work on this bot!!On Jul 14, 2023, at 15:37, Colin C. @.***> wrote: Ah yes, a bot is not allowed remove roles ABOVE it in the roles list, so that's almost certainly the issue. You'll need to drag it up higher. Let me know if that works! I've made the error message when this happens a little bit better, at least, so that should be a bit less confusing next time.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

magroader commented 1 year ago

Assuming the Role change fixed it... let us know if you have other issues!