WARN log when we try to remove a mode from ourselves that we didn't have

This commit is contained in:
jesopo 2019-06-21 11:16:53 +01:00
parent 01438f28f6
commit bffc5b0ec4

View file

@ -160,6 +160,9 @@ class Server(IRCObject.Object):
def remove_own_mode(self, mode: str): def remove_own_mode(self, mode: str):
if mode in self.own_modes: if mode in self.own_modes:
del self.own_modes[mode] del self.own_modes[mode]
else:
self.bot.log.warn("Tried to remove unknown own mode %s on %s",
[mode, str(self)])
def change_own_mode(self, remove: bool, mode: str, arg: str=None): def change_own_mode(self, remove: bool, mode: str, arg: str=None):
if remove: if remove:
self.remove_own_mode(mode) self.remove_own_mode(mode)