Skip to main content

SleepyDiscord::BaseDiscordClient

Inherits from SleepyDiscord::GenericMessageReceiver

Inherited by SleepyDiscord::UWebSocketsDiscordClient, SleepyDiscord::WebsocketppDiscordClient

inherited members

Public Functions inherited from SleepyDiscord::GenericMessageReceiver

Name
virtual~GenericMessageReceiver() =default

Protected Functions inherited from SleepyDiscord::GenericMessageReceiver

Name
const time_tgetRetryDelay()

Public Attributes inherited from SleepyDiscord::GenericMessageReceiver

Name
WebsocketConnectionconnection

Protected Attributes inherited from SleepyDiscord::GenericMessageReceiver

Name
intconsecutiveReconnectsCount
TimerreconnectTimer

Public Types Documentation

enum GetMessagesKey

EnumeratorValueDescription
na
around
before
after
limit

enum AssignmentType

EnumeratorValueDescription
TilDueTime0
EpochTime1

using RequestCallback

using SleepyDiscord::BaseDiscordClient::RequestCallback =  std::function<void(Response)>;

typedef PostableTask

typedef TimedTask SleepyDiscord::BaseDiscordClient::PostableTask;

Public Functions Documentation

function BaseDiscordClient

BaseDiscordClient() =default

function BaseDiscordClient

inline BaseDiscordClient(
const std::string _token
)

function ~BaseDiscordClient

~BaseDiscordClient()

function request

Response request(
const RequestMethod method,
Route path,
const std::string jsonParameters ="",
const std::vector< Part > & multipartParameters ={},
RequestCallback callback =nullptr,
const RequestMode mode =Sync_AsyncQueue
)

function requestAsync

template <class ParmType >
inline void requestAsync(
const RequestMethod method,
Route path,
std::function< void(ParmType)> callback,
const std::string jsonParameters ="",
const std::vector< Part > & multipartParameters ={},
const RequestMode mode =Async
)

function requestSync

template <class ParmType >
inline Response requestSync(
const RequestMethod method,
Route path,
std::function< void(ParmType)> callback,
const std::string jsonParameters ="",
const std::vector< Part > & multipartParameters ={},
const RequestMode mode =Sync
)

function path

const Route path(
const char * source,
std::initializer_list< std::string > values ={}
)

function request

template <class RequestSettingsClass >
inline Response request(
const RequestMethod method,
Route path,
RequestSettingsClass & settings,
const std::string jsonParameters ="",
const std::initializer_list< Part > & multipartParameters ={}
)

function request

template <RequestMode mode,
class ParmType =void,
class Callback =RequestCallback>
inline RequestModeType< mode >::ReturnType request(
const RequestMethod method,
Route path,
Callback callback,
const std::string jsonParameters ="",
const std::initializer_list< Part > & multipartParameters ={}
)

function testFunction

void testFunction(
std::string teststring
)

function getGateway

ObjectResponse< Gateway > getGateway(
RequestSettings< ObjectResponse< Gateway >> settings ={}
)

function getChannel

ObjectResponse< Channel > getChannel(
Snowflake< Channel > channelID,
RequestSettings< ObjectResponse< Channel >> settings ={}
)

function editChannel

ObjectResponse< Channel > editChannel(
Snowflake< Channel > channelID,
std::string name ="",
std::string topic ="",
RequestSettings< ObjectResponse< Channel >> settings ={}
)

function editChannelName

ObjectResponse< Channel > editChannelName(
Snowflake< Channel > channelID,
std::string name,
RequestSettings< ObjectResponse< Channel >> settings ={}
)

function editChannelTopic

ObjectResponse< Channel > editChannelTopic(
Snowflake< Channel > channelID,
std::string topic,
RequestSettings< ObjectResponse< Channel >> settings ={}
)

function deleteChannel

ObjectResponse< Channel > deleteChannel(
Snowflake< Channel > channelID,
RequestSettings< ObjectResponse< Channel >> settings ={}
)

function getMessages

ArrayResponse< Message > getMessages(
Snowflake< Channel > channelID,
GetMessagesKey when,
Snowflake< Message > messageID,
uint8_t limit =0,
RequestSettings< ArrayResponse< Message >> settings ={}
)

function getMessage

ObjectResponse< Message > getMessage(
Snowflake< Channel > channelID,
Snowflake< Message > messageID,
RequestSettings< ObjectResponse< Message >> settings ={}
)

function createInvalidEmbed

inline const Embed createInvalidEmbed()

function sendMessage

ObjectResponse< Message > sendMessage(
Snowflake< Channel > channelID,
std::string message,
Embed embed =Embed::Flag::INVALID_EMBED,
MessageReference replyingTo ={},
TTS tts =TTS::Default,
RequestSettings< ObjectResponse< Message >> settings ={}
)

function sendMessage

