Action
Hug
The `hug` command allows users to give warm, friendly hugs to other users with animated GIF responses and social interaction tracking.
Command Details
- Name: hug
- Aliases: None
- Category: Action
- Description: Give another user a warm, friendly hug
- Usage:
P hug @user
,p hug @user
, or/hug @user
- Examples:
P hug @JohnDoe
p hug @friend
/hug @user
- Cooldown: 3 seconds
- Arguments: user (required) - The user you want to hug
- Slash Command: Enabled
- Permissions:
- Bot: SendMessages, ViewChannel, EmbedLinks
- User: None
- Player Requirements: None (no voice, DJ, or active player required)
Functionality
- Warm Social Interactions: Facilitates positive social connections between server members with hug-themed content.
- Animated GIF Collection: Displays random heartwarming animated GIFs from a curated hug collection.
- Emotional Expression: Allows users to express care, comfort, and friendship through virtual hugs.
- Random Animation Selection: Chooses from multiple wholesome GIF responses for engaging variety.
- User Recognition: Properly mentions and acknowledges both the hugger and recipient.
- Positive Atmosphere: Contributes to creating a welcoming and friendly server environment.
- Self-Hug Prevention: Includes appropriate handling for users attempting to hug themselves.
- Social Statistics: May contribute to social interaction tracking and user relationship metrics.
- Embed Presentation: Creates visually appealing embeds with warm descriptions and imagery.
- Community Building: Encourages positive interactions and relationship building among members.
Code Overview
The command is built using a Command
class structure and handles both message-based and interaction-based (slash command) inputs. It uses:
- Target user validation to ensure valid recipients and prevent self-targeting with friendly messages.
client.embed()
creation featuring both users' names in heartwarming hug descriptions.- Random selection from an array of carefully curated hug-themed animated GIFs.
setImage()
integration to display selected animations within response embeds.- Positive messaging framework focusing on warmth, care, and friendly social connections.
- Error handling for invalid mentions, permissions issues, or network connectivity problems.
- Cooldown system balancing spam prevention with natural social interaction patterns.
- User data retrieval and mention parsing for both traditional and slash command formats.
- Embed styling with warm colors, friendly titles, and appropriate footer information.
- Integration with Discord's user management system for reliable recipient identification.
/hug @JohnDoe
Response
The bot will respond with a heartwarming message and an animated GIF showing the hug action.
Permissions
- No special permissions required
- Can be used in any channel where the bot has message permissions