added 20 seconds delay to first greeters first greeting

This commit is contained in:
Baerbel Box
2024-06-15 13:57:01 +02:00
parent e25c015335
commit c3cf428910
+3 -1
View File
@@ -1,7 +1,7 @@
from FaustBot.Communication.Connection import Connection from FaustBot.Communication.Connection import Connection
from FaustBot.Modules.JoinObserverPrototype import JoinObserverPrototype from FaustBot.Modules.JoinObserverPrototype import JoinObserverPrototype
from FaustBot.Model.UserProvider import UserProvider from FaustBot.Model.UserProvider import UserProvider
from time import sleep
class First_Greeter(JoinObserverPrototype): class First_Greeter(JoinObserverPrototype):
""" """
A Class only reacting to pings A Class only reacting to pings
@@ -22,8 +22,10 @@ class First_Greeter(JoinObserverPrototype):
def update_on_join(self, data, connection: Connection): def update_on_join(self, data, connection: Connection):
if data['channel'] == connection.details.get_channel(): if data['channel'] == connection.details.get_channel():
if data['nick'].find("Guest") != -1: if data['nick'].find("Guest") != -1:
sleep(20)
connection.send_back(self.first_greeting + " " + data['nick'], data) connection.send_back(self.first_greeting + " " + data['nick'], data)
return return
UProvider= UserProvider() UProvider= UserProvider()
if(UProvider.get_characters(data['nick'])) < 100: if(UProvider.get_characters(data['nick'])) < 100:
sleep(20)
connection.send_back(self.first_greeting + " " + data['nick'], data) connection.send_back(self.first_greeting + " " + data['nick'], data)