mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
async
This commit is contained in:
@@ -592,13 +592,11 @@ async def check_data():
|
||||
messages = [message async for message in channel.history(limit=1)]
|
||||
for mess in messages:
|
||||
channel = mess.channel
|
||||
async with channel.typing():
|
||||
asyncio.wait(10)
|
||||
if os.path.getsize(LOGFILE) > 6000000:
|
||||
await channel.send(
|
||||
"*Conjurer porządkuje bar, wypala szklanki do czysta miotaczem płomieni ze swojej zbroi i ogólnie wygląda na zajętego....*"
|
||||
)
|
||||
with channel.typing():
|
||||
async with channel.typing():
|
||||
shutil.copyfile(LOGFILE, f"{LOGSTORE}discord{datetime.now()}")
|
||||
logger.info("Log rollover")
|
||||
handler.doRollover()
|
||||
@@ -610,7 +608,7 @@ async def check_data():
|
||||
await channel.send(
|
||||
"*Conjurer porządkuje bar, wypala szklanki do czysta miotaczem płomieni ze swojej zbroi i ogólnie wygląda na zajętego....*"
|
||||
)
|
||||
with channel.typing():
|
||||
async with channel.typing():
|
||||
path_newfile = f"{LOGSTORE}{MEMORY_FIVE_MUZYKA[:-4]}{datetime.now()}.json"
|
||||
with open(MEMORY_FIVE_MUZYKA, "r+", encoding=ENCODING) as file_music_memory:
|
||||
with open(path_newfile, "x", encoding=ENCODING) as new_file:
|
||||
@@ -653,7 +651,7 @@ async def check_data():
|
||||
logger.info(tdelta)
|
||||
if tdelta > 12:
|
||||
LAST_SPONTANEOUS_CALL = datetime.now()
|
||||
with channel.typing():
|
||||
async with channel.typing():
|
||||
message = get_random_cyclic_message()
|
||||
await channel.send(message)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user