mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
tst
This commit is contained in:
+1
-3
@@ -67,11 +67,9 @@ class Events(commands.Cog):
|
||||
return
|
||||
if isinstance(message.channel, discord.DMChannel):
|
||||
if message.author.id == 346956223645614080:
|
||||
|
||||
await self.bot.process_commands(message)
|
||||
await ai_functions.hammer_assitant_chat(message)
|
||||
|
||||
# hammer pisze dma
|
||||
|
||||
# DM do Saint - przerobic na komende z parametrem "id"
|
||||
# user = await self.bot.fetch_user(703985955312238664)
|
||||
# channel = await user.create_dm()
|
||||
|
||||
+19
-1
@@ -318,5 +318,23 @@ async def hammer_assistant_create(client):
|
||||
|
||||
|
||||
async def hammer_assitant_chat(message):
|
||||
logger = logging.getLogger("discord")
|
||||
content = message.content
|
||||
await message.channel.send(f"ALOHA!{content}")
|
||||
assistant_data = ASSISTANTS["Conjurer"]
|
||||
run = OPENAICLIENT.beta.threads.runs.create_and_poll(
|
||||
thread_id=assistant_data[3].id,
|
||||
assistant_id=assistant_data[1].id,
|
||||
instructions=f"Pisze do Ciebie {assistant_data[0]} udziel mu wszelkiej pomocy",
|
||||
)
|
||||
done = False
|
||||
while not done:
|
||||
if run.status == "completed":
|
||||
messsages = OPENAICLIENT.beta.threads.messages.list(
|
||||
thread_id=assistant_data[3].id
|
||||
)
|
||||
logger.info(messsages)
|
||||
done = True
|
||||
else:
|
||||
logger.info(run.status)
|
||||
asyncio.sleep(5)
|
||||
await message.channel.send(f"Echo: {content}")
|
||||
|
||||
Reference in New Issue
Block a user