From f92745035203746bb8540fc73062879b7e870117 Mon Sep 17 00:00:00 2001 From: Ske Date: Sat, 2 May 2020 15:45:45 +0200 Subject: [PATCH] Report bot permissions to Sentry --- PluralKit.Bot/Handlers/MessageCreated.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PluralKit.Bot/Handlers/MessageCreated.cs b/PluralKit.Bot/Handlers/MessageCreated.cs index 42bedd41..955b592b 100644 --- a/PluralKit.Bot/Handlers/MessageCreated.cs +++ b/PluralKit.Bot/Handlers/MessageCreated.cs @@ -139,6 +139,11 @@ namespace PluralKit.Bot {"message", evt.Message.Id.ToString()}, }); _sentryScope.SetTag("shard", evt.Client.ShardId.ToString()); + + // Also report information about the bot's permissions in the channel + // We get a lot of permission errors so this'll be useful for determining problems + var perms = evt.Channel.BotPermissions(); + _sentryScope.AddBreadcrumb(perms.ToPermissionString(), "permissions"); } } } \ No newline at end of file