DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
Utilities.hpp File Reference
#include <discordcoreapi/Utilities/Base.hpp>
#include <discordcoreapi/Utilities/UnorderedSet.hpp>
#include <discordcoreapi/Utilities/UnorderedMap.hpp>
#include <discordcoreapi/Utilities/ObjectCache.hpp>
#include <discordcoreapi/Utilities/UnboundedMessageBlock.hpp>
#include <discordcoreapi/Utilities/Etf.hpp>
#include <coroutine>
Include dependency graph for Utilities.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes and Structures

struct  discord_core_api::activity_data
 Activity data. More...
 
struct  discord_core_api::audio_frame_data
 Represents a single frame of audio data. More...
 
struct  discord_core_api::cache_options
 For selecting the caching style of the library. More...
 
struct  discord_core_api::discord_core_client_config
 Configuration data for the library's main class, discord_core_client. More...
 
struct  discord_core_api::logging_options
 Loggin options for the library. More...
 
class  discord_core_api::permissions_base< value_type >
 Permissions_base class, for representing and manipulating permission values. More...
 
struct  discord_core_api::repeated_function_data
 Function data for repeated functions to be loaded. More...
 
struct  discord_core_api::sharding_options
 Sharding options for the library. More...
 
struct  discord_core_api::stream_info
 For connecting two bots to stream the vc contents between the two. More...
 
struct  discord_core_api::update_presence_data
 For updating a user's presence. More...
 
struct  discord_core_api::voice_connect_init_data
 For connecting to a voice-channel. "streamInfo" is used when a SOCKET is created to connect this bot to another bot, for transmitting audio back and forth. More...
 

Namespaces

namespace  discord_core_api
 The main namespace for the forward-facing interfaces.
 
namespace  discord_core_api::colors
 Color constants for use in the embed_data color values.
 

Enumerations

enum class  discord_core_api::activity_type : uint8_t {
  discord_core_api::activity_type::game = 0 , discord_core_api::activity_type::streaming = 1 , discord_core_api::activity_type::listening = 2 , discord_core_api::activity_type::watching = 3 ,
  discord_core_api::activity_type::custom = 4 , discord_core_api::activity_type::competing = 5
}
 Activity types. More...
 
enum class  discord_core_api::audio_frame_type : uint8_t { discord_core_api::audio_frame_type::Unset = 0 , discord_core_api::audio_frame_type::raw_pcm = 1 , discord_core_api::audio_frame_type::encoded = 2 }
 Audio frame types. More...
 
enum class  discord_core_api::gateway_intents : uint32_t {
  discord_core_api::gateway_intents::guilds = 1 << 0 , discord_core_api::gateway_intents::Guild_Members = 1 << 1 , discord_core_api::gateway_intents::Guild_Bans = 1 << 2 , discord_core_api::gateway_intents::Guild_Emojis = 1 << 3 ,
  discord_core_api::gateway_intents::Guild_Integrations = 1 << 4 , discord_core_api::gateway_intents::Guild_Webhooks = 1 << 5 , discord_core_api::gateway_intents::Guild_Invites = 1 << 6 , discord_core_api::gateway_intents::Guild_VoiceStates = 1 << 7 ,
  discord_core_api::gateway_intents::Guild_Presences = 1 << 8 , discord_core_api::gateway_intents::Guild_Messages = 1 << 9 , discord_core_api::gateway_intents::Guild_Message_Reactions = 1 << 10 , discord_core_api::gateway_intents::Guild_Message_Typing = 1 << 11 ,
  discord_core_api::gateway_intents::Direct_Messages = 1 << 12 , discord_core_api::gateway_intents::Direct_Message_Reactions = 1 << 13 , discord_core_api::gateway_intents::Direct_Message_Typing = 1 << 14 , discord_core_api::gateway_intents::Message_Content = 1 << 15 ,
  discord_core_api::gateway_intents::Guild_Scheduled_Events = 1 << 16 , Auto_Moderation_Configuration = 1 << 20 , discord_core_api::gateway_intents::Auto_Moderation_Execution = 1 << 21 , discord_core_api::gateway_intents::Default_Intents ,
  discord_core_api::gateway_intents::Privileged_Intents = Guild_Members | Guild_Presences | Message_Content , discord_core_api::gateway_intents::All_Intents = Default_Intents | Privileged_Intents
}
 Gateway intents. More...
 
enum class  discord_core_api::input_event_response_type : uint8_t {
  discord_core_api::input_event_response_type::Unset = 0 , Deferred_Response = 1 , discord_core_api::input_event_response_type::Ephemeral_Deferred_Response = 2 , discord_core_api::input_event_response_type::Interaction_Response = 3 ,
  discord_core_api::input_event_response_type::Ephemeral_Interaction_Response = 4 , discord_core_api::input_event_response_type::Edit_Interaction_Response = 5 , discord_core_api::input_event_response_type::Follow_Up_Message = 6 , discord_core_api::input_event_response_type::Ephemeral_Follow_Up_Message = 7 ,
  discord_core_api::input_event_response_type::Edit_Follow_Up_Message = 8 , discord_core_api::input_event_response_type::Application_Command_AutoComplete_Result = 9 , discord_core_api::input_event_response_type::Modal_Interaction_Response = 10
}
 Input event response types. More...
 