ObjectResponse< Message > sendMessage(
SendMessageParams params,
RequestSettings< ObjectResponse< Message >> settings ={}
)

function uploadFile

ObjectResponse< Message > uploadFile(
Snowflake< Channel > channelID,
std::string fileLocation,
std::string message,
Embed embed =Embed::Flag::INVALID_EMBED,
MessageReference replyingTo ={},
RequestSettings< ObjectResponse< Message >> settings ={}
)

function uploadFile

ObjectResponse< Message > uploadFile(
SendMessageParams params,
std::string fileLocation,
RequestSettings< ObjectResponse< Message >> settings ={}
)

function addReaction

BoolResponse addReaction(
Snowflake< Channel > channelID,
Snowflake< Message > messageID,
std::string emoji,
RequestSettings< BoolResponse > settings ={}
)

function removeReaction

BoolResponse removeReaction(
Snowflake< Channel > channelID,
Snowflake< Message > messageID,
std::string emoji,
Snowflake< User > userID ="@me"
)

function getReactions

ArrayResponse< User > getReactions(
Snowflake< Channel > channelID,
Snowflake< Message > messageID,
std::string emoji,
RequestSettings< ArrayResponse< Reaction >> settings ={}
)

function removeAllReactions

StandardResponse removeAllReactions(
Snowflake< Channel > channelID,
Snowflake< Message > messageID,
RequestSettings< StandardResponse > settings ={}
)

function editMessage

ObjectResponse< Message > editMessage(
Snowflake< Channel > channelID,
Snowflake< Message > messageID,
std::string newMessage,
Embed embed =Embed::Flag::INVALID_EMBED,
RequestSettings< ObjectResponse< Message >> settings ={}
)

function editMessage

ObjectResponse< Message > editMessage(
EditMessageParams params,
RequestSettings< ObjectResponse< Message >> settings ={}
)

function deleteMessage

BoolResponse deleteMessage(
Snowflake< Channel > channelID,
Snowflake< Message > messageID,
RequestSettings< BoolResponse > settings ={}
)

function bulkDeleteMessages

BoolResponse bulkDeleteMessages(
Snowflake< Channel > channelID,
std::vector< Snowflake< Message >> messageIDs,
RequestSettings< BoolResponse > settings ={}
)

function editChannelPermissions

BoolResponse editChannelPermissions(
Snowflake< Channel > channelID,
Snowflake< Overwrite > overwriteID,
int allow,
int deny,
std::string type
)

function getChannelInvites

ArrayResponse< Invite > getChannelInvites(
Snowflake< Channel > channelID,
RequestSettings< ArrayResponse< Invite >> settings ={}
)

function createChannelInvite

ObjectResponse< Invite > createChannelInvite(
Snowflake< Channel > channelID,
const uint64_t maxAge =0,
const uint64_t maxUses =0,
const bool temporary =false,
const bool unique =false
)

function removeChannelPermission

BoolResponse removeChannelPermission(
Snowflake< Channel > channelID,
std::string ID,
RequestSettings< BoolResponse > settings ={}
)

function sendTyping

BoolResponse sendTyping(
Snowflake< Channel > channelID,
RequestSettings< BoolResponse > settings ={}
)

function getPinnedMessages

ArrayResponse< Message > getPinnedMessages(
Snowflake< Channel > channelID,
RequestSettings< ArrayResponse< Message >> settings ={}
)

function pinMessage

BoolResponse pinMessage(
Snowflake< Channel > channelID,
Snowflake< Message > messageID,
RequestSettings< BoolResponse > settings ={}
)

function unpinMessage

BoolResponse unpinMessage(
Snowflake< Channel > channelID,
Snowflake< Message > messageID,
RequestSettings< BoolResponse > settings ={}
)

function addRecipient

StandardResponse addRecipient(
Snowflake< Channel > channelID,
Snowflake< User > userID,
RequestSettings< StandardResponse > settings ={}
)

function removeRecipient

StandardResponse removeRecipient(
Snowflake< Channel > channelID,
Snowflake< User > userID,
RequestSettings< StandardResponse > settings ={}
)

function deleteReaction

inline BoolResponse deleteReaction(
Snowflake< Channel > channelID,
Snowflake< Message > messageID,
std::string emoji
)

function deleteAllReactions

inline StandardResponse deleteAllReactions(
Snowflake< Channel > channelID,
Snowflake< Message > messageID
)

function deleteChannelPermission

inline BoolResponse deleteChannelPermission(
Snowflake< Channel > channelID,
std::string ID
)

function deleteRecipient

inline StandardResponse deleteRecipient(
Snowflake< Channel > channelID,
Snowflake< User > _userID
)

function editMessage

inline ObjectResponse< Message > editMessage(
Message message,
std::string newMessage,
Embed embed =Embed::Flag::INVALID_EMBED
)

function sendMessage

inline ObjectResponse< Message > sendMessage(
Snowflake< Channel > channelID,
std::string message,
RequestSettings< ObjectResponse< Message >> settings
)

function getServer

ObjectResponse< Server > getServer(
Snowflake< Server > serverID,
RequestSettings< ObjectResponse< Server >> settings ={}
)

function deleteServer

ObjectResponse< Server > deleteServer(
Snowflake< Server > serverID,
RequestSettings< ObjectResponse< Server >> settings ={}
)

function getServerChannels

ArrayResponse< Channel > getServerChannels(
Snowflake< Server > serverID,
RequestSettings< ArrayResponse< Channel >> settings ={}
)

function createTextChannel

ObjectResponse< Channel > createTextChannel(
Snowflake< Server > serverID,
std::string name,
RequestSettings< ObjectResponse< Channel >> settings ={}
)

function createChannel

ObjectResponse< Channel > createChannel(
Snowflake< Server > serverID,
std::string name,
Channel::ChannelType Type,
RequestSettings< ObjectResponse< Channel >> settings ={}
)

function editChannelPositions

ArrayResponse< Channel > editChannelPositions(
Snowflake< Server > serverID,
std::vector< std::pair< std::string, uint64_t >> positions,
RequestSettings< ArrayResponse< Channel >> settings ={}
)

function getMember

ObjectResponse< ServerMember > getMember(
Snowflake< Server > serverID,
Snowflake< User > userID,
RequestSettings< ObjectResponse< ServerMember >> settings ={}
)

function listMembers

ArrayResponse< ServerMember > listMembers(
Snowflake< Server > serverID,
uint16_t limit =0,
std::string after ="",
RequestSettings< ArrayResponse< ServerMember >> settings ={}
)

function addMember

ObjectResponse< ServerMember > addMember(
Snowflake< Server > serverID,
Snowflake< User > userID,
std::string accesToken,
std::string nick ="",
std::vector< Role > roles ={},
bool mute =false,
bool deaf =false
)

function editMember

BoolResponse editMember(
Snowflake< Server > serverID,
Snowflake< User > userID,
std::string nickname ="",
std::vector< Snowflake< Role >> roles ={},
int8_t mute =-1,
int8_t deaf =-1,
Snowflake< Channel > channelID ={}
)

function muteServerMember

BoolResponse muteServerMember(
Snowflake< Server > serverID,
Snowflake< User > userID,
bool mute =true,
RequestSettings< BoolResponse > settings ={}
)

function editNickname

BoolResponse editNickname(
Snowflake< Server > serverID,
std::string newNickname,
RequestSettings< BoolResponse > settings ={}
)

function addRole

BoolResponse addRole(
Snowflake< Server > serverID,
Snowflake< User > userID,
Snowflake< Role > roleID,
RequestSettings< BoolResponse > settings ={}
)

function removeRole

BoolResponse removeRole(
Snowflake< Server > serverID,
Snowflake< User > userID,
Snowflake< Role > roleID,
RequestSettings< BoolResponse > settings ={}
)

function kickMember

BoolResponse kickMember(
Snowflake< Server > serverID,
Snowflake< User > userID,
RequestSettings< BoolResponse > settings ={}
)

function getBans

ArrayResponse< User > getBans(
Snowflake< Server > serverID,
RequestSettings< ArrayResponse< User >> settings ={}
)

function banMember

BoolResponse banMember(
Snowflake< Server > serverID,
Snowflake< User > userID,
int deleteMessageDays =-1,
std::string reason ="",
RequestSettings< BoolResponse > settings ={}
)

function unbanMember

BoolResponse unbanMember(
Snowflake< Server > serverID,
Snowflake< User > userID,
RequestSettings< BoolResponse > settings ={}
)

function getRoles

ArrayResponse< Role > getRoles(
Snowflake< Server > serverID,
RequestSettings< ArrayResponse< Role >> settings ={}
)

function createRole

ObjectResponse< Role > createRole(
Snowflake< Server > serverID,
std::string name ="",
Permission permissions =Permission::NONE,
unsigned int color =0,
bool hoist =false,
bool mentionable =false
)

function editRolePosition

ArrayResponse< Role > editRolePosition(
Snowflake< Server > serverID,
std::vector< std::pair< std::string, uint64_t >> positions,
RequestSettings< ArrayResponse< Role >> settings ={}
)

function editRole

StringResponse editRole(
Snowflake< Server > serverID,
Snowflake< Role > roleID,
std::string name ="",
Permission permissions =Permission::NONE,
uint32_t color =1<< 24,
int8_t hoist =-1,
int8_t mentionable =-1
)

function deleteRole

BoolResponse deleteRole(
Snowflake< Server > serverID,
Snowflake< Role > roleID,
RequestSettings< BoolResponse > settings ={}
)

function pruneMembers

StandardResponse pruneMembers(
Snowflake< Server > serverID,
const unsigned int numOfDays,
RequestSettings< StandardResponse > settings ={}
)

function getVoiceRegions

ArrayResponse< VoiceRegion > getVoiceRegions(
RequestSettings< ArrayResponse< VoiceRegion >> settings ={}
)

function getServerInvites

ArrayResponse< Invite > getServerInvites(
Snowflake< Server > serverID,
RequestSettings< ArrayResponse< Invite >> settings ={}
)

function getIntegrations

StringResponse getIntegrations(
Snowflake< Server > serverID,
RequestSettings< StringResponse > settings ={}
)

function createIntegration

BoolResponse createIntegration(
Snowflake< Server > serverID,
std::string type,
std::string integrationID,
RequestSettings< BoolResponse > settings ={}
)

function editIntergration

BoolResponse editIntergration(
Snowflake< Server > serverID,
std::string integrationID,
int expireBegavior,
int expireGracePeriod,
bool enbleEmoticons
)

function deleteIntegration

BoolResponse deleteIntegration(
Snowflake< Server > serverID,
std::string integrationID,
RequestSettings< BoolResponse > settings ={}
)

function syncIntegration

BoolResponse syncIntegration(
Snowflake< Server > serverID,
std::string integrationID,
RequestSettings< BoolResponse > settings ={}
)

function getServerWidget

ObjectResponse< ServerWidget > getServerWidget(
Snowflake< Server > serverID,
RequestSettings< ObjectResponse< ServerWidget >> settings ={}
)

function inviteEndpoint

ObjectResponse< Invite > inviteEndpoint(
RequestMethod method,
std::string inviteCode,
RequestSettings< ObjectResponse< Invite >> settings ={}
)

function getInvite

ObjectResponse< Invite > getInvite(
std::string inviteCode,
RequestSettings< ObjectResponse< Invite >> settings ={}
)

function deleteInvite

ObjectResponse< Invite > deleteInvite(
std::string inviteCode,
RequestSettings< ObjectResponse< Invite >> settings ={}
)

function acceptInvite

ObjectResponse< Invite > acceptInvite(
std::string inviteCode,
RequestSettings< ObjectResponse< Invite >> settings ={}
)

function getCurrentUser

ObjectResponse< User > getCurrentUser(
RequestSettings< ObjectResponse< User >> settings ={}
)

function getUser

ObjectResponse< User > getUser(
Snowflake< User > userID,
RequestSettings< ObjectResponse< User >> settings ={}
)

function getServers

ArrayResponse< Server > getServers(
RequestSettings< ArrayResponse< Server >> settings ={}
)

function leaveServer

BoolResponse leaveServer(
Snowflake< Server > serverID,
RequestSettings< BoolResponse > settings ={}
)

function getDirectMessageChannels

ArrayResponse< Channel > getDirectMessageChannels(
RequestSettings< ArrayResponse< Channel >> settings ={}
)

function createDirectMessageChannel

ObjectResponse< Channel > createDirectMessageChannel(
std::string recipientID,
RequestSettings< ObjectResponse< Channel >> settings ={}
)

function getUserConnections

ArrayResponse< Connection > getUserConnections(
RequestSettings< ArrayResponse< Connection >> settings ={}
)

function createWebhook

ObjectResponse< Webhook > createWebhook(
Snowflake< Channel > channelID,
std::string name,
std::string avatar ="",
RequestSettings< ObjectResponse< Webhook >> settings ={}
)

function getChannelWebhooks

ArrayResponse< Webhook > getChannelWebhooks(
Snowflake< Channel > channelID,
RequestSettings< ArrayResponse< Webhook >> settings ={}
)

function getServerWebhooks

ArrayResponse< Webhook > getServerWebhooks(
Snowflake< Server > serverID,
RequestSettings< ArrayResponse< Webhook >> settings ={}
)

function getWebhook

ObjectResponse< Webhook > getWebhook(
Snowflake< Webhook > webhookID,
std::string webhookToken ="",
RequestSettings< ObjectResponse< Webhook >> settings ={}
)

function editWebhook

ObjectResponse< Webhook > editWebhook(
Snowflake< Webhook > webhookID,
std::string webhookToken ="",
std::string name ="",
std::string avatar =""
)

function deleteWebhook

BoolResponse deleteWebhook(
Snowflake< Webhook > webhookID,
std::string webhookToken ="",
RequestSettings< BoolResponse > settings ={}
)

function requestExecuteWebhook

ObjectResponse< Webhook > requestExecuteWebhook(
Snowflake< Webhook > webhookID,
std::string webhookToken,
std::pair< std::string, std::string > pair,
bool wait,
std::string username,
std::string avatar_url,
bool tts
)

function executeWebhook

ObjectResponse< Webhook > executeWebhook(
Snowflake< Webhook > webhookID,
std::string webhookToken,
std::string content,
bool wait =false,
std::string username ="",
std::string avatar_url ="",
bool tts =false
)

