diff --git a/bot.py b/bot.py index da8189a..b8cebe2 100644 --- a/bot.py +++ b/bot.py @@ -299,7 +299,7 @@ async def on_ready(): logger.debug("%s has connected to Discord!", client.user) await client.change_presence(activity=discord.Game(name="Axe Throwing Darts")) await client.tree.sync() - check_data.start() + check_self.start() @client.event @@ -679,10 +679,19 @@ async def check_music(): await play(MUZYKA["ctx"], MUZYKA["requester"]) await asyncio.sleep(2) +@tasks.loop(seconds=3) +# trunk-ignore(pylint/R0915) +async def check_data_q(): + channel = client.get_channel(1062047367337095268) + try: + data = IN_COMM_Q.get(block=False) + await channel.send("O. A tak będzie wyglądało coś ciekawego w przyszłości: {data}") + except Empty: + pass @tasks.loop(seconds=120) # trunk-ignore(pylint/R0915) -async def check_data(): +async def check_self(): """ The function `check_data` periodically checks for conditions to send messages and manage log files in a Discord channel.