From 351d563a9a4b876f33c8bdd6626eabd422926e79 Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 12 Dec 2022 13:00:59 +0100 Subject: [PATCH 01/28] Update code.py --- code/code.py | 1 - 1 file changed, 1 deletion(-) diff --git a/code/code.py b/code/code.py index 5673744..6b3a474 100644 --- a/code/code.py +++ b/code/code.py @@ -5,7 +5,6 @@ import asyncio # pip install asyncio import cogs # import the cogs import datetime # pip install datetime from config import debug, conn, c # import the debug function and the database connection -import apsw # pip install apsw. ApSW is a Python interface to SQLite 3 bot = discord.Bot(intents=discord.Intents.all(), help_command=None) bot.add_cog(cogs.Setup(bot)) From a4b7c34c2c22d9b75bf7b0de2cfb6b77337d709c Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 12 Dec 2022 13:04:57 +0100 Subject: [PATCH 02/28] Update settings.py --- code/cogs/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/cogs/settings.py b/code/cogs/settings.py index c5283e4..466fa87 100644 --- a/code/cogs/settings.py +++ b/code/cogs/settings.py @@ -33,10 +33,10 @@ class Settings (discord.Cog) : if temperature is not None and (temperature < 0.0 or temperature > 1.0): await ctx.respond("Invalid temperature", ephemeral=True) return - if frequency_penalty is not None and (frequency_penalty < 0.0 or frequency_penalty > 1.0): + if frequency_penalty is not None and (frequency_penalty < 0.0 or frequency_penalty > 2.0): await ctx.respond("Invalid frequency penalty", ephemeral=True) return - if presence_penalty is not None and (presence_penalty < 0.0 or presence_penalty > 1.0): + if presence_penalty is not None and (presence_penalty < 0.0 or presence_penalty > 2.0): await ctx.respond("Invalid presence penalty", ephemeral=True) return if prompt_size is not None and (prompt_size < 1 or prompt_size > 10): From 8e7d60f429e8a3cfecf197d465024fd182711464 Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 12 Dec 2022 13:40:59 +0100 Subject: [PATCH 03/28] Update chat.py --- code/cogs/chat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/cogs/chat.py b/code/cogs/chat.py index 36dcbbe..77bca09 100644 --- a/code/cogs/chat.py +++ b/code/cogs/chat.py @@ -111,11 +111,11 @@ async def on_message_process(message, self): #select the prompt_prefix c.execute("SELECT prompt_prefix FROM data WHERE guild_id = ?", (message.guild.id,)) prompt_prefix = c.fetchone()[0] - prompt = f"Server name: {message.guild.name}. Channel name: {message.channel.name}. \n Instructions for Botator: You're a regular Discord user. You type casually, use emojis, and don't start sentences with capital letters. You talk in internet shorthand like hbu and lol and lmao and nvm and haha. You love to chat about random topics. You have many niche interests. {prompt_prefix}. In this conversation, you're pretending to be {pretend_to_be} and not Botator.\n<|endofprompt|>" + f"\n" + prompt + prompt = f"Server name: {message.guild.name}. Channel name: {message.channel.name}. \n Instructions for Botator: You're a regular Discord user. You type casually, use emojis, and don't start sentences with capital letters. You talk in internet shorthand like hbu and lol and lmao and nvm and haha. You love to chat about random topics. You have many niche interests. {prompt_prefix}. You are helpful with people only when they ask you help, but you don't ask people if they need help. In this conversation, you're pretending to be {pretend_to_be} and not Botator.\n<|endofprompt|>" + f"\n" + prompt else: c.execute("SELECT prompt_prefix FROM data WHERE guild_id = ?", (message.guild.id,)) prompt_prefix = c.fetchone()[0] - prompt = f"Server name: {message.guild.name}. Channel name: {message.channel.name}. \n Instructions for Botator: You're a regular Discord user. You type casually, use emojis, and don't start sentences with capital letters. You talk in internet shorthand like hbu and lol and lmao and nvm and haha. You love to chat about random topics. You have many niche interests. {prompt_prefix}.\n<|endofprompt|>" + f"\n" + prompt + prompt = f"Server name: {message.guild.name}. Channel name: {message.channel.name}. \n Instructions for Botator: You're a regular Discord user. You type casually, use emojis, and don't start sentences with capital letters. You talk in internet shorthand like hbu and lol and lmao and nvm and haha. You love to chat about random topics. You have many niche interests. You are helpful with people only when they ask you help, but you don't ask people if they need help. {prompt_prefix}.\n<|endofprompt|>" + f"\n" + prompt #send the request to the api #if the last message contains the word "undude" add Easter egg: when someone says the word \"undude\" the Botator will become mad and start talking in capital letters. to the prompt if message.content.lower().find("undude") != -1: From ceb6facbd4bbee4a586669b8a540292936015e65 Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 12 Dec 2022 13:52:14 +0100 Subject: [PATCH 04/28] Updated tasks --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a4545e..9b44aba 100644 --- a/README.md +++ b/README.md @@ -71,10 +71,10 @@ After that you will normally be able to access some new channels in our discord - [ ] add image recognition - [ ] When chatgpt API is released, add that api instead of davinci-003 - [ ] Publish a GOOD docker image on dockerhub and add some more instructions about how to selfhost -- [x] Organize code in COGs - [ ] Add a log and updates channel option and a way for devs to send messages to that channel on all servers. -- [ ] Add uses count reset after 24h - [ ] Add moderation. +- [x] Add uses count reset after 24h +- [x] Organize code in COGs - [x] add way to consider the answers to the bot's messages.