convert avatar to a slash command and make it show a list of members
This commit is contained in:
parent
ea8207c955
commit
c04c9312d2
@ -1,3 +1,4 @@
|
|||||||
|
from discord import option
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import core_utils
|
import core_utils
|
||||||
import discord
|
import discord
|
||||||
@ -8,9 +9,10 @@ class Users(commands.Cog):
|
|||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot: commands.Bot = 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):
|
async def avatar(self, ctx: commands.Context, user: discord.Member):
|
||||||
await ctx.reply(
|
await ctx.respond(
|
||||||
embed=core_utils.generate_embed(
|
embed=core_utils.generate_embed(
|
||||||
embed_title="{}#{}".format(user.name, user.discriminator),
|
embed_title="{}#{}".format(user.name, user.discriminator),
|
||||||
embed_url=user.avatar,
|
embed_url=user.avatar,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user