dragon-bot/app/cogs/user_functions.py
Luke R 3c463dd37f
All checks were successful
Build and push / changes (push) Successful in 4s
Build and push / Lint-Python (push) Successful in 2s
Build and push / Build-and-Push-Docker (push) Successful in 1m4s
Build and push / post-status-to-discord (push) Successful in 2s
Build and push / sync-argocd-app (push) Successful in 3s
Change /avatar to use display_avatar
2025-04-08 21:36:04 -07:00

25 lines
717 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: discord.ApplicationContext, user: discord.Member):
await ctx.respond(
embed=core_utils.generate_embed(
embed_title="{}".format(user.name),
embed_url=user.display_avatar,
embed_description="[Direct Link]({})".format(user.avatar),
)
)
def setup(bot):
bot.add_cog(Users(bot))