enum class  discord_core_api::permission : uint64_t {
  discord_core_api::permission::Create_Instant_Invite = 0x0000000000000001 , discord_core_api::permission::Kick_Members = 0x0000000000000002 , discord_core_api::permission::Ban_Members = 0x0000000000000004 , discord_core_api::permission::administrator = 0x0000000000000008 ,
  discord_core_api::permission::Manage_Channels = 0x0000000000000010 , discord_core_api::permission::Manage_Guild = 0x0000000000000020 , discord_core_api::permission::Add_Reactions = 0x0000000000000040 , discord_core_api::permission::View_Audit_Log = 0x0000000000000080 ,
  discord_core_api::permission::Priority_Speaker = 0x0000000000000100 , discord_core_api::permission::stream = 0x0000000000000200 , discord_core_api::permission::View_Channel = 0x0000000000000400 , discord_core_api::permission::Send_Messages = 0x0000000000000800 ,
  discord_core_api::permission::Send_TTS_Messages = 0x0000000000001000 , discord_core_api::permission::Manage_Messages = 0x0000000000002000 , discord_core_api::permission::Embed_Links = 0x0000000000004000 , discord_core_api::permission::Attach_Files = 0x0000000000008000 ,
  discord_core_api::permission::Read_Message_History = 0x0000000000010000 , discord_core_api::permission::Mention_Everyone = 0x0000000000020000 , discord_core_api::permission::Use_External_Emojis = 0x0000000000040000 , discord_core_api::permission::View_Guild_Insights = 0x0000000000080000 ,
  discord_core_api::permission::connect = 0x0000000000100000 , discord_core_api::permission::speak = 0x0000000000200000 , discord_core_api::permission::Mute_Members = 0x0000000000400000 , discord_core_api::permission::Deafen_Members = 0x0000000000800000 ,
  discord_core_api::permission::Move_Members = 0x0000000001000000 , discord_core_api::permission::Use_VAD = 0x0000000002000000 , discord_core_api::permission::Change_Nickname = 0x0000000004000000 , discord_core_api::permission::Manage_Nicknames = 0x0000000008000000 ,
  discord_core_api::permission::Manage_Roles = 0x0000000010000000 , discord_core_api::permission::Manage_Webhooks = 0x0000000020000000 , discord_core_api::permission::Manage_Guild_Expressions = 0x0000000040000000 , discord_core_api::permission::Use_Application_Commands = 0x0000000080000000 ,
  discord_core_api::permission::Request_to_Speak = 0x0000000100000000 , discord_core_api::permission::Manage_Events = 0x0000000200000000 , discord_core_api::permission::Manage_Threads = 0x0000000400000000 , discord_core_api::permission::Create_Public_Threads = 0x0000000800000000 ,
  discord_core_api::permission::Create_Private_Threads = 0x0000001000000000 , discord_core_api::permission::Use_External_Stickers = 0x0000002000000000 , discord_core_api::permission::Send_Messages_in_Threads = 0x0000004000000000 , discord_core_api::permission::Use_Embedded_Activities = 0x0000008000000000 ,
  discord_core_api::permission::Moderate_Members = 0x0000010000000000 , discord_core_api::permission::View_Creator_Monetization_Analytics = 0x0000020000000000 , discord_core_api::permission::Use_Soundboard = 0x0000040000000000 , discord_core_api::permission::Use_External_Sounds = 0x0000200000000000 ,
  discord_core_api::permission::Send_Voice_Messages = 0x0000400000000000
}
 Permission values, for a given channel, by role_data or guild_member_data. More...
 
enum class  discord_core_api::text_format : uint8_t { discord_core_api::text_format::etf = 0x00 , discord_core_api::text_format::json = 0x01 }
 Represents which text format to use for websocket transfer. More...
 

Functions

DiscordCoreAPI_Dll jsonifier::string discord_core_api::getTimeAndDate ()
 Acquires a timeStamp with the current time and date - suitable for use in message-embeds.
 
template<typename return_type , bool timeOut = true>
DCA_INLINE auto discord_core_api::newThreadAwaitable ()
 An awaitable that can be used to launch the co_routine onto a new thread - as well as return the handle for stoppping its execution.
 

Variables

static constexpr jsonifier::string_view discord_core_api::colors::aquamarine { "7FFFD4" }
 Aquamarine.
 
static constexpr jsonifier::string_view discord_core_api::colors::bismark { "546E7A" }
 Bismark.
 
static constexpr jsonifier::string_view discord_core_api::colors::black { "000000" }
 Black.
 
static constexpr jsonifier::string_view discord_core_api::colors::blue { "0000FF" }
 Blue.
 
