From c7cec25a29b05791eed23b620ffdaeda9064b91b Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sat, 11 May 2024 08:08:48 +0000 Subject: [PATCH] change: .greet / .bye will get properly disabled if the bot can't write to the specified channel --- CHANGELOG.md | 6 ++++++ .../Modules/Administration/GreetBye/GreetService.cs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e0f48602..0215a7f44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.0.0/) except date format. a-c-f-r-o +## [5.0.6] + +### Changed + +- `.greet` and `.bye` will now be automatically disabled if the bot losses permissions to post in the specified channel + ## [5.0.5] - 11.05.2024 ### Fixed diff --git a/src/NadekoBot/Modules/Administration/GreetBye/GreetService.cs b/src/NadekoBot/Modules/Administration/GreetBye/GreetService.cs index 82cd936ec..383bb0446 100644 --- a/src/NadekoBot/Modules/Administration/GreetBye/GreetService.cs +++ b/src/NadekoBot/Modules/Administration/GreetBye/GreetService.cs @@ -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,