mirror of
https://github.com/nichkara/InfinitumBotty.git
synced 2026-06-11 06:36:24 +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.Communication.Connection import Connection
|
||||||
from FaustBot.Model.UserProvider import UserProvider
|
from FaustBot.Model.UserProvider import UserProvider
|
||||||
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
|
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
|
||||||
@@ -15,8 +13,7 @@ class CharactersCountObserver(PrivMsgObserverPrototype):
|
|||||||
return ".characters - um abzufragen wieviel du bisher geschrieben hast."
|
return ".characters - um abzufragen wieviel du bisher geschrieben hast."
|
||||||
|
|
||||||
def update_on_priv_msg(self, data, connection: Connection):
|
def update_on_priv_msg(self, data, connection: Connection):
|
||||||
if data['message'].find('.characters') == -1:
|
if data["message"].startswith(".characters"):
|
||||||
return
|
|
||||||
user_provider = UserProvider()
|
user_provider = UserProvider()
|
||||||
output = data['nick']+": du hast "+str(user_provider.get_characters(data['nick']))+ " Zeichen geschrieben."
|
output = f"{data['nick']}: du hast {str(user_provider.get_characters(data['nick']))} Zeichen geschrieben."
|
||||||
connection.send_back(output, data)
|
connection.send_back(output, data)
|
||||||
|
|||||||
Reference in New Issue
Block a user