65 snowflake channelId{};
90 snowflake targetChannelId{};
91 snowflake channelId{};
96 snowflake channelId{};
143 update_channel_data channelData{};
144 snowflake channelId{};
145 jsonifier::string reason{};
147 modify_channel_data(channel_data newData);
159 friend class discord_core_internal::websocket_client;
160 friend class discord_core_client;
161 friend class channel_data;
162 friend class guild_data;
163 friend class guild_data;
165 static void initialize(discord_core_internal::https_client*, config_manager* configManager);
170 static co_routine<channel_data> getChannelAsync(get_channel_data dataPackage);
175 static channel_cache_data getCachedChannel(get_channel_data dataPackage);
180 static co_routine<channel_data> modifyChannelAsync(modify_channel_data dataPackage);
185 static co_routine<void> deleteOrCloseChannelAsync(delete_or_close_channel_data dataPackage);
190 static co_routine<void> editChannelPermissionOverwritesAsync(edit_channel_permission_overwrites_data dataPackage);
195 static co_routine<jsonifier::vector<invite_data>> getChannelInvitesAsync(get_channel_invites_data dataPackage);
200 static co_routine<invite_data> createChannelInviteAsync(create_channel_invite_data dataPackage);
205 static co_routine<void> deleteChannelPermissionOverwritesAsync(delete_channel_permission_overwrites_data dataPackage);
210 static co_routine<channel_data> followNewsChannelAsync(follow_news_channel_data dataPackage);
215 static co_routine<void> triggerTypingIndicatorAsync(trigger_typing_indicator_data dataPackage);
220 static co_routine<jsonifier::vector<channel_data>> getGuildChannelsAsync(get_guild_channels_data dataPackage);
225 static co_routine<channel_data> createGuildChannelAsync(create_guild_channel_data dataPackage);
230 static co_routine<void> modifyGuildChannelPositionsAsync(modify_guild_channel_positions_data dataPackage);
235 static co_routine<channel_data> createDMChannelAsync(create_dmchannel_data dataPackage);
239 static co_routine<jsonifier::vector<voice_region_data>> getVoiceRegionsAsync();
241 template<
typename channel_type> DCA_INLINE
static void insertChannel(
channel_type&& channel) {
242 if (doWeCacheChannelsBool) {
243 if (channel.id == 0) {
244 throw dca_exception{
"Sorry, but there was no id set for that channel." };
246 cache.emplace(std::forward<channel_type>(channel));
247 if (cache.count() % 1000 == 0) {
248 std::cout <<
"current channel count: " << cache.count() << std::endl;
253 static void removeChannel(
const channel_cache_data& channelId);
255 static bool doWeCacheChannels();
258 static object_cache<channel_cache_data> cache;
259 static discord_core_internal::https_client* httpsClient;
260 static bool doWeCacheChannelsBool;
An interface class for the channel_data related endpoints.
channel_type
Channel_data types.
permission_overwrites_type
Permission_types overwrites types.
invite_target_types
Invite target types.
The main namespace for the forward-facing interfaces.
For creating an invite to a given channel.
bool unique
If true, don't try to reuse a similar invite (useful for creating many unique one time use invites).
int32_t maxUses
Max number of uses or 0 for unlimited.between 0 and 100.
snowflake targetApplicationId
The id of the embedded application to open for this invite, required if target_type is 2.
invite_target_types targetType
the type of target for this voice channel_data invite.
int32_t maxAge
Duration of invite in seconds before expiry, or 0 for never.between 0 and 604800 (7 days) 86400 (24 h...
snowflake channelId
The id of the channel_data to create the invite for.
jsonifier::string reason
Reason for creating the invite.
bool temporary
Whether this invite only grants temporary membership.
snowflake targetUserId
snowflake of the user whose stream to display for this invite, required if target_type is 1.
For collecting a direct-messaging channel_data.
snowflake userId
The user_data for whom to collect the direct-messaging channel_data to.
For creating a new channel_data within a chosen guild_data.
jsonifier::vector< over_write_data > permissionOverwrites
Array of overwrite objects the channel_data's permission overwrites.
int32_t defaultAutoArchiveDuration
Defualt duration of time before archiving a thread.
jsonifier::string reason
Reason for creating the channel_data.
int32_t position
Sorting position of the channel_data.
int32_t rateLimitPerUser
Amount of seconds a user has to wait before sending another message(0 - 21600).
snowflake parentId
snowflake of the parent category for a channel.
jsonifier::string topic
channel_data topic(0 - 1024 characters).
jsonifier::string name
The name of the channel_data.
snowflake guildId
The guild_data within which to create the channel_data.
channel_type type
The type of channel_data.
int32_t bitrate
The bitrate(in bits) of the voice channel_data(voice only).
bool nsfw
whether the channel_data is nsfw.
int32_t userLimit
The user limit of the voice channel_data(voice only).
For deleting the permission_types overwrites of a given channel for a given role or user_data.
jsonifier::string reason
Reason for deleting these permission overwrites.
snowflake roleOrUserId
The role_data or user_data id for whom to delete the permission_types overwrites.
snowflake channelId
The id of the channel_data to modify permissions for.
For deleting or closing a channel.
snowflake channelId
The id of the channel_data to close/delete.
jsonifier::string reason
The reason for deleting/closing the channel_data.
For editing the permission_types overwrites of a given channel, for a given role or user_data.
permissions_parse deny
The permissions to list as "deny".
permissions_parse allow
The permissions to list as "allowed".
snowflake roleOrUserId
The role_data or user_data snowflake to modify the permissions for.
permission_overwrites_type type
The type of overwrite.
jsonifier::string reason
Reason for editing the permission overwrites.
snowflake channelId
The channel_data id of the desired channel_data to modify the permissions for.
For following a news channel_data.
For collecting a channel from discord's servers.
snowflake channelId
The id of the channel_data to acquire.
For collecting the invites to a given channel.
For acquiring a list of channels from a chosen guild_data.
snowflake guildId
The guild_data from which to collect the channels from.
For modifying a channel's properties.
For modifying the channel_data position responseData of a single channel_data.
int32_t position
Sorting position of the channel_data.
bool lockPermissions
Syncs the permission overwrites with the new parent, if moving to a new category.
snowflake parentId
The new parent id for the channel_data that is moved.
For modifying the current positions of one or more channels in the guild_data.
jsonifier::string reason
Reason for re-ordering the channel_data positions.
jsonifier::vector< modify_guild_channel_position_data > modifyChannelData
Array of new channel_data position's responseData.
snowflake guildId
Guild within which to re-order the channel_data positions.
For triggering the typing indicator in a given channel.