static constexpr jsonifier::string_view discord_core_api::colors::blue_aquamarine { "607D8B" }
 Blue aquamarine.
 
static constexpr jsonifier::string_view discord_core_api::colors::blue_green { "088F8F" }
 Blue green.
 
static constexpr jsonifier::string_view discord_core_api::colors::brown { "992D22" }
 Brown.
 
static constexpr jsonifier::string_view discord_core_api::colors::cadmium_green { "097969" }
 cadmium green.
 
static constexpr jsonifier::string_view discord_core_api::colors::cinnabar { "e74_c3_c" }
 cinnabar.
 
static constexpr jsonifier::string_view discord_core_api::colors::cyan { "00FFFF" }
 cyan.
 
static constexpr jsonifier::string_view discord_core_api::colors::dark_goldenrod { "c27_c0_e" }
 Dark goldenrod.
 
static constexpr jsonifier::string_view discord_core_api::colors::dark_gray { "404040" }
 Dark gray.
 
static constexpr jsonifier::string_view discord_core_api::colors::deep_lilac { "9B59B6" }
 Deep lilac.
 
static constexpr jsonifier::string_view discord_core_api::colors::deep_sea { "11806A" }
 Deep sea.
 
static constexpr jsonifier::string_view discord_core_api::colors::discord_black { "000001" }
 Discord black.
 
static constexpr jsonifier::string_view discord_core_api::colors::discord_white { "fffffe" }
 Discord white.
 
static constexpr jsonifier::string_view discord_core_api::colors::endeavour { "206694" }
 Endeavor.
 
static constexpr jsonifier::string_view discord_core_api::colors::forest_green { "228B22" }
 Forest green.
 
static constexpr jsonifier::string_view discord_core_api::colors::gray { "808080" }
 Gray.
 
static constexpr jsonifier::string_view discord_core_api::colors::gray_chateau { "979C9F" }
 Gray chateau.
 
static constexpr jsonifier::string_view discord_core_api::colors::green { "00FF00" }
 Green.
 
static constexpr jsonifier::string_view discord_core_api::colors::jazzberry_jam { "ad1457" }
 Jazzberry jam.
 
static constexpr jsonifier::string_view discord_core_api::colors::light_gray { "c0_c0_c0" }
 Light gray.
 
static constexpr jsonifier::string_view discord_core_api::colors::light_sea_green { "1ABC9C" }
 Light sea green.
 
static constexpr jsonifier::string_view discord_core_api::colors::lime { "00FF00" }
 Lime.
 
static constexpr jsonifier::string_view discord_core_api::colors::magenta { "ff00_ff" }
 Magenta.
 
static constexpr jsonifier::string_view discord_core_api::colors::medium_sea_green { "2ECC71" }
 Medium sea green.
 
static constexpr jsonifier::string_view discord_core_api::colors::moon_yellow { "f1_c40_f" }
 Moon yellow.
 
static constexpr jsonifier::string_view discord_core_api::colors::orange { "ffc800" }
 Orange.
 
static constexpr jsonifier::string_view discord_core_api::colors::pink { "ffafaf" }
 Pink.
 
static constexpr jsonifier::string_view discord_core_api::colors::ralli_art_crimson { "e60012" }
 Ralliart crimson.
 
static constexpr jsonifier::string_view discord_core_api::colors::raspberry { "e30_b5_c" }
 Raspberry.
 
static constexpr jsonifier::string_view discord_core_api::colors::red { "ff0000" }
 Red.
 
static constexpr jsonifier::string_view discord_core_api::colors::ruby { "e91_e63" }
 Ruby.
 
static constexpr jsonifier::string_view discord_core_api::colors::rust { "a84300" }
 Rust.
 
static constexpr jsonifier::string_view discord_core_api::colors::scarlet_red { "ff2400" }
 Scarlet red.
 
static constexpr jsonifier::string_view discord_core_api::colors::sea_green { "1F8B4C" }
 Sea green.
 
static constexpr jsonifier::string_view discord_core_api::colors::sti_blue { "0E4BEF" }
 Sti blue.
 
static constexpr jsonifier::string_view discord_core_api::colors::submarine { "95A5A6" }
 Submarine.
 
static constexpr jsonifier::string_view discord_core_api::colors::summer_sky { "3498DB" }
 Summer skye.
 
static constexpr jsonifier::string_view discord_core_api::colors::tahiti_gold { "e67_e22" }
 Tahiti gold.
 
static constexpr jsonifier::string_view discord_core_api::colors::vivid_violet { "71368A" }
 Vivid violet.
 
static constexpr jsonifier::string_view discord_core_api::colors::white { "ffffff" }
 White.
 
static constexpr jsonifier::string_view discord_core_api::colors::wrx_blue { "00247D" }
 Wrx blue.
 
static constexpr jsonifier::string_view discord_core_api::colors::yellow { "ffff00" }
 Yellow.