mirror of
https://github.com/nichkara/InfinitumBotty.git
synced 2026-06-10 22:26:23 +02:00
Initalize repo
This commit is contained in:
20
FaustBot/Modules/SnacksObserver.py
Normal file
20
FaustBot/Modules/SnacksObserver.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import random
|
||||
|
||||
from FaustBot.Communication.Connection import Connection
|
||||
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
|
||||
from snacks import snacks
|
||||
|
||||
|
||||
class SnacksObserver(PrivMsgObserverPrototype):
|
||||
@staticmethod
|
||||
def cmd():
|
||||
return [".snack"]
|
||||
|
||||
@staticmethod
|
||||
def help():
|
||||
return ".snack - teilt Snacks aus"
|
||||
|
||||
def update_on_priv_msg(self, data: dict, connection: Connection):
|
||||
if data['message'].find('.snack') == -1:
|
||||
return
|
||||
connection.send_back('\001ACTION serviert ' + data['nick'] + ' ' + random.choice(snacks) + '.\001', data)
|
||||
Reference in New Issue
Block a user