diff --git a/README.md b/README.md index 4b90f26..e1175cb 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ so if you did !ignoreme, I will still know that you don't want to be complemente twitch username/user id will still be stored in my database. If you don't want this, then also do !unignore me - this will remove any reference of you from my database - !userid - returns the twitch user's ID from their username; if no name specified, returns ID of caller +- !username - returns the twitch user's name from their ID - !ignoreme - I will stop complementing you - !unignoreme - undo !ignoreme diff --git a/src/complements_bot/bot.py b/src/complements_bot/bot.py index 7d58210..5b307ee 100644 --- a/src/complements_bot/bot.py +++ b/src/complements_bot/bot.py @@ -598,6 +598,22 @@ async def userid(self, ctx: commands.Context) -> None: userid ) + @commands.command() + async def username(self, ctx: commands.Context) -> None: + """ + Get the twitch user's ID from their username + """ + + username: str = str(await self.id_to_name(self.isolate_args(ctx.message.content))) + + await ComplementsBot.cmd_body( + ctx, + self.is_in_bot_channel, + None, + None, + username + ) + @commands.command() async def unignoreme(self, ctx: commands.Context) -> None: """