Ping Command
This tutorial is available in both written and video form:
Video Tutorial
https://www.youtube.com/watch?v=MQ%5FfkbbXUTE
(ping command starts at 0:54)
Written Tutorial
Step 1 - Create Flow
Create a new flow.
This flow will be triggered by a slash command and will send a message with the bot's ping.
Step 2 - Setup and Sync Command
Enter a name for the command. We'll call it ping. After naming it, click Sync Command to make sure the command is linked to your Discord bot.
Step 3 - Add Discord API Ping Block
Switch to the Add Block page and add a Discord API Ping block. This block will fetch the bot's current ping (latency).
Step 4 - Add Text Reply to Interaction Block
Next, add a Text Reply to Interaction block after the API Ping block. This will be the block that sends the message back to the user when they trigger the command.
Step 5 - Fill in Message Content
In the Message Content field, write:
"The bot's ping is"
This will be the start of your message to the user.
Step 6 - Insert the Bot's Ping
Now, click on Insert Variable in the message content.
Select Discord API Ping and choose Latency. This will insert the bot's ping into the message.
Step 7 - Complete the Message
After the ping variable, type "ms" to indicate the value is in milliseconds.
Step 8 - You're done!
Your flow will now look like this:
Slash Command
- Discord API Ping
- Text Reply to Interaction
Step 9 - Test Your Command
Go into a Discord server with your bot and run the /ping
command. The bot should respond with a message like:
The bot's ping is 94ms
If the command doesn't show up, make sure you synced it from the trigger page.
Now your bot will respond with its ping whenever the /ping
command is used!