mirror of
https://github.com/nichkara/InfinitumBotty.git
synced 2026-06-10 22:26:23 +02:00
.character f-string + startswith
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import datetime
|
||||
|
||||
from FaustBot.Communication.Connection import Connection
|
||||
from FaustBot.Model.UserProvider import UserProvider
|
||||
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
|
||||
@@ -15,8 +13,7 @@ class CharactersCountObserver(PrivMsgObserverPrototype):
|
||||
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)
|
||||
if data["message"].startswith(".characters"):
|
||||
user_provider = UserProvider()
|
||||
output = f"{data['nick']}: du hast {str(user_provider.get_characters(data['nick']))} Zeichen geschrieben."
|
||||
connection.send_back(output, data)
|
||||
|
||||
Reference in New Issue
Block a user