mirror of
https://github.com/nichkara/InfinitumBotty.git
synced 2026-06-10 22:26:23 +02:00
.hug multi-variant edition
This commit is contained in:
@@ -5,6 +5,18 @@ from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
|
|||||||
|
|
||||||
|
|
||||||
class FreeHugsObserver(PrivMsgObserverPrototype):
|
class FreeHugsObserver(PrivMsgObserverPrototype):
|
||||||
|
hug_variants = [
|
||||||
|
"nimmt {{nick}}{hug_adjective} in die Arme",
|
||||||
|
"{hug_word} {{nick}}{hug_adjective}",
|
||||||
|
]
|
||||||
|
possible_hugs = {
|
||||||
|
variant.format(hug_word=word, hug_adjective=adjective)
|
||||||
|
for variant in hug_variants
|
||||||
|
for word in ["umarmt", "knuddelt", "drückt", "herzt"]
|
||||||
|
for adjective in [" fest", " herzlichst", " sanft", ""]
|
||||||
|
}
|
||||||
|
possible_hugs = list(possible_hugs)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def cmd():
|
def cmd():
|
||||||
return [".hug"]
|
return [".hug"]
|
||||||
@@ -15,5 +27,5 @@ class FreeHugsObserver(PrivMsgObserverPrototype):
|
|||||||
|
|
||||||
def update_on_priv_msg(self, data: dict, connection: Connection):
|
def update_on_priv_msg(self, data: dict, connection: Connection):
|
||||||
if data["message"].startswith(".hug"):
|
if data["message"].startswith(".hug"):
|
||||||
hug_word = random.choice(["umarmt", "knuddelt", "drückt", "herzt"])
|
hug_response = (random.choice(self.possible_hugs)).format(nick=data["nick"])
|
||||||
connection.send_back(f"\001ACTION {hug_word} {data['nick']}.\001", data)
|
connection.send_back(f"\001ACTION {hug_response}.\001", data)
|
||||||
|
|||||||
Reference in New Issue
Block a user