diff --git a/miyu_bot/commands/cogs/event.py b/miyu_bot/commands/cogs/event.py index 1f2438e..b7b00bd 100644 --- a/miyu_bot/commands/cogs/event.py +++ b/miyu_bot/commands/cogs/event.py @@ -29,7 +29,7 @@ class Event(commands.Cog): aliases=['ev'], description='Finds the event with the given name.', help='!event pkcooking') - async def event(self, ctx: commands.Context, *, arg: str = ""): + async def event(self, ctx: commands.Context, *, arg: commands.clean_content = ""): self.logger.info(f'Searching for event "{arg}".') event: EventMaster diff --git a/miyu_bot/commands/cogs/music.py b/miyu_bot/commands/cogs/music.py index d347572..426abad 100644 --- a/miyu_bot/commands/cogs/music.py +++ b/miyu_bot/commands/cogs/music.py @@ -48,7 +48,7 @@ class Music(commands.Cog): aliases=['music'], description='Finds the song with the given name.', help='!song grgr') - async def song(self, ctx: commands.Context, *, arg: str): + async def song(self, ctx: commands.Context, *, arg: commands.clean_content): self.logger.info(f'Searching for song "{arg}".') song = masters.music.get(arg, ctx) @@ -100,7 +100,7 @@ class Music(commands.Cog): aliases=[], description='Finds the chart with the given name.', help='!chart grgr\n!chart grgr normal') - async def chart(self, ctx: commands.Context, *, arg: str): + async def chart(self, ctx: commands.Context, *, arg: commands.clean_content): self.logger.info(f'Searching for chart "{arg}".') name, difficulty = self.parse_chart_args(arg) @@ -123,7 +123,7 @@ class Music(commands.Cog): aliases=['mixes'], description='Finds the sections of the chart with the given name.', help='!sections grgr') - async def sections(self, ctx: commands.Context, *, arg: str): + async def sections(self, ctx: commands.Context, *, arg: commands.clean_content): self.logger.info(f'Searching for chart sections "{arg}".') name, difficulty = self.parse_chart_args(arg) @@ -151,7 +151,7 @@ class Music(commands.Cog): aliases=['songsearch', 'song_search'], description='Finds songs matching the given name.', help='!songs grgr') - async def songs(self, ctx: commands.Context, *, arg: str = ''): + async def songs(self, ctx: commands.Context, *, arg: commands.clean_content = ''): self.logger.info(f'Searching for songs "{arg}".' if arg else 'Listing songs.') arguments = parse_arguments(arg) songs = masters.music.get_sorted(arguments.text_argument, ctx) @@ -287,7 +287,7 @@ class Music(commands.Cog): return embeds, files - def parse_chart_args(self, arg: str) -> Tuple[str, ChartDifficulty]: + def parse_chart_args(self, arg: commands.clean_content) -> Tuple[str, ChartDifficulty]: split_args = arg.split() difficulty = ChartDifficulty.Expert diff --git a/miyu_bot/commands/cogs/utility.py b/miyu_bot/commands/cogs/utility.py index 39decfa..d2e6a4f 100644 --- a/miyu_bot/commands/cogs/utility.py +++ b/miyu_bot/commands/cogs/utility.py @@ -11,10 +11,12 @@ class Utility(commands.Cog): self.logger = logging.getLogger(__name__) @commands.command(hidden=True) + @commands.is_owner() async def romanize(self, ctx: commands.Context, *, arg: str): await ctx.send(romanize(arg)) @commands.command(hidden=True, ignore_extra=False) + @commands.is_owner() async def similarity_score(self, ctx: commands.Context, source: str, target: str): await ctx.send(str(FuzzyMatcher().score(romanize(source), romanize(target))))