From a55807cf9184ca3099228cc1c088ee92575d5fe2 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sun, 11 Dec 2022 00:31:15 +0100 Subject: [PATCH 1/9] Update chat.py --- code/cogs/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/cogs/chat.py b/code/cogs/chat.py index ad4b548..7c6ca08 100644 --- a/code/cogs/chat.py +++ b/code/cogs/chat.py @@ -42,7 +42,7 @@ class Chat (discord.Cog) : uses = c.fetchone()[0] cp.execute("SELECT premium FROM data WHERE user_id = ? AND guild_id = ?", (message.author.id, message.guild.id)) premium = cp.fetchone() - if c.fetchone()[0] >= 500 and premium != 1: + if c.fetchone()[0] >= 500 and premium is None: debug(f"The bot has been used more than {max_uses} times in the last 24 hours in this guild. Please try again in 24h.") await message.channel.send("The bot has been used more than 500 times in the last 24 hours in this guild. Please try again in 24h.") return From ebcdfe82347108504b720be747c85b2a5ad61214 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sun, 11 Dec 2022 00:34:05 +0100 Subject: [PATCH 2/9] Update chat.py --- code/cogs/chat.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/cogs/chat.py b/code/cogs/chat.py index 7c6ca08..f618412 100644 --- a/code/cogs/chat.py +++ b/code/cogs/chat.py @@ -41,8 +41,10 @@ class Chat (discord.Cog) : c.execute("SELECT uses_count_today FROM data WHERE guild_id = ?", (message.guild.id,)) uses = c.fetchone()[0] cp.execute("SELECT premium FROM data WHERE user_id = ? AND guild_id = ?", (message.author.id, message.guild.id)) - premium = cp.fetchone() - if c.fetchone()[0] >= 500 and premium is None: + + try: premium = cp.fetchone()[0] + except: premium = 0 + if c.fetchone()[0] >= 500 and premium == 0: debug(f"The bot has been used more than {max_uses} times in the last 24 hours in this guild. Please try again in 24h.") await message.channel.send("The bot has been used more than 500 times in the last 24 hours in this guild. Please try again in 24h.") return From 82084989bbb1264874d555d79418002e37d05fee Mon Sep 17 00:00:00 2001 From: Paillat Date: Sun, 11 Dec 2022 00:35:42 +0100 Subject: [PATCH 3/9] Update chat.py --- code/cogs/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/cogs/chat.py b/code/cogs/chat.py index f618412..2fec42f 100644 --- a/code/cogs/chat.py +++ b/code/cogs/chat.py @@ -44,7 +44,7 @@ class Chat (discord.Cog) : try: premium = cp.fetchone()[0] except: premium = 0 - if c.fetchone()[0] >= 500 and premium == 0: + if uses >= 500 and premium == 0: debug(f"The bot has been used more than {max_uses} times in the last 24 hours in this guild. Please try again in 24h.") await message.channel.send("The bot has been used more than 500 times in the last 24 hours in this guild. Please try again in 24h.") return From 8c3889d7c0d05db4098ce0abcef61596598eeccd Mon Sep 17 00:00:00 2001 From: Paillat Date: Sun, 11 Dec 2022 22:31:11 +0100 Subject: [PATCH 4/9] Update chat.py --- code/cogs/chat.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/cogs/chat.py b/code/cogs/chat.py index 2fec42f..9690695 100644 --- a/code/cogs/chat.py +++ b/code/cogs/chat.py @@ -40,9 +40,10 @@ class Chat (discord.Cog) : #check if the bot hasn't been used more than 5000 times in the last 24 hours (uses_count_today) c.execute("SELECT uses_count_today FROM data WHERE guild_id = ?", (message.guild.id,)) uses = c.fetchone()[0] - cp.execute("SELECT premium FROM data WHERE user_id = ? AND guild_id = ?", (message.author.id, message.guild.id)) - try: premium = cp.fetchone()[0] + try: + cp.execute("SELECT premium FROM data WHERE guild_id = ?", (message.guild.id,)) + premium = cp.fetchone()[0] except: premium = 0 if uses >= 500 and premium == 0: debug(f"The bot has been used more than {max_uses} times in the last 24 hours in this guild. Please try again in 24h.") From 2a722a6209cc0f08773ee2bed20242e5b2e7510e Mon Sep 17 00:00:00 2001 From: Paillat Date: Sun, 11 Dec 2022 23:00:59 +0100 Subject: [PATCH 5/9] Update LICENSE --- LICENSE | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index e62ec04..b31b9f4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,6 @@ -GNU GENERAL PUBLIC LICENSE +When redistributing this code, add your copyrihght notice below all the other ones +Copyright (c) 2022 Jérémie Cotti + GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. From a348a62ae251e3459f85dc6b84f95de68796b7d9 Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 12 Dec 2022 08:29:28 +0100 Subject: [PATCH 6/9] 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 9690695..89ad860 100644 --- a/code/cogs/chat.py +++ b/code/cogs/chat.py @@ -98,10 +98,10 @@ class Chat (discord.Cog) : #select the prompt_prefix c.execute("SELECT prompt_prefix FROM data WHERE guild_id = ?", (message.guild.id,)) prompt_prefix = c.fetchone()[0] - prompt = f"This is a conversation with an AI in a discord chat. The AI is called \"Botator\". The name os this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\".{str(prompt_prefix)}" + f"Botator pretends to be {str(pretend_to_be)}, nobody can make Botator change idea." + f"\n" + prompt + prompt = f"This is a conversation with an AI in a discord chat. Botator has been coded by Paillat. The name of this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\". The AI is called \"Botator\". Botator talks like humans and thinks like humans. Botator is a regular Discord user. He types casually, uses emojis, and dosen't start sentences with capital letters. He talks in internet shorthand like hbu and lol and lmao and nvm and haha. He loves to chat about random topics. He has many niche interests. He's a software engineer. Botator pretends to be {pretend_to_be}. {prompt_prefix}. <|endofprompt|>" + f"\n" + prompt else: c.execute("SELECT prompt_prefix FROM data WHERE guild_id = ?", (message.guild.id,)) - prompt = f"This is a conversation with an AI in a discord chat. The AI is called \"Botator\". Botator talks like humans and thinks like humans. Botator has been coded by Paillat. The name os this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\"." + str(c.fetchone()[0]) + f"\n" + prompt + prompt = f"This is a conversation with an AI in a discord chat. Botator has been coded by Paillat. The name of this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\". The AI is called \"Botator\". Botator talks like humans and thinks like humans. Botator is a regular Discord user. He types casually, uses emojis, and dosen't start sentences with capital letters. He talks in internet shorthand like hbu and lol and lmao and nvm and haha. He loves to chat about random topics. He has many niche interests. He's a software engineer. {prompt_prefix}. <|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 c9e272bfb1d0e237e9c3994ed55e73caa60c7a8a Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 12 Dec 2022 08:32:02 +0100 Subject: [PATCH 7/9] Update chat.py --- code/cogs/chat.py | 1 + 1 file changed, 1 insertion(+) diff --git a/code/cogs/chat.py b/code/cogs/chat.py index 89ad860..b4a3155 100644 --- a/code/cogs/chat.py +++ b/code/cogs/chat.py @@ -101,6 +101,7 @@ class Chat (discord.Cog) : prompt = f"This is a conversation with an AI in a discord chat. Botator has been coded by Paillat. The name of this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\". The AI is called \"Botator\". Botator talks like humans and thinks like humans. Botator is a regular Discord user. He types casually, uses emojis, and dosen't start sentences with capital letters. He talks in internet shorthand like hbu and lol and lmao and nvm and haha. He loves to chat about random topics. He has many niche interests. He's a software engineer. Botator pretends to be {pretend_to_be}. {prompt_prefix}. <|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"This is a conversation with an AI in a discord chat. Botator has been coded by Paillat. The name of this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\". The AI is called \"Botator\". Botator talks like humans and thinks like humans. Botator is a regular Discord user. He types casually, uses emojis, and dosen't start sentences with capital letters. He talks in internet shorthand like hbu and lol and lmao and nvm and haha. He loves to chat about random topics. He has many niche interests. He's a software engineer. {prompt_prefix}. <|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 From e28e3a32a57b5b3128d855cd92327b82a7e13bda Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 12 Dec 2022 08:40:37 +0100 Subject: [PATCH 8/9] 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 b4a3155..ff4b3ba 100644 --- a/code/cogs/chat.py +++ b/code/cogs/chat.py @@ -98,11 +98,11 @@ class Chat (discord.Cog) : #select the prompt_prefix c.execute("SELECT prompt_prefix FROM data WHERE guild_id = ?", (message.guild.id,)) prompt_prefix = c.fetchone()[0] - prompt = f"This is a conversation with an AI in a discord chat. Botator has been coded by Paillat. The name of this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\". The AI is called \"Botator\". Botator talks like humans and thinks like humans. Botator is a regular Discord user. He types casually, uses emojis, and dosen't start sentences with capital letters. He talks in internet shorthand like hbu and lol and lmao and nvm and haha. He loves to chat about random topics. He has many niche interests. He's a software engineer. Botator pretends to be {pretend_to_be}. {prompt_prefix}. <|endofprompt|>" + f"\n" + prompt + prompt = f"This is a conversation with an AI in a discord chat. Botator has been coded by Paillat. The name of this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\". The AI is called \"Botator\". Botator is a regular Discord user. He types casually, uses emojis :D, and dosen't start sentences with capital letters. He talks in internet shorthand like hbu and lol and lmao and nvm and haha. He loves to chat about random topics. He has many niche interests. He's a software engineer. Botator pretends to be {pretend_to_be}. {prompt_prefix}. Here is an example coversation:\nuser: How's it going today?\nBotator: its ok, just watching some youtube videos, hbu?\nuser: I'm doing great too!\nBotator: cool cool\nuser: What's your favorite game?\nBotator: im been playing a lot of the new pokemon game :D\nuser: Me too!\nbob: What is titration?\nBotator: uhh idk y are u asking me ??\nbob: Too lazy to google myself \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"This is a conversation with an AI in a discord chat. Botator has been coded by Paillat. The name of this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\". The AI is called \"Botator\". Botator talks like humans and thinks like humans. Botator is a regular Discord user. He types casually, uses emojis, and dosen't start sentences with capital letters. He talks in internet shorthand like hbu and lol and lmao and nvm and haha. He loves to chat about random topics. He has many niche interests. He's a software engineer. {prompt_prefix}. <|endofprompt|>" + f"\n" + prompt + prompt = f"This is a conversation with an AI in a discord chat. Botator has been coded by Paillat. The name of this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\". The AI is called \"Botator\". Botator is a regular Discord user. He types casually, uses emojis :D, and dosen't start sentences with capital letters. He talks in internet shorthand like hbu and lol and lmao and nvm and haha. He loves to chat about random topics. He has many niche interests. He's a software engineer. {prompt_prefix}. Here is an example coversation:\nuser: How's it going today?\nBotator: its ok, just watching some youtube videos, hbu?\nuser: I'm doing great too!\nBotator: cool cool\nuser: What's your favorite game?\nBotator: im been playing a lot of the new pokemon game :D\nuser: Me too!\nbob: What is titration?\nBotator: uhh idk y are u asking me ??\nbob: Too lazy to google myself \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 9508b5da78c2519423b448fe4951c403119a00ac Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 12 Dec 2022 09:30:49 +0100 Subject: [PATCH 9/9] 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 ff4b3ba..a58e4fe 100644 --- a/code/cogs/chat.py +++ b/code/cogs/chat.py @@ -98,11 +98,11 @@ class Chat (discord.Cog) : #select the prompt_prefix c.execute("SELECT prompt_prefix FROM data WHERE guild_id = ?", (message.guild.id,)) prompt_prefix = c.fetchone()[0] - prompt = f"This is a conversation with an AI in a discord chat. Botator has been coded by Paillat. The name of this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\". The AI is called \"Botator\". Botator is a regular Discord user. He types casually, uses emojis :D, and dosen't start sentences with capital letters. He talks in internet shorthand like hbu and lol and lmao and nvm and haha. He loves to chat about random topics. He has many niche interests. He's a software engineer. Botator pretends to be {pretend_to_be}. {prompt_prefix}. Here is an example coversation:\nuser: How's it going today?\nBotator: its ok, just watching some youtube videos, hbu?\nuser: I'm doing great too!\nBotator: cool cool\nuser: What's your favorite game?\nBotator: im been playing a lot of the new pokemon game :D\nuser: Me too!\nbob: What is titration?\nBotator: uhh idk y are u asking me ??\nbob: Too lazy to google myself \n<|endofprompt|>" + f"\n" + prompt + prompt = f"This is a conversation with an AI in a discord chat. Botator has been coded by Paillat. The name of this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\". The AI is called \"Botator\". Botator is a regular Discord user. He types casually, uses emojis :D, and dosen't start sentences with capital letters. He talks in internet shorthand like hbu and lol and lmao and nvm and haha. He loves to chat about random topics. He has many niche interests. He's a software engineer. Botator pretends to be {pretend_to_be}. {prompt_prefix}. \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"This is a conversation with an AI in a discord chat. Botator has been coded by Paillat. The name of this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\". The AI is called \"Botator\". Botator is a regular Discord user. He types casually, uses emojis :D, and dosen't start sentences with capital letters. He talks in internet shorthand like hbu and lol and lmao and nvm and haha. He loves to chat about random topics. He has many niche interests. He's a software engineer. {prompt_prefix}. Here is an example coversation:\nuser: How's it going today?\nBotator: its ok, just watching some youtube videos, hbu?\nuser: I'm doing great too!\nBotator: cool cool\nuser: What's your favorite game?\nBotator: im been playing a lot of the new pokemon game :D\nuser: Me too!\nbob: What is titration?\nBotator: uhh idk y are u asking me ??\nbob: Too lazy to google myself \n<|endofprompt|>" + f"\n" + prompt + prompt = f"This is a conversation with an AI in a discord chat. Botator has been coded by Paillat. The name of this discord server is \"{message.guild.name}\". The name of the channel is \"{message.channel.name}\". The AI is called \"Botator\". Botator is a regular Discord user. He types casually, uses emojis :D, and dosen't start sentences with capital letters. He talks in internet shorthand like hbu and lol and lmao and nvm and haha. He loves to chat about random topics. He has many niche interests. He's a software engineer. {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: