Skip to content

Commit

Permalink
Add a thinking state for the bot for the play slash command
Browse files Browse the repository at this point in the history
  • Loading branch information
Evilur committed Sep 21, 2024
1 parent 9a86ff8 commit fa8e6a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/command/play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
#include "util/logger.h"

void Play::Exec(const dpp::slashcommand_t &event) {
/* Set the bot to thinking state */
event.thinking();

/* Get query from the command parameter */
std::string query = std::get<std::string>(event.get_parameter("query"));

/* Send the message to the channel */
try { event.reply(Exec(event.command.guild_id, event.command.usr.id, query, event.command.channel_id)); }
catch (BragiException &exception) { event.reply(exception.Message()); }
try { event.edit_original_response(Exec(event.command.guild_id, event.command.usr.id, query, event.command.channel_id)); }
catch (BragiException &exception) { event.edit_original_response(exception.Message()); }
}

void Play::Exec(const dpp::message_create_t &event, const std::string &argument) {
Expand Down

0 comments on commit fa8e6a2

Please sign in to comment.