Avatar
Fetching a users avatar (profile picture).
Command
/avatar user
What it does
I dont know.
Example output of the /avatar command, showing a user's profile picture.
More information
To show I did not just put this up because I was bored I explained how the code works.
Fetches and displays a user's Discord avatar in an embed.
Behavior:
If a `user` option is provided, it fetches that user's avatar.
If no `user` is provided, it defaults to the command invoker's avatar.
Bot users are ignored (command replies that avatars for bots are not fetched).
Avatar Handling:
Checks if the user's avatar is animated (`a_` prefix in the avatar hash).
Uses `.gif` format for animated avatars, otherwise `.png`.
Fetches the avatar at 1024px resolution for high quality.
Response:
Sends an embed containing:
- The requested user's avatar as an image.
- User's name.
- User who requested the command.
- Timestamp for context.
Error Handling:
If fetching fails, logs the error and replies with an error message.
If an error does occur please report. Thank you (* ^ ω ^)