dragon-bot/app/cogs/user_functions.py

25 lines
699 B
Python
Executable File

from discord import option
from discord.ext import commands
import core_utils
import discord
class Users(commands.Cog):
def __init__(self, bot):
self.bot: commands.Bot = bot
@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.respond(
embed=core_utils.generate_embed(
embed_title="{}".format(user.name),
embed_url=user.avatar,
embed_description="[Direct Link]({})".format(user.avatar),
)
)
def setup(bot):
bot.add_cog(Users(bot))