change: .greet / .bye will get properly disabled if the bot can't write to the specified channel

This commit is contained in:
Kwoth
2024-05-11 08:08:48 +00:00
parent 23c8dc00e8
commit c7cec25a29
2 changed files with 8 additions and 0 deletions

View File

@@ -222,6 +222,7 @@ public class GreetService : INService, IReadyExecutor
toDelete.DeleteAfter(conf.AutoDeleteByeMessagesTimer);
}
catch (HttpException ex) when (ex.DiscordCode == DiscordErrorCode.InsufficientPermissions
|| ex.DiscordCode == DiscordErrorCode.MissingPermissions
|| ex.DiscordCode == DiscordErrorCode.UnknownChannel)
{
Log.Warning(ex,
@@ -263,6 +264,7 @@ public class GreetService : INService, IReadyExecutor
toDelete.DeleteAfter(conf.AutoDeleteGreetMessagesTimer);
}
catch (HttpException ex) when (ex.DiscordCode == DiscordErrorCode.InsufficientPermissions
|| ex.DiscordCode == DiscordErrorCode.MissingPermissions
|| ex.DiscordCode == DiscordErrorCode.UnknownChannel)
{
Log.Warning(ex,