Add Avatar context menu
This commit is contained in:
parent
cf7e54f67b
commit
b683e28075
1 changed files with 15 additions and 8 deletions
|
@ -126,14 +126,6 @@ class UtilCog(Extension):
|
|||
else:
|
||||
await ctx.send(to_send, ephemeral=True)
|
||||
|
||||
@slash_command(name="avatar", description="Get a user avatar")
|
||||
@slash_option(
|
||||
name="user",
|
||||
description="User to view avatar of",
|
||||
opt_type=OptionTypes.USER,
|
||||
required=False,
|
||||
)
|
||||
@cooldown(bucket=Buckets.USER, rate=1, interval=5)
|
||||
async def _avatar(self, ctx: InteractionContext, user: User = None) -> None:
|
||||
if not user:
|
||||
user = ctx.author
|
||||
|
@ -198,6 +190,21 @@ class UtilCog(Extension):
|
|||
)
|
||||
await ctx.send(embeds=embed, file=color_show, components=components)
|
||||
|
||||
@slash_command(name="avatar", description="Get a user avatar")
|
||||
@slash_option(
|
||||
name="user",
|
||||
description="User to view avatar of",
|
||||
opt_type=OptionTypes.USER,
|
||||
required=False,
|
||||
)
|
||||
@cooldown(bucket=Buckets.USER, rate=1, interval=5)
|
||||
async def _avatar_slash(self, ctx: InteractionContext, user: User = None) -> None:
|
||||
await self._userinfo(ctx, user)
|
||||
|
||||
@context_menu(name="Avatar", context_type=CommandTypes.USER)
|
||||
async def _avatar_menu(self, ctx: InteractionContext) -> None:
|
||||
await self._avatar(ctx, ctx.target)
|
||||
|
||||
async def _userinfo(self, ctx: InteractionContext, user: User = None) -> None:
|
||||
await ctx.defer()
|
||||
if not user:
|
||||
|
|
Loading…
Add table
Reference in a new issue