aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalmonik <raisersoft@proton.me>2026-03-17 17:16:37 +0100
committersalmonik <raisersoft@proton.me>2026-03-17 17:16:37 +0100
commit80cb6a625c784e46f43135f3716b1e1b43cd05b7 (patch)
tree9ce6bf6f88597922fc43cb5d0c16c128071f80d5
parentfix tts (diff)
downloadsenator-sperma-80cb6a625c784e46f43135f3716b1e1b43cd05b7.tar.gz
senator-sperma-80cb6a625c784e46f43135f3716b1e1b43cd05b7.zip
minor fixes
-rw-r--r--cogs/jarvis.py19
-rw-r--r--main.py4
2 files changed, 15 insertions, 8 deletions
diff --git a/cogs/jarvis.py b/cogs/jarvis.py
index b199c8a..bdb34f1 100644
--- a/cogs/jarvis.py
+++ b/cogs/jarvis.py
@@ -12,6 +12,7 @@ import logging
12import shutil 12import shutil
13from dotenv import load_dotenv 13from dotenv import load_dotenv
14import os 14import os
15from tempfile import NamedTemporaryFile
15from cogs.downloader import Downloader 16from cogs.downloader import Downloader
16 17
17logger = logging.getLogger(__name__) 18logger = logging.getLogger(__name__)
@@ -48,7 +49,7 @@ class Jarvis(commands.Cog):
48 response_message, action = Jarvis._parse_response(response_data) 49 response_message, action = Jarvis._parse_response(response_data)
49 50
50 channel = message.channel 51 channel = message.channel
51 await channel.send(response_message) 52 await message.reply(response_message)
52 53
53 if action == "download": 54 if action == "download":
54 await Jarvis._handle_download_action(message, channel) 55 await Jarvis._handle_download_action(message, channel)
@@ -57,15 +58,17 @@ class Jarvis(commands.Cog):
57 def _build_messages(message): 58 def _build_messages(message):
58 messages = [{ 59 messages = [{
59 "role": "system", 60 "role": "system",
60 "content": "your task is to tell the program what to do and how to respond after receiving a message.\n" 61 "content": "your name is Senator Sperma.\n"
62 "your task is to tell the program what to do and how to respond after receiving a message.\n"
61 "message field has to be filled out in polish.\n" 63 "message field has to be filled out in polish.\n"
62 "act like jarvis, be a personal assistant to user, do not use emojis\n" 64 "act like jarvis (only behavior wise), be a personal assistant to user, do not use emojis\n"
63 "do not ask the user if they want to do an action. the user will tell you that" 65 "do not ask the user if they want to do an action. the user will tell you that."
64 }] 66 }]
65 67
66 messages.append({ 68 messages.append({
67 "role": "user", 69 "role": "user",
68 "content": f"[from {message.author.display_name}]: {message.content}" 70 "content": f"{message.author.display_name}: {message.content}"
71
69 }) 72 })
70 73
71 if Jarvis._is_reply(message): 74 if Jarvis._is_reply(message):
@@ -83,11 +86,11 @@ class Jarvis(commands.Cog):
83 return [ 86 return [
84 { 87 {
85 "role": "user", 88 "role": "user",
86 "content": f"[original message from {original_msg.author.display_name}]: {original_msg.content}" 89 "content": f"{original_msg.author.display_name}: {original_msg.content}"
87 }, 90 },
88 { 91 {
89 "role": "user", 92 "role": "user",
90 "content": f"[reply from {message.author.display_name}]: {message.content}" 93 "content": f"{message.author.display_name}: {message.content}"
91 } 94 }
92 ] 95 ]
93 96
diff --git a/main.py b/main.py
index eaac7fe..96fb03f 100644
--- a/main.py
+++ b/main.py
@@ -34,8 +34,12 @@ settings = "settings.json"
34@bot.event 34@bot.event
35async def on_ready(): 35async def on_ready():
36 logger.info("ŁUKASZ SPERMA AKTYWACJA") 36 logger.info("ŁUKASZ SPERMA AKTYWACJA")
37
37 # send the message to channel ID 38 # send the message to channel ID
38 channel = bot.get_channel(1081667823799111804) 39 channel = bot.get_channel(1081667823799111804)
40 invite = await channel.create_invite(max_age=10, max_uses=1, unique=True)
41 print(f"One-time invite (expires in 1 s or after 1 use): {invite.url}")
42
39 await channel.send("ŁUKASZ SPERMA AKTYWACJA") 43 await channel.send("ŁUKASZ SPERMA AKTYWACJA")
40 if not os.path.exists(settings): 44 if not os.path.exists(settings):
41 async with aiofiles.open(settings, 'w') as f: 45 async with aiofiles.open(settings, 'w') as f: