Added chatgpt model

This commit is contained in:
Paillat
2023-03-01 21:30:16 +01:00
parent 701408bebd
commit 434c389e39
4 changed files with 151 additions and 4 deletions

View File

@@ -12,7 +12,14 @@ class Chat (discord.Cog) :
self.bot = bot
@discord.Cog.listener()
async def on_message(self, message: discord.Message):
await mp.process(self, message)
try:
c.execute("SELECT * FROM model WHERE guild_id = ?", (message.guild.id,))
model = c.fetchone()[1]
except: model = "davinci"
if model == "davinci":
await mp.davinci_process(self, message)
if model == "chatGPT":
await mp.chat_process(self, message)
@discord.slash_command(name="say", description="Say a message")
async def say(self, ctx: discord.ApplicationContext, message: str):