function executeWebhook

ObjectResponse< Webhook > executeWebhook(
Snowflake< Webhook > webhookID,
std::string webhookToken,
std::vector< Embed > embeds,
bool wait =false,
std::string username ="",
std::string avatar_url ="",
bool tts =false
)

function executeWebhook

ObjectResponse< Webhook > executeWebhook(
Snowflake< Webhook > webhookID,
std::string webhookToken,
filePathPart file,
bool wait =false,
std::string username ="",
std::string avatar_url ="",
bool tts =false
)

function createGlobalAppCommand

template <typename Options  =const AppCommand::EmptyOptions>
inline ObjectResponse< AppCommand > createGlobalAppCommand(
Snowflake< DiscordObject >::RawType applicationID,
std::string name,
std::string description,
Options options =(std::nullptr_t) nullptr,
bool defaultPermission =true,
AppCommand::Type type =AppCommand::Type::NONE,
RequestSettings< ObjectResponse< AppCommand >> settings ={}
)

function editGlobalAppCommand

template <typename Options  =const AppCommand::EmptyOptions>
inline ObjectResponse< AppCommand > editGlobalAppCommand(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< AppCommand > commandID,
std::string name,
std::string description,
Options options =(std::nullptr_t) nullptr,
bool defaultPermission =true,
AppCommand::Type type =AppCommand::Type::NONE,
RequestSettings< ObjectResponse< AppCommand >> settings ={}
)

function getGlobalAppCommands

ArrayResponse< AppCommand > getGlobalAppCommands(
Snowflake< DiscordObject >::RawType applicationID,
RequestSettings< ArrayResponse< AppCommand >> settings ={}
)

function getGlobalAppCommand

ObjectResponse< AppCommand > getGlobalAppCommand(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< AppCommand > commandID,
RequestSettings< ObjectResponse< AppCommand >> settings ={}
)

function deleteGlobalAppCommand

BoolResponse deleteGlobalAppCommand(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< AppCommand > commandID,
RequestSettings< BoolResponse > settings ={}
)

function createServerAppCommand

template <typename Options  =const AppCommand::EmptyOptions>
inline ObjectResponse< AppCommand > createServerAppCommand(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
std::string name,
std::string description,
Options options =(std::nullptr_t) nullptr,
bool defaultPermission =true,
AppCommand::Type type =AppCommand::Type::NONE,
RequestSettings< ObjectResponse< AppCommand >> settings ={}
)

function editServerAppCommand

template <typename Options  =const AppCommand::EmptyOptions>
inline ObjectResponse< AppCommand > editServerAppCommand(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
Snowflake< AppCommand > commandID,
std::string name,
std::string description,
Options options =(std::nullptr_t) nullptr,
RequestSettings< ObjectResponse< AppCommand >> settings ={}
)

function getServerAppCommands

ArrayResponse< AppCommand > getServerAppCommands(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
RequestSettings< ArrayResponse< AppCommand >> settings ={}
)

function getServerAppCommand

ObjectResponse< AppCommand > getServerAppCommand(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
Snowflake< AppCommand > commandID,
RequestSettings< ObjectResponse< AppCommand >> settings ={}
)

function deleteServerAppCommand

BoolResponse deleteServerAppCommand(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
Snowflake< AppCommand > commandID,
RequestSettings< BoolResponse > settings ={}
)

function createInteractionResponse

template <typename Type >
inline BoolResponse createInteractionResponse(
Snowflake< Interaction > interactionID,
std::string token,
Type response,
RequestSettings< BoolResponse > settings ={}
)

function editOriginalInteractionResponse

ObjectResponse< Message > editOriginalInteractionResponse(
Snowflake< DiscordObject >::RawType applicationID,
std::string interactionToken,
EditWebhookParams params,
RequestSettings< BoolResponse > settings ={}
)

function deleteOriginalInteractionResponse

BoolResponse deleteOriginalInteractionResponse(
Snowflake< DiscordObject >::RawType applicationID,
std::string interactionToken,
RequestSettings< BoolResponse > settings ={}
)

function createFollowupMessage

ObjectResponse< Message > createFollowupMessage(
Snowflake< DiscordObject >::RawType applicationID,
std::string interactionToken,
FollowupMessage params,
RequestSettings< BoolResponse > settings ={}
)

function editFollowupMessage

ObjectResponse< Message > editFollowupMessage(
Snowflake< DiscordObject >::RawType applicationID,
std::string interactionToken,
Snowflake< Message > messageID,
EditWebhookParams params,
RequestSettings< BoolResponse > settings ={}
)

function deleteFollowupMessage

BoolResponse deleteFollowupMessage(
Snowflake< DiscordObject >::RawType applicationID,
std::string interactionToken,
Snowflake< Message > messageID,
RequestSettings< BoolResponse > settings ={}
)

