86 template<
typename value_type>
friend struct jsonifier::core;
95 jsonifier::vector<role_position_data> rolePositions;
140 friend class discord_core_internal::websocket_client;
141 friend class discord_core_client;
143 friend class guild_data;
146 static void initialize(discord_core_internal::https_client*, config_manager* configManagerNew);
151 static co_routine<void> addGuildMemberRoleAsync(add_guild_member_role_data dataPackage);
156 static co_routine<void> removeGuildMemberRoleAsync(remove_guild_member_role_data dataPackage);
161 static co_routine<jsonifier::vector<role_data>> getGuildRolesAsync(get_guild_roles_data dataPackage);
166 static co_routine<role_data> createGuildRoleAsync(create_guild_role_data dataPackage);
171 static co_routine<jsonifier::vector<role_data>> modifyGuildRolePositionsAsync(modify_guild_role_positions_data dataPackage);
176 static co_routine<role_data> modifyGuildRoleAsync(modify_guild_role_data dataPackage);
181 static co_routine<void> removeGuildRoleAsync(remove_guild_role_data dataPackage);
186 static co_routine<jsonifier::vector<role_data>> getGuildMemberRolesAsync(get_guild_member_roles_data dataPackage);
191 static co_routine<role_data> getRoleAsync(get_role_data dataPackage);
196 static role_cache_data getCachedRole(get_role_data dataPackage);
198 template<
typename role_type> DCA_INLINE
static void insertRole(role_type&& role) {
199 if (doWeCacheRolesBool) {
201 throw dca_exception{
"Sorry, but there was no id set for that role." };
203 cache.emplace(
static_cast<role_cache_data
>(std::forward<role_type>(role)));
204 if (cache.count() % 1000 == 0) {
205 std::cout <<
"current role count: " << cache.count() << std::endl;
210 static void removeRole(
const role_cache_data& roleId);
212 static bool doWeCacheRoles();
215 static discord_core_internal::https_client* httpsClient;
216 static object_cache<role_cache_data> cache;
217 static bool doWeCacheRolesBool;
An interface class for the role_data related discord endpoints.
The main namespace for the forward-facing interfaces.
For addin a role_data to a guild_member.
snowflake guildId
The id of the guild within which to assign the role_data.
snowflake userId
The id of the user_data to whom to assign the role_data.
jsonifier::string reason
Reason for adding the guild_member_data's role_data.
snowflake roleId
The id of the role_data to be assigned.
For creating a new role_data within a chosen guild.
bool hoist
Is this role_data hoisted above the rest of them?
uint32_t position
The position amongst the other roles.
jsonifier::string hexColorValue
Hex color-value between 0 and ffffff.
snowflake guildId
Which guild to make the role_data in.
jsonifier::string reason
Reason for creating the role_data.
jsonifier::string name
The name of the role_data.
jsonifier::string unicodeEmoji
The role's unicode emoji as a standard emoji.
permissions_parse permissions
The base permissions to give the role_data.
bool mentionable
Is it mentionable by others in the guild.
jsonifier::string icon
Image data the role's icon image (if the guild has the ROLE_ICONS feature) null.
For getting a chosen guild_member_data's roles.
snowflake guildId
Which guild to collect their roles from.
guild_member_data guildMember
Which guild member to collect the roles from.
For getting a chosen guild's roles.
snowflake guildId
Guild id for which guild to get the roles from.
For getting a role_data from the library's cache, or the discord server.
snowflake roleId
Which role_data to collect.
snowflake guildId
Which guild to collect the role_data from.
For updating a role_data's options within a chosen guild.
jsonifier::string icon
Image data the role's icon image (if the guild has the ROLE_ICONS feature) null.
permissions_parse permissions
Base guild permissions for the role_data.
jsonifier::string name
What the name of the role_data is going to be.
jsonifier::string unicodeEmoji
The role's unicode emoji as a standard emoji.
bool hoist
Is this role_data hoisted above the others?
bool mentionable
Is it mentionable?
jsonifier::string reason
< reason for modifying the role_data.
snowflake roleId
The id of the role_data to update.
jsonifier::string hexColorValue
A hex-color value between 0x00 and 0xFFFFFF.
snowflake guildId
The id of the guild within which to update the role_data.
For updating the role_data positions.
jsonifier::string reason
Reason for modifying the role_data positions.
snowflake guildId
The guild within which to move the role_data.
snowflake roleId
The id of the role_data to move.
uint32_t newPosition
The new position of the role_data.
For removing a role_data from a guild_member.
jsonifier::string reason
Reason for removing the guild_member_data's role_data.
snowflake roleId
The id of the role_data to be removed.
snowflake userId
The id of the user_data from whom to remove the role_data.
snowflake guildId
The id of the guild within which to remove the role_data.
For removing a role_data from a chosen guild.
snowflake guildId
The id of the guild from which to remove the role_data.
jsonifier::string reason
Reason for removing this role_data.
snowflake roleId
The id of the role_data to remove.
For updating the positions of the roles.
uint32_t rolePosition
The new role_data position.
snowflake roleId
The role_data to update.