mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
🎨 chore(*): run black to format the code
This commit is contained in:
@@ -3,24 +3,22 @@ from random import randint
|
||||
|
||||
|
||||
class SQLConnection:
|
||||
|
||||
def __init__(self,connection):
|
||||
def __init__(self, connection):
|
||||
self.connection = connection
|
||||
|
||||
def __enter__(self):
|
||||
return self.connection
|
||||
|
||||
def __exit__(self,exc_type,exc_val,exc_tb):
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
self.connection.commit()
|
||||
self.connection.close()
|
||||
|
||||
|
||||
class _sql:
|
||||
|
||||
@property
|
||||
def mainDb(self):
|
||||
s = connect('./database/data.db')
|
||||
s = connect("./database/data.db")
|
||||
return SQLConnection(s)
|
||||
|
||||
|
||||
sql: _sql = _sql()
|
||||
sql: _sql = _sql()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from discord import AutocompleteContext
|
||||
|
||||
|
||||
class models:
|
||||
matchingDict = {
|
||||
"chatGPT (default - free)": "gpt-3.5-turbo",
|
||||
@@ -10,11 +11,13 @@ class models:
|
||||
reverseMatchingDict = {v: k for k, v in matchingDict.items()}
|
||||
default = list(matchingDict.keys())[0]
|
||||
openaimodels = ["gpt-3.5-turbo", "text-davinci-003"]
|
||||
|
||||
@classmethod
|
||||
async def autocomplete(cls, ctx: AutocompleteContext) -> list[str]:
|
||||
modls = cls.matchingDict.keys()
|
||||
return [model for model in modls if model.find(ctx.value.lower()) != -1]
|
||||
|
||||
|
||||
class characters:
|
||||
matchingDict = {
|
||||
"Botator (default - free)": "botator",
|
||||
@@ -22,16 +25,21 @@ class characters:
|
||||
}
|
||||
reverseMatchingDict = {v: k for k, v in matchingDict.items()}
|
||||
default = list(matchingDict.keys())[0]
|
||||
|
||||
@classmethod
|
||||
async def autocomplete(cls, ctx: AutocompleteContext) -> list[str]:
|
||||
chars = characters = cls.matchingDict.keys()
|
||||
return [character for character in chars if character.find(ctx.value.lower()) != -1]
|
||||
return [
|
||||
character for character in chars if character.find(ctx.value.lower()) != -1
|
||||
]
|
||||
|
||||
|
||||
class apis:
|
||||
matchingDict = {
|
||||
"OpenAI": "openai",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
async def autocomplete(cls, ctx: AutocompleteContext) -> list[str]:
|
||||
apiss = cls.matchingDict.keys()
|
||||
return [api for api in apiss if api.find(ctx.value.lower()) != -1]
|
||||
return [api for api in apiss if api.find(ctx.value.lower()) != -1]
|
||||
|
||||
Reference in New Issue
Block a user