diff options
| author | salmonik <raisersoft@proton.me> | 2026-03-18 15:30:56 +0100 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-03-18 15:30:56 +0100 |
| commit | e4fb5510ace76456a49db049f69283f1b9e22876 (patch) | |
| tree | d331cd928a8da7c94da31f8453812f0a33da3be1 | |
| parent | voice doesn't work due to DAVE, but we got copyparty search (diff) | |
| parent | minor fixes (diff) | |
| download | senator-sperma-e4fb5510ace76456a49db049f69283f1b9e22876.tar.gz senator-sperma-e4fb5510ace76456a49db049f69283f1b9e22876.zip | |
Merge branch 'main' of https://codeberg.org/salmonik/senator-sperma
Diffstat (limited to '')
| -rw-r--r-- | cogs/jarvis.py | 16 | ||||
| -rw-r--r-- | main.py | 4 |
2 files changed, 13 insertions, 7 deletions
diff --git a/cogs/jarvis.py b/cogs/jarvis.py index 5417c5e..4f34ea8 100644 --- a/cogs/jarvis.py +++ b/cogs/jarvis.py | |||
| @@ -12,6 +12,7 @@ import logging | |||
| 12 | import shutil | 12 | import shutil |
| 13 | from dotenv import load_dotenv | 13 | from dotenv import load_dotenv |
| 14 | import os | 14 | import os |
| 15 | from tempfile import NamedTemporaryFile | ||
| 15 | from cogs.downloader import Downloader | 16 | from cogs.downloader import Downloader |
| 16 | 17 | ||
| 17 | logger = logging.getLogger(__name__) | 18 | logger = 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) |
| @@ -60,13 +61,14 @@ class Jarvis(commands.Cog): | |||
| 60 | "content": "You are an alter ego of Senator Sperma Armstrong.\n" | 61 | "content": "You are an alter ego of Senator Sperma Armstrong.\n" |
| 61 | "your task is to tell the program what to do and how to respond after receiving a message.\n" | 62 | "your task is to tell the program what to do and how to respond after receiving a message.\n" |
| 62 | "message field has to be filled out in polish.\n" | 63 | "message field has to be filled out in polish.\n" |
| 63 | "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" |
| 64 | "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." |
| 65 | }] | 66 | }] |
| 66 | 67 | ||
| 67 | messages.append({ | 68 | messages.append({ |
| 68 | "role": "user", | 69 | "role": "user", |
| 69 | "content": f"[from {message.author.display_name}]: {message.content}" | 70 | "content": f"{message.author.display_name}: {message.content}" |
| 71 | |||
| 70 | }) | 72 | }) |
| 71 | 73 | ||
| 72 | if Jarvis._is_reply(message): | 74 | if Jarvis._is_reply(message): |
| @@ -84,11 +86,11 @@ class Jarvis(commands.Cog): | |||
| 84 | return [ | 86 | return [ |
| 85 | { | 87 | { |
| 86 | "role": "user", | 88 | "role": "user", |
| 87 | "content": f"[original message from {original_msg.author.display_name}]: {original_msg.content}" | 89 | "content": f"{original_msg.author.display_name}: {original_msg.content}" |
| 88 | }, | 90 | }, |
| 89 | { | 91 | { |
| 90 | "role": "user", | 92 | "role": "user", |
| 91 | "content": f"[reply from {message.author.display_name}]: {message.content}" | 93 | "content": f"{message.author.display_name}: {message.content}" |
| 92 | } | 94 | } |
| 93 | ] | 95 | ] |
| 94 | 96 | ||
| @@ -40,8 +40,12 @@ settings = "settings.json" | |||
| 40 | @bot.event | 40 | @bot.event |
| 41 | async def on_ready(): | 41 | async def on_ready(): |
| 42 | logger.info("ŁUKASZ SPERMA AKTYWACJA") | 42 | logger.info("ŁUKASZ SPERMA AKTYWACJA") |
| 43 | |||
| 43 | # send the message to channel ID | 44 | # send the message to channel ID |
| 44 | channel = bot.get_channel(1081667823799111804) | 45 | channel = bot.get_channel(1081667823799111804) |
| 46 | invite = await channel.create_invite(max_age=10, max_uses=1, unique=True) | ||
| 47 | print(f"One-time invite (expires in 1 s or after 1 use): {invite.url}") | ||
| 48 | |||
| 45 | await channel.send("ŁUKASZ SPERMA AKTYWACJA") | 49 | await channel.send("ŁUKASZ SPERMA AKTYWACJA") |
| 46 | 50 | ||
| 47 | # Create settings.json if it doesn't exist | 51 | # Create settings.json if it doesn't exist |
