diff options
| author | 2019-06-27 21:43:43 +0200 | |
|---|---|---|
| committer | 2019-06-27 22:04:00 +0200 | |
| commit | 2d296ca5482751edabe7a8dc485c3e626c3a1546 (patch) | |
| tree | fc9d1f872e0df5518b1fa32c70efebee6dc8c289 | |
| parent | Adding TalentPool to the watchchannels (diff) | |
Tweaking aliases to use the correct converters
| -rw-r--r-- | bot/cogs/alias.py | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/bot/cogs/alias.py b/bot/cogs/alias.py index 2ce4a51e3..d892c7b87 100644 --- a/bot/cogs/alias.py +++ b/bot/cogs/alias.py @@ -1,11 +1,13 @@ import inspect import logging +from typing import Union -from discord import Colour, Embed, User +from discord import Colour, Embed, Member, User from discord.ext.commands import ( Command, Context, clean_content, command, group ) +from bot.cogs.watchchannels.watchchannel import proxy_user from bot.converters import TagNameConverter from bot.pagination import LinePaginator @@ -71,23 +73,23 @@ class Alias: @command(name="watch", hidden=True) async def bigbrother_watch_alias( - self, ctx, user: User, *, reason: str = None + self, ctx, user: Union[Member, User, proxy_user], *, reason: str = None ): """ - Alias for invoking <prefix>bigbrother watch user [text_channel]. + Alias for invoking <prefix>bigbrother watch [user] [reason]. """ await self.invoke(ctx, "bigbrother watch", user, reason=reason) @command(name="unwatch", hidden=True) - async def bigbrother_unwatch_alias(self, ctx, user: User): + async def bigbrother_unwatch_alias( + self, ctx, user: Union[User, proxy_user], *, reason: str = None + ): """ - Alias for invoking <prefix>bigbrother unwatch user. - - user: discord.User - A user instance to unwatch + Alias for invoking <prefix>bigbrother unwatch [user] [reason]. """ - await self.invoke(ctx, "bigbrother unwatch", user) + await self.invoke(ctx, "bigbrother unwatch", user, reason=reason) @command(name="home", hidden=True) async def site_home_alias(self, ctx): @@ -175,6 +177,26 @@ class Alias: await self.invoke(ctx, "docs get", symbol) + @command(name="nominate", hidden=True) + async def nomination_add_alias( + self, ctx, user: Union[Member, User, proxy_user], *, reason: str = None + ): + """ + Alias for invoking <prefix>talentpool add [user] [reason]. + """ + + await self.invoke(ctx, "talentpool add", user, reason=reason) + + @command(name="unnominate", hidden=True) + async def nomination_end_alias( + self, ctx, user: Union[User, proxy_user], *, reason: str = None + ): + """ + Alias for invoking <prefix>nomination end [user] [reason]. + """ + + await self.invoke(ctx, "nomination end", user, reason=reason) + def setup(bot): bot.add_cog(Alias(bot)) |