From e290e7d656b7fa11e07a4f0e0789a4b1e7d6deb5 Mon Sep 17 00:00:00 2001 From: mtuszowski Date: Fri, 15 Nov 2024 18:33:31 +0100 Subject: [PATCH] ADdded smth --- ai_commands.py | 26 +++++++++++++++++--------- conjurer_musician/radio_conjurer.liq | 1 - 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ai_commands.py b/ai_commands.py index 60e76ec..19f7b4b 100644 --- a/ai_commands.py +++ b/ai_commands.py @@ -4,7 +4,7 @@ import re import sys from enum import Enum from datetime import datetime -from typing import Optional, TypedDict +from typing import Optional import discord import openai @@ -88,14 +88,21 @@ class Events(commands.Cog): description="Jeśli nie wiesz jak użyć tej komendy to nawet nie próbuj" ) async def armia_hammera(self, ctx, message_txt: str, recipient: Optional[discord.User]): - pass + await self.armia_hammera_back(ctx, message_txt, recipient) - async def armia_hammera_back(): - #user = await self.bot.fetch_user(703985955312238664) - #channel = await user.create_dm() - #await channel.send(message.content) - #await message.reply(f"Poszlo do Saint {message.content}") - pass + async def armia_hammera_back(self, ctx, message_txt, recipient = None): + recipients = [] + if recipient: + recipients.append(recipient.id) + else: + for superfryta in SPECJALNE_ZIEMNIACZKI.values(): + recipients.append(superfryta[0]) + + for item in recipients: + user = await self.bot.fetch_user(item) + channel = await user.create_dm() + self.logger.info("User %s -> %s: %s", ctx.message.author, user, message_txt) + #await channel.send(message_txt) @@ -147,7 +154,8 @@ class Events(commands.Cog): await ai_functions.echo(message) return elif self.armia[message.author.id]== Dm_Mode.ARMIA_HAMMERA: - #self.armia_hammera_back() + ctx = await self.bot.get_context(message) + self.armia_hammera_back(ctx=ctx, message_txt=message.content) return elif self.armia[message.author.id]== Dm_Mode.SEKRETNY_SEKSRET: pass diff --git a/conjurer_musician/radio_conjurer.liq b/conjurer_musician/radio_conjurer.liq index c26f5e1..2db40b0 100644 --- a/conjurer_musician/radio_conjurer.liq +++ b/conjurer_musician/radio_conjurer.liq @@ -56,7 +56,6 @@ s = crossfade(fade_out=2., fade_in=2., duration=4., fallback(id="switcher", trac # Set up an interactive harbor for controlling the stream interactive.harbor(port = 9999) -#harbor.input(buffer=30.0) # Set up interactive controls for bass boost f = interactive.float("f", description="Frequency", min=0., max=1000., unit="Hz", 200.) g = interactive.float("g", description="Gain", min=0., max=20., unit="dB", 8.)