testing adding a chat client

This commit is contained in:
Juni
2022-12-05 13:27:12 -05:00
parent 90d651551a
commit bc5562ebf5
3 changed files with 38 additions and 0 deletions

4
chatGpt/__init__.py Normal file
View File

@@ -0,0 +1,4 @@
from .chatgpt import ChatGpt
def setup(bot):
bot.add_cog(ChatGpt(bot))

25
chatGpt/chatgpt.py Normal file
View File

@@ -0,0 +1,25 @@
from redbot.core import commands
from redbot.core import Config
import re
import discord
from datetime import datetime
from revChatGPT.revChatGPT import Chatbot
class ChatGpt(commands.Cog):
"""Cog to enable chat powered by OpenAi Chat GPT"""
async def __init__(self, bot):
self.bot = bot
email = await self.bot.get_shared_api_tokens("openai", "email")
password = await self.bot.get_shared_api_tokens("openai", "password")
self.config = {
"email": email,
"password": password,
}
@commands.command()
async def testchat(self, ctx: commands.Context):
"""Test"""
await ctx.send(f"email {self.config.email}, password {self.config.password}")

9
chatGpt/info.json Normal file
View File

@@ -0,0 +1,9 @@
{
"AUTHOR" : "Juni (juniteevee)",
"DESCRIPTION" : "Enable chatting with bot using OpenAi ChatGPT",
"DISABLED" : false,
"SHORT" : "Enable chatting with bot using OpenAi ChatGPT",
"NAME" : "Chat-Gpt",
"INSTALL_CMD" : "ChatGPT. Install at own risk",
"REQUIREMENTS" : ["revChatGPT"]
}