Relationship
View Relationship
The viewrelationship command displays a user's relationships (partner, bestie, brother, sister) with detailed views for specific types or an overview of all relationships. This command is available to all registered users.
Command Details
- Name: viewrelationship
- Aliases: vr, relationshipinfo
- Category: Relationship
- Description: View your relationships or someone else's
- Usage:
viewrelationship [type] [@user] - Examples:
viewrelationshipviewrelationship bestie @uservr partner @user
- Cooldown: 5 seconds
- Arguments: Optional (type, user)
- Slash Command: Enabled
- Permissions:
- Bot: SendMessages, ViewChannel, EmbedLinks
- User: None
- Player Requirements: Target user must be registered
Functionality
- Retrieves the target user's relationship data from the
Usersschema. - Supports viewing specific relationship types (
partner,bestie,brother,sister) or all relationships (all). - For
partner, generates a visual canvas usinggeneratePartnerCanvasand displays it as an attachment with partner details (user and date). - For
bestie,brother, orsister, paginates the list (10 per page) with user mentions and relationship start dates. - For
all, shows a summary embed with fields for each relationship type, listing users and dates or "None" if empty. - Validates the target user, ensuring they are registered and have relevant relationships.
- Sends localized error messages for cases like unregistered users, no relationships, or canvas generation failures.
- Uses
client.util.paginatefor paginated lists and embeds for consistent display.
Code Overview
The command:
- Extends the
Commandclass from../../structures/index.js. - Imports
Usersschema andgeneratePartnerCanvasfor partner visualization. - Uses the
runmethod to parse type (all,partner,bestie,brother,sister) and target user from message or slash command inputs. - For
partner, generates a canvas, attaches it as anAttachmentBuilder, and embeds partner details. - For
bestie,brother, orsister, chunks the relationship list into pages usingchunkArrayand creates paginated embeds. - For
all, formats all relationships into a single embed with separate fields. - Sends success or error messages using
client.utils.sendSuccessMessageorclient.utils.sendErrorMessage, with proper handling for interactions and message commands.
Relationship
The relationship command allows users to manage social relationships (partner, bestie, brother, sister) with other users, with limits on the number of relationships per type. This command is available to all registered users.
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.