This commit is contained in:
2024-04-01 13:11:33 +02:00
parent 22d2c8ab39
commit ba5be99bce
4 changed files with 161393 additions and 4 deletions
+16 -4
View File
@@ -317,7 +317,6 @@ async def on_message(message):
channel = message.channel
await client.process_commands(message)
# TODO: wpiac jego reakcje we framework chatu GPT
message.content = message.content.lower()
tdelta = datetime.now() - MASTER_TIMEOUT
@@ -611,7 +610,6 @@ async def check_data():
in a Discord channel.
"""
# trunk-ignore(codespell/misspelled)
# TODO: dlaczego sie tu wypierdala
logger.info("Heartbeat of cleanup proc")
channel = client.get_channel(1062047367337095268)
messages = [message async for message in channel.history(limit=1)]
@@ -1854,7 +1852,7 @@ async def zagraj_muzyke_mego_ludu(ctx):
final_key_words.extend(key_words[-MUZYKA_MOJEGO_LUDU_SLOWA_KLUCZOWE:])
reply = "Wygenerowana plejlista:\n"
async with ctx.typing():
logger.info("Zaczynam szukać timestamp %s", datetime.now())
logger.info("Zagraj muzyke mego ludu:Zaczynam szukać timestamp %s", datetime.now())
search_time_glob = datetime.now()
file = await wyszukaj(
ctx=ctx,
@@ -1864,7 +1862,7 @@ async def zagraj_muzyke_mego_ludu(ctx):
logger.info("Zagraj muzyke mego ludu:wygenerowano plejliste")
logger.info(file)
logger.info(
"Koniec szukania(timestamp %s zajęło %s",
"Zagraj muzyke mego ludu: Koniec szukania(timestamp %s zajęło %s",
datetime.now(),
datetime.now() - search_time_glob,
)
@@ -1963,6 +1961,20 @@ async def parametry_muzyki_mego_ludu(
ctx.send("Spierdalaj")
logger.info(exce)
class DoSearchView(discord.ui.View):
@discord.ui.button(label="Test", style=discord.ButtonStyle.danger, emoji=":)")
async def button_callback(self, button, interaction):
await interaction.response.send_message("You clicked the button!") # Send a message when the button is clicked
@client.hybrid_command(
name="znajdz_linki_do_dokumentow",
description="Szuka linkow doi w bazie crossref i podaje linki do scihuba",
guild=discord.Object(id=664789470779932693),
)
async def parametry_muzyki_mego_ludu(
ctx, ile_historii=1500, ile_slow_kluczowych=15, jak_dluga_plejlista=30
):
# *================================== Run
logger.info("Starting discord bot")