diff --git a/FaustBot/Modules/GiveDrinkObserver.py b/FaustBot/Modules/GiveDrinkObserver.py index 8132c64..fcbbecd 100644 --- a/FaustBot/Modules/GiveDrinkObserver.py +++ b/FaustBot/Modules/GiveDrinkObserver.py @@ -15,6 +15,8 @@ class GiveDrinkObserver(PrivMsgObserverPrototype): return ".drink - schenkt Getränke aus" def update_on_priv_msg(self, data: dict, connection: Connection): - if data['message'].find('.drink') == -1: - return - connection.send_back('\001ACTION schenkt ' + data['nick'] + ' ' + random.choice(getraenke) + ' ein.\001', data) + if data["message"].startswith(".drink"): + connection.send_back( + f"\001ACTION schenkt {data.get('nick')} {random.choice(getraenke)} ein.\001", + data, + ) diff --git a/FaustBot/Modules/GiveFoodObserver.py b/FaustBot/Modules/GiveFoodObserver.py index d306bc6..5e69ce2 100644 --- a/FaustBot/Modules/GiveFoodObserver.py +++ b/FaustBot/Modules/GiveFoodObserver.py @@ -15,6 +15,8 @@ class GiveFoodObserver(PrivMsgObserverPrototype): return ".food - gibt etwas zu essen aus" def update_on_priv_msg(self, data: dict, connection: Connection): - if data['message'].find('.food') == -1: - return - connection.send_back('\001ACTION tischt ' + data['nick'] + ' ' + random.choice(essen) + ' auf.\001', data) + if data["message"].startswith(".food"): + connection.send_back( + f"\001ACTION tischt {data['nick']} {random.choice(essen)} auf.\001", + data, + ) diff --git a/FaustBot/Modules/GiveIceObserver.py b/FaustBot/Modules/GiveIceObserver.py index 2b541a8..f141e91 100644 --- a/FaustBot/Modules/GiveIceObserver.py +++ b/FaustBot/Modules/GiveIceObserver.py @@ -15,6 +15,8 @@ class GiveIceObserver(PrivMsgObserverPrototype): return ".ice - serviert Eis" def update_on_priv_msg(self, data: dict, connection: Connection): - if data['message'].find('.ice') == -1: - return - connection.send_back('\001ACTION serviert ' + data['nick'] + ' ' + random.choice(icecream) + '.\001', data) + if data["message"].startswith(".ice"): + connection.send_back( + f"\001ACTION serviert {data['nick']} {random.choice(icecream)}.\001", + data, + )