D++ (DPP)
C++ Discord API Bot Library
|
Application command permissions allow you to enable or disable commands for specific users or roles within a guild. More...
#include <appcommand.h>
Public Member Functions | |
command_permission ()=default | |
Construct a new command permission object. More... | |
virtual | ~command_permission ()=default |
command_permission (snowflake id, const command_permission_type t, bool permission) | |
Construct a new command permission object. More... | |
command_permission & | fill_from_json (nlohmann::json *j) |
Convert object from nlohmann::json. More... | |
auto | to_json (bool with_id=false) const |
Convert object to nlohmann::json. More... | |
std::string | build_json (bool with_id=false) const |
Convert object to json string. More... | |
Public Attributes | |
snowflake | id |
The ID of the role/user. More... | |
command_permission_type | type |
The type of permission. More... | |
bool | permission |
True to allow, false to disallow. More... | |
Protected Member Functions | |
command_permission & | fill_from_json_impl (nlohmann::json *j) |
Fill object properties from JSON. More... | |
Friends | |
struct | json_interface< command_permission > |
Application command permissions allow you to enable or disable commands for specific users or roles within a guild.
|
default |
Construct a new command permission object.
|
virtualdefault |
dpp::command_permission::command_permission | ( | snowflake | id, |
const command_permission_type | t, | ||
bool | permission | ||
) |
Construct a new command permission object.
id | The ID of the role or user |
t | The permission type |
permission | True to allow, false, to disallow |
|
inlineinherited |
Convert object to json string.
with_id | Whether to include the ID or not |
|
inlineinherited |
Convert object from nlohmann::json.
j | nlohmann::json object |
|
protected |
Fill object properties from JSON.
j | JSON to fill from |
|
inlineinherited |
Convert object to nlohmann::json.
with_id | Whether to include the ID or not |
|
friend |
snowflake dpp::command_permission::id |
The ID of the role/user.
bool dpp::command_permission::permission |
True to allow, false to disallow.
command_permission_type dpp::command_permission::type |
The type of permission.