.hug f-string and hug-variations (added umarmt und drückt)

This commit is contained in:
Context 77
2024-08-03 01:16:25 +02:00
parent 41621ad635
commit 55e09acff3

View File

@@ -1,3 +1,5 @@
import random
from FaustBot.Communication import Connection
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
@@ -12,6 +14,6 @@ class FreeHugsObserver(PrivMsgObserverPrototype):
return ".hug - verteilt Umarmungen"
def update_on_priv_msg(self, data: dict, connection: Connection):
if data['message'].find('.hug') == -1:
return
connection.send_back('\001ACTION knuddelt ' + data['nick'] + '.\001', data)
if data["message"].startswith(".hug"):
hug_word = random.choice(["umarmt", "knuddelt", "drückt"])
connection.send_back(f"\001ACTION {hug_word} {data['nick']}.\001", data)