function batchEditAppCommandPermissions

BoolResponse batchEditAppCommandPermissions(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
std::vector< ServerAppCommandPermissions > permissions,
RequestSettings< BoolResponse > settings ={}
)

Batch edits permissions for all commands in a guild. Takes an array of partial objects including id and permissions. https://discord.com/developers/docs/interactions/slash-commands#batch-edit-application-command-permissions

function editServerAppCommandPermission

BoolResponse editServerAppCommandPermission(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
Snowflake< AppCommand > commandID,
std::vector< AppCommand::Permissions > permissions,
RequestSettings< BoolResponse > settings ={}
)

Edits command permissions for a specific command for your application in a guild. https://discord.com/developers/docs/interactions/slash-commands#edit-application-command-permissions

function getServerAppCommandPermissions

ArrayResponse< ServerAppCommandPermissions > getServerAppCommandPermissions(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
RequestSettings< ArrayResponse< ServerAppCommandPermissions >> settings ={}
)

Fetches command permissions for all commands for your application in a guild. https://discord.com/developers/docs/interactions/slash-commands#get-guild-application-command-permissions

function getAppCommandPermissions

ObjectResponse< ServerAppCommandPermissions > getAppCommandPermissions(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
Snowflake< AppCommand > commandID,
RequestSettings< ObjectResponse< ServerAppCommandPermissions >> settings ={}
)

Fetches command permissions for a specific command for your application in a guild. https://discord.com/developers/docs/interactions/slash-commands#get-application-command-permissions

function createAppCommand

template <typename Options  =const AppCommand::EmptyOptions>
inline ObjectResponse< AppCommand > createAppCommand(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
std::string name,
std::string description,
Options options =(std::nullptr_t) nullptr,
bool defaultPermission =true,
AppCommand::Type type =AppCommand::Type::NONE,
RequestSettings< ObjectResponse< AppCommand >> settings ={}
)

function editAppCommand

template <typename Options  =const AppCommand::EmptyOptions>
inline ObjectResponse< AppCommand > editAppCommand(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
Snowflake< AppCommand > commandID,
std::string name,
std::string description,
Options options =(std::nullptr_t) nullptr,
RequestSettings< ObjectResponse< AppCommand >> settings ={}
)

function getAppCommands

ArrayResponse< AppCommand > getAppCommands(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
RequestSettings< ArrayResponse< AppCommand >> settings ={}
)

function getAppCommand

ObjectResponse< AppCommand > getAppCommand(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
Snowflake< AppCommand > commandID,
RequestSettings< ObjectResponse< AppCommand >> settings ={}
)

function deleteAppCommand

BoolResponse deleteAppCommand(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
Snowflake< AppCommand > commandID,
RequestSettings< BoolResponse > settings ={}
)

function bulkOverwriteServerAppCommands

BoolResponse bulkOverwriteServerAppCommands(
Snowflake< DiscordObject >::RawType applicationID,
Snowflake< Server > serverID,
std::vector< AppCommand > commands,
RequestSettings< BoolResponse > settings ={}
)

function bulkOverwriteGlobalAppCommands

BoolResponse bulkOverwriteGlobalAppCommands(
Snowflake< DiscordObject >::RawType applicationID,
std::vector< AppCommand > commands,
RequestSettings< BoolResponse > settings ={}
)

function createStageInstance

ObjectResponse< User > createStageInstance(
Snowflake< Channel > channelID,
std::string topic,
StageInstance::PrivacyLevel privacyLevel =StageInstance::PrivacyLevel::NotSet,
RequestSettings< ObjectResponse< User >> settings ={}
)

function getStageInstance

ObjectResponse< StageInstance > getStageInstance(
Snowflake< Channel > channelID,
RequestSettings< ObjectResponse< StageInstance >> settings ={}
)

function editStageInstance

BoolResponse editStageInstance(
Snowflake< Channel > channelID,
std::string topic,
StageInstance::PrivacyLevel privacyLevel =StageInstance::PrivacyLevel::NotSet,
RequestSettings< BoolResponse > settings ={}
)

function deleteStageInstance

BoolResponse deleteStageInstance(
Snowflake< Channel > channelID,
RequestSettings< BoolResponse > settings ={}
)

function updateStatus

void updateStatus(
std::string gameName ="",
uint64_t idleSince =0,
Status status =online,
bool afk =false
)

function requestServerMembers

void requestServerMembers(
ServerMembersRequest request
)

function getServerBanner

void getServerBanner(
Snowflake< Server > serverID,
std::string serverBanner,
std::string format,
std::function< void(StandardResponse &)> callback
)

function getServerBanner

inline void getServerBanner(
Server & server,
std::string format
)

function waitTilReady

void waitTilReady()

function isReady

inline const bool isReady()

function isQuiting

inline const bool isQuiting()

function isBot

