Skip to content

editreminder

Colton B edited this page Oct 23, 2024 · 3 revisions

The /editreminder command allows users to edit existing snitch or pearl reminders they have previously set. The command presents a form (modal) where the user can edit details such as the reminder's name, schedule, expiration time, and for snitches, coordinates and namelayer.

Command Structure

/editreminder [subcommand] [options]

Subcommands:

  1. pearl

    • Edit a pearl reminder.
    • Required option:
      • name: The name of the pearl reminder to be edited.
  2. snitch

    • Edit a snitch reminder.
    • Required options:
      • name: The name of the snitch reminder to be edited.
      • coordinate: The coordinates of the snitch to help differentiate between multiple snitches with the same name.

Command Behavior:

  1. Input Matching:
    The command retrieves all reminders from the database, decrypts the relevant data, and checks for a match based on the provided input (name and optionally coordinates for snitches).

    • For pearl reminders, it matches the reminder by the user ID and name.
    • For snitch reminders, it matches by the user ID, name, and coordinates.
  2. Edit Modal:
    Once the relevant reminder is found, a modal is presented to the user. This modal contains several fields where users can edit the reminder details. Fields that the user does not want to change can be left blank.

  3. Modal Fields:

    For pearl reminders, the following fields are displayed in the modal:

    • Edit Name (optional): The user can change the name of the pearl reminder.
    • Edit Schedule (optional): The schedule can be modified (e.g., "2 hours" or "1 week").
    • Edit Expiration Time (optional): The expiration timestamp can be updated.

    For snitch reminders, in addition to the above fields, the following are also available:

    • Edit Coordinates (optional): The coordinates of the snitch can be updated.
    • Edit Namelayer (optional): The namelayer associated with the snitch can be modified.

Example Usage:

/editreminder pearl name: MyPearlReminder

The bot will open a modal allowing the user to edit the name, schedule, and expiration time of the pearl reminder called MyPearlReminder.

/editreminder snitch name: MySnitchReminder coordinate: -100, 64, 250

The bot will open a modal allowing the user to edit the name, schedule, expiration time, coordinates, and namelayer of the snitch reminder called MySnitchReminder at coordinates -100, 64, 250.

Command Flow:

  1. The user runs the /editreminder command with the appropriate subcommand (pearl or snitch), providing the required information (name, and coordinates for snitches).
  2. The bot checks the database for matching reminders belonging to the user.
  3. If a matching reminder is found, the bot displays a modal with fields to edit the reminder.
  4. The user fills in the fields they wish to change, and the reminder is updated.

Error Handling:

  • If no matching reminder is found for the provided name (or coordinates in the case of snitches), the bot will not show the modal and may respond with an error message indicating the reminder was not found.
Clone this wiki locally