Files
ninachloe/FaustBot/Modules/GiveFoodObserver.py
T
2024-08-03 01:35:26 +02:00

23 lines
643 B
Python

import random
from FaustBot.Communication.Connection import Connection
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
from essen import essen
class GiveFoodObserver(PrivMsgObserverPrototype):
@staticmethod
def cmd():
return [".food"]
@staticmethod
def help():
return ".food - gibt etwas zu essen aus"
def update_on_priv_msg(self, data: dict, connection: Connection):
if data["message"].startswith(".food"):
connection.send_back(
f"\001ACTION tischt {data['nick']} {random.choice(essen)} auf.\001",
data,
)