inline const bool isBot()

function getID

inline const Snowflake< User > getID()

function setShardID

void setShardID(
int _shardID,
int _shardCount
)

function getShardID

inline const int getShardID()

function getShardCount

inline const int getShardCount()

function hasIntents

inline const bool hasIntents()

function getIntents

inline const IntentsRaw getIntents()

function setIntents

inline void setIntents(
IntentsRaw newIntents
)

function quit

inline void quit()

function run

virtual void run()

Reimplemented by: SleepyDiscord::UWebSocketsDiscordClient::run, SleepyDiscord::WebsocketppDiscordClient::run

function setIntents

template <class Container ,
typename T =typename Container::value_type>
inline void setIntents(
const Container & listOfIntents
)

function setIntents

template <typename... Types>
inline void setIntents(
Intent first,
Intent second,
Types... others
)

function useCompression

template <class Handler ,
class... Types>
inline void useCompression(
Types &&... arguments
)

function useCompression

inline void useCompression(
bool value =true
)

function setScheduleHandler

template <class Handler ,
class... Types>
inline void setScheduleHandler(
Types &&... arguments
)

function getScheduleHandler

inline GenericScheduleHandler & getScheduleHandler()

function schedule

virtual Timer schedule(
TimedTask code,
const time_t millisecondsTilDueTime
)

Reimplemented by: SleepyDiscord::UWebSocketsDiscordClient::schedule, SleepyDiscord::WebsocketppDiscordClient::schedule

function schedule

inline Timer schedule(
TimedTask code,
const time_t milliseconds,
AssignmentType mode
)

function schedule

inline Timer schedule(
void(BaseDiscordClient::*)() code,
const time_t milliseconds,
AssignmentType mode =TilDueTime
)

function unschedule

inline void unschedule(
Timer & timer
)

function postTask

inline virtual void postTask(
PostableTask code
)

Reimplemented by: SleepyDiscord::WebsocketppDiscordClient::postTask

function createServerCache

std::shared_ptr< ServerCache > createServerCache()

function setServerCache

void setServerCache(
std::shared_ptr< ServerCache > cache
)

function getServerCache

inline std::shared_ptr< ServerCache > & getServerCache()

function getCDN_URL

static inline constexpr nonstd::string_view getCDN_URL()

Protected Functions Documentation

function onDepletedRequestSupply

virtual void onDepletedRequestSupply(
const Route::Bucket & bucket,
time_t timeTilReset
)

function onExceededRateLimit

virtual void onExceededRateLimit(
bool global,
std::time_t timeTilRetry,
Request request,
bool & continueRequest
)

function onReady

virtual void onReady(
Ready readyData
)

function onResumed

virtual void onResumed()

function onDeleteServer

virtual void onDeleteServer(
UnavailableServer server
)

function onEditServer

virtual void onEditServer(
Server server
)

function onBan

virtual void onBan(
Snowflake< Server > serverID,
User user
)

function onUnban

virtual void onUnban(
Snowflake< Server > serverID,
User user
)

function onMember

virtual void onMember(
Snowflake< Server > serverID,
ServerMember member
)

function onRemoveMember

virtual void onRemoveMember(
Snowflake< Server > serverID,
User user
)

function onEditMember

virtual void onEditMember(
Snowflake< Server > serverID,
User user,
std::vector< Snowflake< Role >> roles,
std::string nick
)

function onRole

virtual void onRole(
Snowflake< Server > serverID,
Role role
)

function onDeleteRole

virtual void onDeleteRole(
Snowflake< Server > serverID,
Snowflake< Role > roleID
)

function onEditRole

virtual void onEditRole(
Snowflake< Server > serverID,
Role role
)

function onEditEmojis

virtual void onEditEmojis(
Snowflake< Server > serverID,
std::vector< Emoji > emojis
)

function onMemberChunk

virtual void onMemberChunk(
ServerMembersChunk memberChunk
)

function onDeleteChannel

virtual void onDeleteChannel(
Channel channel
)

function onEditChannel

virtual void onEditChannel(
Channel channel
)

function onPinMessage

virtual void onPinMessage(
Snowflake< Channel > channelID,
std::string lastPinTimestamp
)

function onPresenceUpdate

virtual void onPresenceUpdate(
PresenceUpdate presenseUpdate
)

function onEditUser

virtual void onEditUser(
User user
)

function onEditUserSettings

virtual void onEditUserSettings(
const json::Value & jsonMessage
)

function onEditVoiceState

virtual void onEditVoiceState(
VoiceState & state
)

function onTyping

virtual void onTyping(
Snowflake< Channel > channelID,
Snowflake< User > userID,
time_t timestamp
)

function onDeleteMessages

virtual void onDeleteMessages(
Snowflake< Channel > channelID,
std::vector< Snowflake< Message >> messages
)

function onEditMessage

