Social
The instagram command allows users to manage their Instagram profile details, including setting a name or link, viewing their own or another user's details, or accessing help information. This command is available to all registered users.
Command Details
- Name: instagram
- Aliases: ig
- Category: Profile
- Description: Manage your Instagram profile
- Usage:
instagraminstagram @mentioninstagram name <YourInstagramName>instagram link <YourInstagramLink>instagram help
- Examples:
instagram- Shows your current Instagram detailsinstagram @mention- Shows the mentioned user's Instagram detailsinstagram name MyIGName- Sets your Instagram nameinstagram link https://instagram.com/MyProfile- Sets your Instagram linkinstagram help- Shows command usage examples
- Cooldown: 5 seconds
- Arguments: Optional (subcommand, name, link, or user mention)
- Slash Command: Enabled
- Permissions:
- Bot: SendMessages, ViewChannel, EmbedLinks
- User: None
- Player Requirements: User must be registered for profile updates or viewing
Functionality
- Supports subcommands:
nameto set an Instagram name,linkto set an Instagram link,helpto display usage examples, and default behavior to view profile details. - For
name, validates the input (max 21 characters) and updates the user'ssocial.instagram.namein theUsersschema. - For
link, validates the input as a valid URL using a regex pattern and updates the user'ssocial.instagram.linkin theUsersschema. - For
help, displays a detailed embed with command usage and examples. - For default (no subcommand), shows the target's Instagram name and link (if set) or a "Not set" message.
- Retrieves user data from the
Usersschema and supports viewing another user's profile via mention. - Sends localized embeds for success, errors, or help, with proper formatting for names and clickable links.
- Validates inputs, ensuring valid names, URLs, and registered users, with appropriate error messages.
Code Overview
The command:
- Extends the
Commandclass from../../structures/index.js. - Imports
Usersschema for profile data management. - Uses the
runmethod to handle both message and slash command inputs, parsing subcommands and arguments. - Supports subcommands (
name,link,help) and default behavior for viewing profiles. - Validates inputs: checks name length (≤21 characters) and URL format using a regex pattern.
- Updates the database with
Users.updateOnefor name and link changes. - Creates embeds with
client.embed()for consistent display, including clickable links and localized messages. - Uses
client.utils.sendErrorMessageandclient.utils.oopsfor error handling, ensuring user-friendly feedback.
The facebook command allows users to manage their Facebook profile details, including setting a name or link, viewing their own or another user's details, or accessing help information. This command is available to all registered users.
Socials
The socials command displays social media profiles for a user, including Facebook, Instagram, and TikTok details, with clickable links if available. This command can show your own or another user's social profiles.