Sometimes it's simply not enough to ping someone in a server with a message, and we get that. That's why you can private message people! This tutorial will cover how to make a command that will either message the author of the command or message a specified user!
#include <dpp/dpp.h>
int main() {
user = event.command.get_issuing_user().id;
} else {
}
} else {
}
return;
}
} else {
}
});
}
});
bot.global_command_create(command);
}
});
return 0;
}
The cluster class represents a group of shards and a command queue for sending and receiving commands...
Definition cluster.h:89
const dpp::user & get_issuing_user() const
Get the user who issued this command.
std::string get_command_name() const
Get the command name for a command interaction.
snowflake id
Unique ID of object set by Discord. This value contains a timestamp, worker ID, internal server ID,...
Definition managed.h:39
Represents an application command, created by your bot either globally, or on a guild.
Definition appcommand.h:1436
A container for a 64 bit unsigned value representing many things on discord. This value is known in d...
Definition snowflake.h:54
std::function< void(const dpp::log_t &)> DPP_EXPORT cout_logger()
Get a default logger that outputs to std::cout. e.g.
auto run_once()
Run some code within an if() statement only once.
Definition once.h:41
@ co_mentionable
A mentionable (users and roles).
Definition appcommand.h:99
@ m_ephemeral
This message is only visible to the user who invoked the Interaction.
Definition message.h:1970
@ st_wait
Wait forever on a condition variable. The cluster will spawn threads for each shard and start() will ...
Definition cluster.h:72
Each command option is a command line parameter. It can have a type (see dpp::command_option_type),...
Definition appcommand.h:208
The results of a REST call wrapped in a convenient struct.
Definition restresults.h:261
bool is_error() const
Returns true if the call resulted in an error rather than a legitimate value in the confirmation_call...
interaction command
command interaction
Definition dispatcher.h:789
virtual command_value get_parameter(const std::string &name) const
Get a slashcommand parameter.
Represents messages sent and received on Discord.
Definition message.h:2350
Session ready.
Definition dispatcher.h:1072
User has issued a slash command.
Definition dispatcher.h:806