From 316e6cdb5d258d81443aa37c3dfb947f29b206b9 Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Mon, 17 Oct 2022 17:42:50 -0700 Subject: [PATCH] convert avatar to a slash command and make it show a list of members --- app/cogs/user_functions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/cogs/user_functions.py b/app/cogs/user_functions.py index 14a35339..4b3c1d09 100644 --- a/app/cogs/user_functions.py +++ b/app/cogs/user_functions.py @@ -1,3 +1,4 @@ +from discord import option from discord.ext import commands import core_utils import discord @@ -8,9 +9,10 @@ class Users(commands.Cog): def __init__(self, bot): self.bot: commands.Bot = bot - @commands.command(name="avatar") + @commands.slash_command(guild_ids=None, name="avatar") + @option("User", description="Choose a member", input_type="user") async def avatar(self, ctx: commands.Context, user: discord.Member): - await ctx.reply( + await ctx.respond( embed=core_utils.generate_embed( embed_title="{}#{}".format(user.name, user.discriminator), embed_url=user.avatar,