Skip to content

Commit

Permalink
Added /overwrite command for faster data correction
Browse files Browse the repository at this point in the history
  • Loading branch information
Exenifix committed May 21, 2022
1 parent d52d22f commit 7ac4a40
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ext/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from ai.predictor import is_spam
from utils.bot import Bot
from utils.constants import TRAIN_GUILD_IDS
from utils.embeds import SuccessEmbed
from utils.enums import ViewResponse
from utils.views import PhraseProcessingView

Expand Down Expand Up @@ -66,6 +67,20 @@ async def validate(self, inter: disnake.ApplicationCommandInteraction):
)
raise e

@commands.slash_command(
name="overwrite",
description="Overwrites a message for AI model.",
guild_ids=TRAIN_GUILD_IDS,
)
@commands.is_owner()
async def overwrite(
self, inter: disnake.ApplicationCommandInteraction, content: str, spam: bool
):
await self.bot.db.update_sample(content, spam)
await inter.send(
embed=SuccessEmbed(inter, "Successfully overwrote this sample!")
)


def setup(bot: Bot):
bot.auto_setup(__name__)

0 comments on commit 7ac4a40

Please sign in to comment.