mirror of
https://github.com/nichkara/InfinitumBotty.git
synced 2026-06-11 14:41:58 +02:00
9ad637f653
Moved kekse to separate file kekse.py Changed command from 'givedrink' to 'give' (according to function) Fixed Typos, changed messages to match type of item given to user
21 lines
624 B
Python
21 lines
624 B
Python
import random
|
|
|
|
from FaustBot.Communication import Connection
|
|
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
|
|
from kekse import kekse
|
|
|
|
|
|
class GiveCookieObserver(PrivMsgObserverPrototype):
|
|
@staticmethod
|
|
def cmd():
|
|
return [".cookie"]
|
|
|
|
@staticmethod
|
|
def help():
|
|
return ".cookie - verteilt Kekse; oder auch nicht"
|
|
|
|
def update_on_priv_msg(self, data: dict, connection: Connection):
|
|
if data['message'].find('.cookie') == -1:
|
|
return
|
|
connection.send_back('\001ACTION schenkt ' + data['nick'] + ' ' + random.choice(kekse) + '.\001', data)
|