diff --git a/chatter/chat.py b/chatter/chat.py index ef75bb8..d63a664 100644 --- a/chatter/chat.py +++ b/chatter/chat.py @@ -10,7 +10,7 @@ from chatterbot import ChatBot from chatterbot.comparisons import JaccardSimilarity, LevenshteinDistance, SpacySimilarity from chatterbot.response_selection import get_random_response from chatterbot.trainers import ChatterBotCorpusTrainer, ListTrainer, UbuntuCorpusTrainer -from redbot.core import Config, commands +from redbot.core import Config, checks, commands from redbot.core.commands import Cog from redbot.core.data_manager import cog_data_path from redbot.core.utils.predicates import MessagePredicate @@ -191,6 +191,7 @@ class Chatter(Cog): if ctx.invoked_subcommand is None: pass + @checks.admin() @chatter.command(name="channel") async def chatter_channel( self, ctx: commands.Context, channel: Optional[discord.TextChannel] = None @@ -210,6 +211,7 @@ class Chatter(Cog): await self.config.guild(ctx.guild).chatchannel.set(channel.id) await ctx.maybe_send_embed(f"Chat channel is now {channel.mention}") + @checks.is_owner() @chatter.command(name="cleardata") async def chatter_cleardata(self, ctx: commands.Context, confirm: bool = False): """ @@ -242,6 +244,7 @@ class Chatter(Cog): await ctx.tick() + @checks.is_owner() @chatter.command(name="algorithm", aliases=["algo"]) async def chatter_algorithm( self, ctx: commands.Context, algo_number: int, threshold: float = None @@ -275,6 +278,7 @@ class Chatter(Cog): await ctx.tick() + @checks.is_owner() @chatter.command(name="model") async def chatter_model(self, ctx: commands.Context, model_number: int): """ @@ -312,6 +316,7 @@ class Chatter(Cog): f"Model has been switched to {self.tagger_language.ISO_639_1}" ) + @checks.is_owner() @chatter.command(name="minutes") async def minutes(self, ctx: commands.Context, minutes: int): """ @@ -327,6 +332,7 @@ class Chatter(Cog): await ctx.tick() + @checks.is_owner() @chatter.command(name="age") async def age(self, ctx: commands.Context, days: int): """ @@ -341,6 +347,7 @@ class Chatter(Cog): await self.config.guild(ctx.guild).days.set(days) await ctx.tick() + @checks.is_owner() @chatter.command(name="backup") async def backup(self, ctx, backupname): """ @@ -362,6 +369,7 @@ class Chatter(Cog): else: await ctx.maybe_send_embed("Error occurred :(") + @checks.is_owner() @chatter.command(name="trainubuntu") async def chatter_train_ubuntu(self, ctx: commands.Context, confirmation: bool = False): """ @@ -383,6 +391,7 @@ class Chatter(Cog): else: await ctx.send("Error occurred :(") + @checks.is_owner() @chatter.command(name="trainenglish") async def chatter_train_english(self, ctx: commands.Context): """ @@ -396,6 +405,7 @@ class Chatter(Cog): else: await ctx.maybe_send_embed("Error occurred :(") + @checks.is_owner() @chatter.command() async def train(self, ctx: commands.Context, channel: discord.TextChannel): """