aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cogs/jarvis.py16
-rw-r--r--main.py4
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
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)
@@ -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
diff --git a/main.py b/main.py
index f1cbff7..73ad94e 100644
--- a/main.py
+++ b/main.py
@@ -40,8 +40,12 @@ settings = "settings.json"
40@bot.event 40@bot.event
41async def on_ready(): 41async 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