testing adding a chat client
This commit is contained in:
4
chatGpt/__init__.py
Normal file
4
chatGpt/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from .chatgpt import ChatGpt
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(ChatGpt(bot))
|
||||
25
chatGpt/chatgpt.py
Normal file
25
chatGpt/chatgpt.py
Normal 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
9
chatGpt/info.json
Normal 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"]
|
||||
}
|
||||
Reference in New Issue
Block a user