LoopbotLoopbot
CommandsMiscellaneous

Command ping

The ping command allows users to check the latency of the bot. This is useful for monitoring the responsiveness of the bot and ensuring that it is functioning properly.

Description

When the ping command is invoked, the bot will respond with the current latency times for the API, the bot itself, and the MySQL database.

Usage

Permissions

  • User: Everyone

Category

  • Category: MISCELLANEOUS

How It Works

  1. When a user invokes the ping command, the bot will initially reply with a message indicating that it is searching.
  2. The bot then records the current time to measure how long the database query takes.
  3. It queries the database to retrieve information related to the server.
  4. After the query is completed, the bot calculates the time taken for the database response.
  5. Finally, the bot constructs an embed message that displays:
    • The API latency
    • The bot's response time
    • The MySQL query time
  6. The bot edits the initial reply to include the embed with the latency information.

This command is particularly useful for server administrators and users who want to ensure that the bot is responsive and functioning correctly.