Poprawiono obsluge rotowanych logow i troche ulepszono funkcje

opowiadania o fabryczcce
This commit is contained in:
2023-06-06 12:51:17 +02:00
parent 907a1aa987
commit f2d5673555
+11 -2
View File
@@ -26,7 +26,7 @@ from spotify_dl import youtube as youtube_download
import yt_dlp
from spotipy.oauth2 import SpotifyClientCredentials
import logging.handlers as handlers
import shutil
# *=========================================== Predefines
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
@@ -156,6 +156,8 @@ async def on_message(message):
tdelta = tdelta.total_seconds()
if "opowiedz o fabryczce" in message.content:
await message.reply(historia_fabryczki)
if "opowiedz mi o fabryczce" in message.content:
await message.reply(historia_fabryczki)
if tdelta > INITIAL_TIME_WAIT:
for word in word_reactions:
@@ -332,7 +334,10 @@ async def check():
await asyncio.sleep(10)
if not voiceClient.is_playing() and not voiceClient.is_paused():
await play(MUZYKA["ctx"], MUZYKA["requestor"])
if os.path.getsize(logfile) > 600000:
shutil.copyfile(logfile,"/home/pi/RetroPie/logs/discord{}.log".format(datetime.now()))
logger.info("Log rollover")
handler.doRollover()
await asyncio.sleep(60)
@@ -959,6 +964,10 @@ async def przytul(ctx, arg=None):
async def get_image_stable_diffusion(ctx, arg=None):
pass
@client.command()
async def fabryczka(ctx, arg=None):
await ctx.message.reply(historia_fabryczki)
# *================================== Run
client.run(TOKEN)