28 lines
743 B
Python
28 lines
743 B
Python
import nextcord
|
|
from nextcord.ext import commands
|
|
|
|
from events import ai
|
|
|
|
from userinfo import parsedinfo
|
|
|
|
class AICommands(commands.Cog):
|
|
def __init__(self, bot):
|
|
self.client = bot
|
|
|
|
@commands.command(description="Clear your AI history")
|
|
async def clear(self, ctx: nextcord.Message):
|
|
user = await ai.find(ai.SquogData, "id", ctx.author.id)
|
|
|
|
if not user:
|
|
return await ctx.reply("You don't have any AI data.")
|
|
else:
|
|
userIndex = parsedinfo.parsed["guild"].index(user)
|
|
|
|
parsedinfo.parsed["guild"].remove(userIndex)
|
|
|
|
await ai.flush()
|
|
await ctx.reply("Cleared your AI data.")
|
|
return None
|
|
|
|
def setup(bot):
|
|
bot.add_cog(AICommands(bot)) |