33 lines
1.1 KiB
Python
Raw Normal View History

2020-12-19 20:02:52 -05:00
import logging
from discord.ext import commands
from miyu_bot.commands.common.fuzzy_matching import romanize, FuzzyMatcher
class Utility(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
self.logger = logging.getLogger(__name__)
@commands.command(hidden=True)
2021-01-14 08:41:49 -05:00
@commands.is_owner()
2020-12-19 20:02:52 -05:00
async def romanize(self, ctx: commands.Context, *, arg: str):
await ctx.send(romanize(arg))
@commands.command(hidden=True, ignore_extra=False)
2021-01-14 08:41:49 -05:00
@commands.is_owner()
2020-12-19 20:02:52 -05:00
async def similarity_score(self, ctx: commands.Context, source: str, target: str):
await ctx.send(str(FuzzyMatcher().score(romanize(source), romanize(target))))
2021-01-15 23:19:40 -05:00
@commands.command(name='invite',
aliases=[],
description='Sends the bot invite.',
help='!invite')
async def invite(self, ctx: commands.Context):
await ctx.send('https://discord.com/api/oauth2/authorize?client_id=789314370999287808&permissions=388160&scope=bot')
2020-12-19 20:02:52 -05:00
def setup(bot):
bot.add_cog(Utility(bot))