mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
added default admin perms
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import discord
|
import discord
|
||||||
from config import debug, conn, c
|
from config import debug, conn, c
|
||||||
|
from discord import default_permissions
|
||||||
|
|
||||||
models = ["davinci", "chatGPT"]
|
models = ["davinci", "chatGPT"]
|
||||||
|
|
||||||
class Settings (discord.Cog) :
|
class Settings (discord.Cog) :
|
||||||
@@ -185,6 +187,7 @@ class Settings (discord.Cog) :
|
|||||||
return [model for model in models if model.startswith(ctx.value)]
|
return [model for model in models if model.startswith(ctx.value)]
|
||||||
@discord.slash_command(name="model", description="Change the model used by the bot")
|
@discord.slash_command(name="model", description="Change the model used by the bot")
|
||||||
@discord.option(name="model", description="The model you want to use. Leave blank to use the davinci model", required=False, autocomplete=autocomplete)
|
@discord.option(name="model", description="The model you want to use. Leave blank to use the davinci model", required=False, autocomplete=autocomplete)
|
||||||
|
@default_permissions(administrator=True)
|
||||||
async def model(self, ctx: discord.ApplicationContext, model: str = "davinci"):
|
async def model(self, ctx: discord.ApplicationContext, model: str = "davinci"):
|
||||||
try:
|
try:
|
||||||
c.execute("SELECT * FROM model WHERE guild_id = ?", (ctx.guild.id,))
|
c.execute("SELECT * FROM model WHERE guild_id = ?", (ctx.guild.id,))
|
||||||
|
|||||||
Reference in New Issue
Block a user