mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
aaas
This commit is contained in:
@@ -70,7 +70,7 @@ MUZYKA_MOJEGO_LUDU_PLAJLISTA = 30
|
||||
FILE_SERVICE_ADDRESS = "http://192.168.1.15:5000"
|
||||
GET_MP3 = "/mp3"
|
||||
SEND_MP3 = "/update_mp3"
|
||||
|
||||
TIME_BETWEEN_CALLS = 3
|
||||
LAST_SPONTANEOUS_CALL = datetime.now()
|
||||
|
||||
# *=========================================== Platform Specific Predefines
|
||||
@@ -649,7 +649,9 @@ async def check_data():
|
||||
tdelta = datetime.now() - LAST_SPONTANEOUS_CALL
|
||||
tdelta = tdelta.total_seconds()
|
||||
logger.info(tdelta)
|
||||
if tdelta > 20:
|
||||
global TIME_BETWEEN_CALLS
|
||||
if tdelta > TIME_BETWEEN_CALLS:
|
||||
TIME_BETWEEN_CALLS = 600 #temp
|
||||
LAST_SPONTANEOUS_CALL = datetime.now()
|
||||
async with channel.typing():
|
||||
message = await get_random_cyclic_message()
|
||||
@@ -680,6 +682,7 @@ async def get_random_cyclic_message():
|
||||
result, MESSAGE_TABLE = await handle_response(
|
||||
"Opowiedz jakąś historię o naszym barze proszę", True, True, MESSAGE_TABLE, "Polish Hammer", "RANDOM"
|
||||
)
|
||||
logger.info(result)
|
||||
else:
|
||||
logger.info("Wtracenie w dyskusje")
|
||||
messages = [message async for message in channel.history(limit=50)]
|
||||
@@ -689,6 +692,7 @@ async def get_random_cyclic_message():
|
||||
result, MESSAGE_TABLE = await handle_response(
|
||||
"A jaka jest Twoja opinia na temat dotychczasowej dyskusji?", True, True, MESSAGE_TABLE, "Polish Hammer", "RANDOM"
|
||||
)
|
||||
logger.info(result)
|
||||
return result
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user