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:
instagram
instagram @mention
instagram 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:
name
to set an Instagram name,link
to set an Instagram link,help
to display usage examples, and default behavior to view profile details. - For
name
, validates the input (max 21 characters) and updates the user'ssocial.instagram.name
in theUsers
schema. - For
link
, validates the input as a valid URL using a regex pattern and updates the user'ssocial.instagram.link
in theUsers
schema. - 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
Users
schema 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
Command
class from../../structures/index.js
. - Imports
Users
schema for profile data management. - Uses the
run
method 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.updateOne
for name and link changes. - Creates embeds with
client.embed()
for consistent display, including clickable links and localized messages. - Uses
client.utils.sendErrorMessage
andclient.utils.oops
for 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.