Action
Bite
The `bite` command allows users to playfully bite another user with animated GIF responses and interactive social features.
Command Details
- Name: bite
- Aliases: None
- Category: Action
- Description: Playfully bite another user in the server
- Usage:
P bite @user
,p bite @user
, or/bite @user
- Examples:
P bite @JohnDoe
p bite @user
/bite @friend
- Cooldown: 3 seconds
- Arguments: user (required) - The user you want to bite
- Slash Command: Enabled
- Permissions:
- Bot: SendMessages, ViewChannel, EmbedLinks
- User: None
- Player Requirements: None (no voice, DJ, or active player required)
Functionality
- Interactive Social Action: Creates engaging social interactions between users with bite-themed content.
- Animated GIF Responses: Displays random animated GIFs from a curated collection of bite animations.
- User Mention Integration: Properly mentions both the action performer and target user.
- Random Response Selection: Chooses from multiple GIF responses for variety and engagement.
- Embed Formatting: Creates visually appealing embeds with action descriptions and user information.
- Self-Action Prevention: Prevents users from performing the action on themselves with appropriate messaging.
- Error Handling: Provides helpful feedback for invalid targets or missing parameters.
- Social Tracking: May track social interaction statistics for user profiles and achievements.
- Cooldown Protection: Prevents spam while allowing natural conversation flow.
- Cross-Platform Support: Works consistently across different Discord clients and devices.
Code Overview
The command is built using a Command
class structure and handles both message-based and interaction-based (slash command) inputs. It uses:
- User validation to ensure a valid target user is provided and prevent self-targeting.
client.embed()
creation with dynamic descriptions including both users' display names.- Random GIF selection from a predefined array of bite-themed animated images.
setImage()
method to display the selected animated GIF in the response embed.- Error handling for invalid user mentions, missing permissions, or API failures.
- Cooldown management to prevent command spam while maintaining social interaction flow.
- User mention parsing and validation for both message and slash command contexts.
- Embed customization with appropriate colors, titles, and footer information.
- Integration with Discord's user caching system for reliable user data retrieval.
- Support for both traditional prefix commands and modern Discord slash command interactions.
/bite @JohnDoe
Response
The bot will respond with a fun message and possibly an animated GIF showing the bite action.
Permissions
- No special permissions required
- Can be used in any channel where the bot has message permissions