mirror of
https://github.com/nichkara/InfinitumBotty.git
synced 2026-06-11 06:36:24 +02:00
368bce5ebd
Added CharactersCountObserver.py which outputs the written characters on command
23 lines
781 B
Python
23 lines
781 B
Python
import datetime
|
|
|
|
from FaustBot.Communication.Connection import Connection
|
|
from FaustBot.Model.UserProvider import UserProvider
|
|
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
|
|
|
|
|
|
class CharactersCountObserver(PrivMsgObserverPrototype):
|
|
@staticmethod
|
|
def cmd():
|
|
return [".characters"]
|
|
|
|
@staticmethod
|
|
def help():
|
|
return ".characters - um abzufragen wieviel du bisher geschrieben hast."
|
|
|
|
def update_on_priv_msg(self, data, connection: Connection):
|
|
if data['message'].find('.characters') == -1:
|
|
return
|
|
user_provider = UserProvider()
|
|
output = data['nick']+": du hast "+str(user_provider.get_characters(data['nick']))+ " Zeichen geschrieben."
|
|
connection.send_back(output, data)
|