virtual void onEditMessage(
MessageRevisions revisioins
)

function onEditVoiceServer

virtual void onEditVoiceServer(
VoiceServerUpdate & update
)

function onReaction

virtual void onReaction(
Snowflake< User > userID,
Snowflake< Channel > channelID,
Snowflake< Message > messageID,
Emoji emoji
)

function onDeleteReaction

virtual void onDeleteReaction(
Snowflake< User > userID,
Snowflake< Channel > channelID,
Snowflake< Message > messageID,
Emoji emoji
)

function onDeleteAllReaction

virtual void onDeleteAllReaction(
Snowflake< Server > serverID,
Snowflake< Channel > channelID,
Snowflake< Message > messageID
)

function onMessage

virtual void onMessage(
Message message
)

function onServer

virtual void onServer(
Server server
)

function onChannel

virtual void onChannel(
Channel channel
)

function onInteraction

inline virtual void onInteraction(
Interaction interaction
)

function onAppCommand

inline virtual void onAppCommand(
AppCommand appCommand
)

function onEditAppCommand

inline virtual void onEditAppCommand(
AppCommand appCommand
)

function onDeleteAppCommand

inline virtual void onDeleteAppCommand(
AppCommand appCommand
)

function onStageInstance

inline virtual void onStageInstance(
StageInstance instance
)

function onDeleteStageInstance

inline virtual void onDeleteStageInstance(
StageInstance instance
)

function onEditStageInstance

inline virtual void onEditStageInstance(
StageInstance instance
)

function onUnknownEvent

virtual void onUnknownEvent(
std::string name,
const json::Value & data
)

function onDispatch

inline virtual void onDispatch(
const json::Value & t,
json::Value & d
)

function onHeartbeat

virtual void onHeartbeat()

function onHeartbeatAck

virtual void onHeartbeatAck()

function onInvaldSession

virtual void onInvaldSession()

function onDisconnect

virtual void onDisconnect()

function onResume

virtual void onResume()

function onQuit

virtual void onQuit()

function onRestart

inline virtual void onRestart()

function onResponse

virtual void onResponse(
Response response
)

function sleep

virtual void sleep(
const unsigned int milliseconds
)

function fileRead

virtual void fileRead(
const char * path,
std::string *const file
)

function tick

virtual void tick(
float deltaTime
)

function onError

virtual void onError(
ErrorCode errorCode,
const std::string errorMessage
)

function processMessage

virtual void processMessage(
const std::string & message
) override

Reimplements: SleepyDiscord::GenericMessageReceiver::processMessage

function processMessage

virtual void processMessage(
const WebSocketMessage message
) override

Reimplements: SleepyDiscord::GenericMessageReceiver::processMessage

function processCloseCode

virtual void processCloseCode(
const int16_t code
) override

Reimplements: SleepyDiscord::GenericMessageReceiver::processCloseCode

function heartbeat

void heartbeat()

function sendHeartbeat

inline void sendHeartbeat()

function resetHeartbeatValues

void resetHeartbeatValues()

function getToken

inline std::string getToken()

function setToken

inline void setToken(
const std::string & value
)

function start

void start(
const std::string _token,
const char maxNumOfThreads =DEFAULT_THREADS,
int _shardID =0,
int _shardCount =0
)

function connect

inline void connect()

function connect

inline virtual bool connect(
const std::string & ,
GenericMessageReceiver * ,
WebsocketConnection &
)

Reimplemented by: SleepyDiscord::WebsocketppDiscordClient::connect

function handleFailToConnect

inline virtual void handleFailToConnect() override

Reimplements: SleepyDiscord::GenericMessageReceiver::handleFailToConnect

function send

inline virtual void send(
std::string ,
WebsocketConnection &
)

Reimplemented by: SleepyDiscord::WebsocketppDiscordClient::send

function disconnect

inline virtual void disconnect(
unsigned int ,
const std::string ,
WebsocketConnection &
)

Reimplemented by: SleepyDiscord::WebsocketppDiscordClient::disconnect

function reconnect

void reconnect(
const unsigned int status =4900
)

function stopClient

inline virtual void stopClient()

Reimplemented by: SleepyDiscord::WebsocketppDiscordClient::stopClient

function initialize

inline void initialize(
GenericMessageReceiver *& messageProcessor
) const

function processMessage

inline void processMessage(
GenericMessageReceiver *& messageProcessor,
const std::string & message
) const

function processCloseCode

inline void processCloseCode(
GenericMessageReceiver *& messageProcessor,
const int16_t & code
) const

function runAsync

virtual void runAsync()

Reimplemented by: SleepyDiscord::UWebSocketsDiscordClient::runAsync, SleepyDiscord::WebsocketppDiscordClient::runAsync

function getEpochTimeMillisecond

virtual const time_t getEpochTimeMillisecond()

Updated on 13 April 2022 at 18:39:59 UTC