From 7dc8ac062341f9b680c13b97d1bd4042072939a2 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 23 Jan 2020 21:46:51 -0800 Subject: [PATCH] Channels: `chanrem` now removes ban and mute timeouts as well --- PBot/Channels.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/PBot/Channels.pm b/PBot/Channels.pm index c40b4640..e25d78d9 100644 --- a/PBot/Channels.pm +++ b/PBot/Channels.pm @@ -77,6 +77,22 @@ sub remove { return "Usage: chanrem "; } + $arguments = lc $arguments; + + # clear unban timeouts + if (exists $self->{pbot}->{chanops}->{unban_timeout}->{hash}->{$arguments}) { + delete $self->{pbot}->{chanops}->{unban_timeout}->{hash}->{$arguments}; + $self->{pbot}->{chanops}->{unban_timeout}->save; + } + + # clear unmute timeouts + if (exists $self->{pbot}->{chanops}->{unmute_timeout}->{hash}->{$arguments}) { + delete $self->{pbot}->{chanops}->{unmute_timeout}->{hash}->{$arguments}; + $self->{pbot}->{chanops}->{unmute_timeout}->save; + } + + # TODO: ignores, etc? + return $self->{channels}->remove($arguments); }