-
Notifications
You must be signed in to change notification settings - Fork 3
API Documentation
| Members | Descriptions |
|---|---|
define VERSION
|
|
define VERSION_MAJOR
|
|
define VERSION_MINOR
|
|
define VERSION_PATCH
|
|
define VERSION_SUFFIX
|
|
define DISCORDBOT_EXPORT
|
|
define DISCORDBOT_UNIX
|
|
namespace DiscordBot
|
|
struct DiscordBot::CFactory::gen
|
|
struct DiscordBot::CFactory::gen< 0, S... >
|
|
struct DiscordBot::atomic::locked_ref
|
|
struct DiscordBot::CFactory::seq
|
define VERSION
define VERSION_MAJOR
define VERSION_MINOR
define VERSION_PATCH
define VERSION_SUFFIX
define DISCORDBOT_EXPORT
define DISCORDBOT_UNIX
| Members | Descriptions |
|---|---|
enum AccessMode
|
Access modes for commands. |
enum Intent
|
|
enum ActionType
|
|
enum ActivityType
|
|
enum ActivityFlags
|
|
enum ChannelTypes
|
|
enum DiscordClientErrorType
|
|
enum MentionTypes
|
|
enum OnlineState
|
Online state of the bot. |
enum Permission
|
Permission bits for different roles. For more info see here. |
enum UserFlags
|
|
enum PremiumTypes
|
|
public DISCORDBOT_EXPORT std::string AccessModeToString(AccessMode Mode)
|
|
public inline Intent operator|(Intent lhs,Intent rhs)
|
|
public inline ActionType operator|(ActionType lhs,ActionType rhs)
|
|
public inline ActionType operator&(ActionType lhs,ActionType rhs)
|
|
public inline ActivityFlags operator|(ActivityFlags lhs,ActivityFlags rhs)
|
|
public template<> inline rT operator+(const lT & lhs,const atomic< rT > & rhs)
|
|
public template<> inline rT operator-(const lT & lhs,const atomic< rT > & rhs)
|
|
public template<> inline rT operator*(const lT & lhs,const atomic< rT > & rhs)
|
|
public template<> inline rT operator/(const lT & lhs,const atomic< rT > & rhs)
|
|
public template<> inline bool operator==(const lT & lhs,const atomic< rT > & rhs)
|
|
public template<> inline std::ostream & operator<<(std::ostream & of,const atomic< T > & rhs)
|
|
public template<> inline std::istream & operator>>(std::istream & in,atomic< T > & rhs)
|
|
public inline Permission operator|(Permission lhs,Permission rhs)
|
|
public inline Permission operator&(Permission lhs,Permission rhs)
|
|
class DiscordBot::atomic
|
|
class DiscordBot::CAction
|
|
class DiscordBot::CActivity
|
|
class DiscordBot::CChannel
|
|
class DiscordBot::CCommandContext
|
Contains all informations about a command which was sended. |
class DiscordBot::CDiscordClientException
|
|
class DiscordBot::CEmbed
|
|
class DiscordBot::CFactory
|
|
class DiscordBot::CGuild
|
|
class DiscordBot::CGuildMember
|
|
class DiscordBot::CMessage
|
|
class DiscordBot::CModifyChannel
|
|
class DiscordBot::CModifyMember
|
|
class DiscordBot::CParty
|
|
class DiscordBot::CPermissionOverwrites
|
|
class DiscordBot::CRole
|
|
class DiscordBot::CSecrets
|
|
class DiscordBot::CSongInfo
|
|
class DiscordBot::CUser
|
|
class DiscordBot::CVoiceState
|
|
class DiscordBot::IAction
|
|
class DiscordBot::IAudioSource
|
Interface for voice connections. |
class DiscordBot::ICommand
|
Interface to handle commands. |
class DiscordBot::ICommandsConfig
|
|
class DiscordBot::IController
|
Controller interface which receives events from the client. |
class DiscordBot::IDiscordClient
|
|
class DiscordBot::IFactory
|
|
class DiscordBot::IGuildAdmin
|
This interface covers all function where you need special rights on a server. |
class DiscordBot::IMusicQueue
|
Thread safe music queue interface. |
struct DiscordBot::SCommandDescription
|
Describes the command. |
struct DiscordBot::SMention
|
enum AccessMode
| Values | Descriptions |
|---|---|
| OWNER | This command can only be accessed by the owner. |
| ROLE | This command can only be accessed by a given role. |
| EVERYBODY | Free for all. |
Access modes for commands.
enum Intent
| Values | Descriptions |
|---|---|
| GUILDS | |
| GUILD_MEMBERS | Please visit this website to use this intent. |
| GUILD_BANS | |
| GUILD_EMOJIS | |
| GUILD_INTEGRATIONS | |
| GUILD_WEBHOOKS | |
| GUILD_INVITES | |
| GUILD_VOICE_STATES | |
| GUILD_PRESENCES | Please visit this website to use this intent. |
| GUILD_MESSAGES | |
| GUILD_MESSAGE_REACTIONS | |
| GUILD_MESSAGE_TYPING | |
| DIRECT_MESSAGES | |
| DIRECT_MESSAGE_REACTIONS | |
| DIRECT_MESSAGE_TYPING | |
| DEFAULTS |
enum ActionType
| Values | Descriptions |
|---|---|
| NONE | |
| USER_JOIN | Action must be from the type GuildMember. |
| USER_LEAVE | Action must be from the type GuildMember. |
| RESERVED_1 | |
| RESERVED_2 | |
| RESERVED_3 | |
| RESERVED_4 | |
| MESSAGE_CREATED | |
| MESSAGE_EDITED | |
| MESSAGE_DELETED | |
| TOTAL_ACTIONS |
enum ActivityType
| Values | Descriptions |
|---|---|
| GAME | |
| STREAMING | |
| LISTENING | |
| CUSTOM |
enum ActivityFlags
| Values | Descriptions |
|---|---|
| INSTANCE | |
| JOIN | |
| SPECTATE | |
| JOIN_REQUEST | |
| SYNC | |
| PLAY |
enum ChannelTypes
| Values | Descriptions |
|---|---|
| GUILD_TEXT | |
| DM | |
| GUILD_VOICE | |
| GROUP_DM | |
| GUILD_CATEGORY | |
| GUILD_NEWS | |
| GUILD_STORE |
| Values | Descriptions |
|---|---|
| MISSING_PERMISSION | Throws if your bot doesn't have the permission to execute an action inside a guild. |
| HTTP_ERROR | There was an error with the request. |
| PARAMETER_IS_NULL | Throws if a required parameter is a nullptr. |
| MISSING_USER_REF | Throws if a user reference is null. |
| ACTION_ALREADY_REG | Throws if the given action is already registered. |
enum MentionTypes
| Values | Descriptions |
|---|---|
| USER | |
| NICKNAME | |
| CHANNEL | |
| ROLE | |
| EMOJI | |
| CUSTOM_EMOJI | |
| CUSTOM_ANIM_EMOJI |
enum OnlineState
| Values | Descriptions |
|---|---|
| ONLINE | |
| DND | |
| IDLE | |
| INVISIBLE | |
| OFFLINE |
Online state of the bot.
enum Permission
| Values | Descriptions |
|---|---|
| CREATE_INSTANT_INVITE | Allows creation of instant invites, T, V. |
| KICK_MEMBERS | Allows kicking members. |
| BAN_MEMBERS | Allows banning members. |
| ADMINISTRATOR | Allows all permissions and bypasses channel permission overwrites. |
| MANAGE_CHANNELS | Allows management and editing of channels T, V. |
| MANAGE_GUILD | Allows management and editing of the guild. |
| ADD_REACTIONS | Allows for the addition of reactions to messages T. |
| VIEW_AUDIT_LOG | Allows for viewing of audit logs. |
| PRIORITY_SPEAKER | Allows for using priority speaker in a voice channel V. |
| STREAM | Allows the user to go live V. |
| VIEW_CHANNEL | Allows guild members to view a channel, which includes reading messages in text channels T, V. |
| SEND_MESSAGES | Allows for sending messages in a channel T. |
| SEND_TTS_MESSAGES | Allows for sending of /tts messages T. |
| MANAGE_MESSAGES | Allows for deletion of other users messages T. |
| EMBED_LINKS | Links sent by users with this permission will be auto-embedded T. |
| ATTACH_FILES | Allows for uploading images and files T. |
| READ_MESSAGE_HISTORY | Allows for reading of message history T. |
| MENTION_EVERYONE | Allows for using the @everyone tag to notify all users in a channel, and the @here tag to notify all online users in a channel T. |
| USE_EXTERNAL_EMOJIS | Allows the usage of custom emojis from other servers T. |
| VIEW_GUILD_INSIGHTS | Allows for viewing guild insights. |
| CONNECT | Allows for joining of a voice channel V. |
| SPEAK | Allows for speaking in a voice channel V. |
| MUTE_MEMBERS | Allows for muting members in a voice channel V. |
| DEAFEN_MEMBERS | Allows for deafening of members in a voice channel V. |
| MOVE_MEMBERS | Allows for moving of members between voice channels V. |
| USE_VAD | Allows for using voice-activity-detection in a voice channel V. |
| CHANGE_NICKNAME | Allows for modification of own nickname. |
| MANAGE_NICKNAMES | Allows for modification of other users nicknames. |
| MANAGE_ROLES | Allows management and editing of roles T, V. |
| MANAGE_WEBHOOKS | Allows management and editing of webhooks T, V. |
| MANAGE_EMOJIS | Allows management and editing of emojis. |
Permission bits for different roles. For more info see here.
enum UserFlags
| Values | Descriptions |
|---|---|
| NONE | |
| DISCORD_EMPLOYEE | |
| DISCORD_PARTNER | |
| HYPESQUAD_EVENTS | |
| BUG_HUNTER_LEVEL_1 | |
| HOUSE_BRAVERY | |
| HOUSE_BRILLIANCE | |
| HOUSE_BALANCE | |
| EARLY_SUPPORTER | |
| TEAM_USER | |
| SYSTEM | |
| BUG_HUNTER_LEVEL_2 | |
| VERIFIED_BOT | |
| VERIFIED_BOT_DEVELOPER |
enum PremiumTypes
| Values | Descriptions |
|---|---|
| NONE | |
| NITRO_CLASSIC | |
| NITRO |
public DISCORDBOT_EXPORT std::string AccessModeToString(AccessMode Mode)
public inline Intent operator|(Intent lhs,Intent rhs)
public inline ActionType operator|(ActionType lhs,ActionType rhs)
public inline ActionType operator&(ActionType lhs,ActionType rhs)
public inline ActivityFlags operator|(ActivityFlags lhs,ActivityFlags rhs)
public template<>
inline bool operator==(const lT & lhs,const atomic< rT > & rhs)
public template<>
inline std::ostream & operator<<(std::ostream & of,const atomic< T > & rhs)
public template<>
inline std::istream & operator>>(std::istream & in,atomic< T > & rhs)
public inline Permission operator|(Permission lhs,Permission rhs)
public inline Permission operator&(Permission lhs,Permission rhs)
| Members | Descriptions |
|---|---|
public inline atomic()
|
|
public inline atomic(const atomic< T > & val)
|
|
public inline operator T() const noexcept
|
|
public inline atomic&operator=(const T & val)
|
|
public inline atomic&operator=(const atomic< T > & val)
|
|
public inline bool operator==(const T & rhs)
|
|
public inline bool operator==(const atomic< T > & rhs)
|
|
public inline bool operator!=(const T & rhs)
|
|
public inline bool operator!=(const atomic< T > & rhs)
|
|
public inline T load() const noexcept
|
|
public inline locked_ref operator->()
|
|
public inline ~atomic()
|
public inline atomic()
public inline operator T() const noexcept
public inline bool operator==(const T & rhs)
public inline bool operator==(const atomic< T > & rhs)
public inline bool operator!=(const T & rhs)
public inline bool operator!=(const atomic< T > & rhs)
public inline T load() const noexcept
public inline locked_ref operator->()
public inline ~atomic()
class DiscordBot::CAction
: public DiscordBot::IAction
| Members | Descriptions |
|---|---|
public inline CAction(ActionType Types)
|
|
public inline virtual bool Filter(ActionType Type,Channel c,T val)
|
Filters the current event and checks if this event should be fired. |
public void FireAction(ActionType Type,Channel c,T val)
|
Fires/executes the action. Here you can wirte your logic. |
public virtual ~CAction() = default
|
public inline CAction(ActionType Types)
public inline virtual bool Filter(ActionType Type,Channel c,T val)
Filters the current event and checks if this event should be fired.
-
TypeType of the action -
cChannel which triggered this action -
valDiscord object which had triggered the channel.
Returns true if the event should be fired.
public void FireAction(ActionType Type,Channel c,T val)
Fires/executes the action. Here you can wirte your logic.
-
TypeType of the action -
cChannel which triggered this action -
valDiscord object which had triggered the channel.
public virtual ~CAction() = default
| Members | Descriptions |
|---|---|
public atomic< std::string > Name
|
|
public ActivityType Type
|
|
public atomic< std::string > URL
|
|
public std::atomic< int > CreatedAt
|
|
public std::atomic< int > StartTime
|
|
public std::atomic< int > EndTime
|
|
public atomic< std::string > AppID
|
|
public atomic< std::string > Details
|
|
public atomic< std::string > State
|
|
public Party PartyObject
|
|
public Secrets Secret
|
|
public std::atomic< bool > Instance
|
|
public ActivityFlags Flags
|
|
public inline CActivity()
|
|
public inline ~CActivity()
|
public ActivityType Type
public std::atomic< int > CreatedAt
public std::atomic< int > StartTime
public std::atomic< int > EndTime
public Party PartyObject
public Secrets Secret
public std::atomic< bool > Instance
public ActivityFlags Flags
public inline CActivity()
public inline ~CActivity()
| Members | Descriptions |
|---|---|
public atomic< std::string > ID
|
|
public ChannelTypes Type
|
|
public atomic< std::string > GuildID
|
|
public std::atomic< int > Position
|
|
public atomic< std::vector< PermissionOverwrites > > Overwrites
|
|
public atomic< std::string > Name
|
|
public atomic< std::string > Topic
|
|
public std::atomic< bool > NSFW
|
|
public atomic< std::string > LastMessageID
|
|
public std::atomic< int > Bitrate
|
|
public std::atomic< int > UserLimit
|
|
public std::atomic< int > RateLimit
|
|
public atomic< std::vector< User > > Recipients
|
|
public atomic< std::string > Icon
|
|
public atomic< std::string > OwnerID
|
|
public atomic< std::string > AppID
|
|
public atomic< std::string > ParentID
|
|
public atomic< std::string > LastPinTimestamp
|
|
public inline CChannel()
|
|
public inline ~CChannel()
|
public ChannelTypes Type
public std::atomic< int > Position
public atomic< std::vector< PermissionOverwrites > > Overwrites
public std::atomic< bool > NSFW
public atomic< std::string > LastMessageID
public std::atomic< int > Bitrate
public std::atomic< int > UserLimit
public std::atomic< int > RateLimit
public atomic< std::vector< User > > Recipients
public atomic< std::string > LastPinTimestamp
public inline CChannel()
public inline ~CChannel()
Contains all informations about a command which was sended.
| Members | Descriptions |
|---|---|
public Message Msg
|
Message wich contains the command. |
public std::string Command
|
Command without prefix. |
public std::vector< std::string > Params
|
Command parameters. |
public CCommandContext() = default
|
|
public ~CCommandContext() = default
|
public Message Msg
Message wich contains the command.
public std::string Command
Command without prefix.
public std::vector< std::string > Params
Command parameters.
public CCommandContext() = default
public ~CCommandContext() = default
class DiscordBot::CDiscordClientException
: public exception
| Members | Descriptions |
|---|---|
public inline CDiscordClientException()
|
|
public inline CDiscordClientException(DiscordClientErrorType Type)
|
|
public inline CDiscordClientException(const std::string & Msg,DiscordClientErrorType Type)
|
|
public inline const char * what() const
|
|
public inline DiscordClientErrorType ErrType() const noexcept
|
public inline CDiscordClientException()
public inline CDiscordClientException(DiscordClientErrorType Type)
public inline CDiscordClientException(const std::string & Msg,DiscordClientErrorType Type)
public inline const char * what() const
public inline DiscordClientErrorType ErrType() const noexcept
| Members | Descriptions |
|---|---|
public atomic< std::string > Title
|
|
public atomic< std::string > Description
|
|
public atomic< std::string > Type
|
|
public atomic< std::string > URL
|
|
public inline CEmbed()
|
|
public inline ~CEmbed()
|
public atomic< std::string > Description
public inline CEmbed()
public inline ~CEmbed()
class DiscordBot::CFactory
: public DiscordBot::IFactory< Base >
| Members | Descriptions |
|---|---|
public inline CFactory(Tuple Params)
|
|
public inline virtual std::shared_ptr< Base > Create()
|
|
public inline ~CFactory()
|
public inline CFactory(Tuple Params)
public inline virtual std::shared_ptr< Base > Create()
public inline ~CFactory()
| Members | Descriptions |
|---|---|
public atomic< std::string > ID
|
|
public atomic< std::string > Name
|
|
public atomic< std::string > Icon
|
|
public GuildMember Owner
|
|
public atomic< std::map< std::string, GuildMember > > Members
|
|
public atomic< std::map< std::string, Channel > > Channels
|
|
public atomic< std::map< std::string, Role > > Roles
|
|
public inline CGuild()
|
|
public inline ~CGuild()
|
public GuildMember Owner
public inline CGuild()
public inline ~CGuild()
| Members | Descriptions |
|---|---|
public atomic< std::string > GuildID
|
|
public User UserRef
|
|
public atomic< std::string > Nick
|
|
public atomic< std::vector< Role > > Roles
|
|
public atomic< std::string > JoinedAt
|
|
public atomic< std::string > PremiumSince
|
|
public std::atomic< bool > Deaf
|
|
public std::atomic< bool > Mute
|
|
public VoiceState State
|
|
public inline CGuildMember()
|
|
public inline ~CGuildMember()
|
public User UserRef
public atomic< std::string > PremiumSince
public std::atomic< bool > Deaf
public std::atomic< bool > Mute
public VoiceState State
public inline CGuildMember()
public inline ~CGuildMember()
| Members | Descriptions |
|---|---|
public std::string ID
|
|
public Channel ChannelRef
|
Could contain a dummy channel if this is a dm. Only the id field is filled. |
public Guild GuildRef
|
|
public User Author
|
|
public GuildMember Member
|
|
public std::string Content
|
|
public std::string Timestamp
|
|
public std::string EditedTimestamp
|
|
public bool Mention
|
|
public std::vector< GuildMember > Mentions
|
Could contains dummy Guild Members if this is a dm. Only the UserRef field is filled. |
public std::vector< Role > RoleMentions
|
|
public std::vector< Channel > ChannelMentions
|
Only textual channels that are visible to everyone. |
public inline CMessage()
|
|
public std::vector< SMention>ParseParam(const std::string & Param)
|
Parses a parameter for the Discords messaging format. https://discord.com/developers/docs/reference#message-formatting. |
public inline ~CMessage()
|
public std::string ID
public Channel ChannelRef
Could contain a dummy channel if this is a dm. Only the id field is filled.
public Guild GuildRef
public User Author
public GuildMember Member
public std::string Content
public std::string Timestamp
public std::string EditedTimestamp
public bool Mention
public std::vector< GuildMember > Mentions
Could contains dummy Guild Members if this is a dm. Only the UserRef field is filled.
public std::vector< Role > RoleMentions
public std::vector< Channel > ChannelMentions
Only textual channels that are visible to everyone.
public inline CMessage()
public std::vector< SMention>ParseParam(const std::string & Param)
Parses a parameter for the Discords messaging format. https://discord.com/developers/docs/reference#message-formatting.
Returns a list of mentions.
public inline ~CMessage()
| Members | Descriptions |
|---|---|
public inline CModifyChannel()
|
|
public inline CModifyChannel(Channel ChannelRef)
|
|
public inline void SetChannelRef(Channel ChannelRef)
|
|
public inline Channel GetChannelRef() const
|
|
public inline void SetName(std::string Name)
|
|
public inline void SetType(ChannelTypes Type)
|
|
public inline void SetPosition(int Position)
|
|
public inline void SetTopic(std::string Topic)
|
|
public inline void SetNSFW(bool NSFW)
|
|
public inline void SetRateLimitUser(int RateLimitUser)
|
|
public inline void SetBitrate(int Bitrate)
|
|
public inline void SetUserLimit(int UserLimit)
|
|
public inline void SetPermOverwrites(std::vector< PermissionOverwrites > PermOverwrites)
|
|
public inline std::vector< PermissionOverwrites > GetOverwrites() const
|
|
public inline bool HasOverwrites() const
|
|
public inline void SetCategorie(Channel Categorie)
|
|
public inline std::map< std::string, std::string > GetValues() const
|
|
public inline ~CModifyChannel()
|
public inline CModifyChannel()
public inline CModifyChannel(Channel ChannelRef)
public inline void SetChannelRef(Channel ChannelRef)
public inline Channel GetChannelRef() const
public inline void SetName(std::string Name)
public inline void SetType(ChannelTypes Type)
public inline void SetPosition(int Position)
public inline void SetTopic(std::string Topic)
public inline void SetNSFW(bool NSFW)
public inline void SetRateLimitUser(int RateLimitUser)
public inline void SetBitrate(int Bitrate)
public inline void SetUserLimit(int UserLimit)
public inline void SetPermOverwrites(std::vector< PermissionOverwrites > PermOverwrites)
public inline std::vector< PermissionOverwrites > GetOverwrites() const
public inline bool HasOverwrites() const
public inline void SetCategorie(Channel Categorie)
public inline std::map< std::string, std::string > GetValues() const
public inline ~CModifyChannel()
| Members | Descriptions |
|---|---|
public inline CModifyMember()
|
|
public inline CModifyMember(User userRef)
|
|
public inline User GetUserRef() const
|
|
public inline void SetUserRef(User UserRef)
|
Sets the user to modify. |
public inline void SetNick(std::string Nick)
|
Sets the new nickname of a user. |
public inline std::vector< Role > GetRoles() const
|
|
public inline void SetRoles(std::vector< Role > Roles)
|
Sets the roles of a user. |
public inline void SetDeaf(bool Deaf)
|
Deafs a member in a voice channel. |
public inline void SetMute(bool Mute)
|
Mutes a member in a voice channel. |
public inline void SetChannel(Channel c)
|
Moves a member to a channel. |
public inline std::map< std::string, std::string > GetValues() const
|
|
public inline bool HasRoles() const
|
|
public inline ~CModifyMember()
|
public inline CModifyMember()
public inline CModifyMember(User userRef)
public inline User GetUserRef() const
public inline void SetUserRef(User UserRef)
Sets the user to modify.
public inline void SetNick(std::string Nick)
Sets the new nickname of a user.
The bot needs following permission
MANAGE_NICKNAMES
public inline std::vector< Role > GetRoles() const
public inline void SetRoles(std::vector< Role > Roles)
Sets the roles of a user.
The bot needs following permission
MANAGE_ROLES
public inline void SetDeaf(bool Deaf)
Deafs a member in a voice channel.
The bot needs following permission
DEAFEN_MEMBERS
public inline void SetMute(bool Mute)
Mutes a member in a voice channel.
The bot needs following permission
MUTE_MEMBERS
public inline void SetChannel(Channel c)
Moves a member to a channel.
If c is null the user will be kicked from the voice channel.
The bot needs following permission
MOVE_MEMBERS
public inline std::map< std::string, std::string > GetValues() const
public inline bool HasRoles() const
public inline ~CModifyMember()
| Members | Descriptions |
|---|---|
public atomic< std::string > ID
|
|
public atomic< std::vector< int > > Size
|
|
public inline CParty()
|
|
public inline ~CParty()
|
public inline CParty()
public inline ~CParty()
| Members | Descriptions |
|---|---|
public atomic< std::string > ID
|
User or role id. |
public atomic< std::string > Type
|
role or user |
public Permission Allow
|
|
public Permission Deny
|
|
public inline CPermissionOverwrites()
|
|
public inline ~CPermissionOverwrites()
|
User or role id.
role or user
public Permission Allow
public Permission Deny
public inline CPermissionOverwrites()
public inline ~CPermissionOverwrites()
| Members | Descriptions |
|---|---|
public atomic< std::string > ID
|
|
public atomic< std::string > Name
|
|
public std::atomic< uint32_t > Color
|
|
public std::atomic< bool > Hoist
|
|
public std::atomic< int > Position
|
|
public Permission Permissions
|
|
public std::atomic< bool > Managed
|
|
public std::atomic< bool > Mentionable
|
|
public inline CRole()
|
|
public inline ~CRole()
|
public std::atomic< uint32_t > Color
public std::atomic< bool > Hoist
public std::atomic< int > Position
public Permission Permissions
public std::atomic< bool > Managed
public std::atomic< bool > Mentionable
public inline CRole()
public inline ~CRole()
| Members | Descriptions |
|---|---|
public atomic< std::string > Join
|
|
public atomic< std::string > Spectate
|
|
public atomic< std::string > Match
|
|
public inline CSecrets()
|
|
public inline ~CSecrets()
|
public inline CSecrets()
public inline ~CSecrets()
| Members | Descriptions |
|---|---|
public std::string Name
|
|
public std::string Path
|
|
public std::string Duration
|
|
public inline CSongInfo()
|
|
public inline virtual ~CSongInfo()
|
public std::string Name
public std::string Path
public std::string Duration
public inline CSongInfo()
public inline virtual ~CSongInfo()
| Members | Descriptions |
|---|---|
public atomic< std::string > ID
|
|
public atomic< std::string > Username
|
|
public atomic< std::string > Discriminator
|
|
public atomic< std::string > Avatar
|
|
public std::atomic< bool > Bot
|
|
public std::atomic< bool > System
|
|
public std::atomic< bool > MFAEnabled
|
|
public atomic< std::string > Locale
|
|
public std::atomic< bool > Verified
|
|
public atomic< std::string > Email
|
|
public UserFlags Flags
|
|
public PremiumTypes PremiumType
|
|
public UserFlags PublicFlags
|
|
public Activity Game
|
|
public OnlineState State
|
|
public OnlineState Desktop
|
|
public OnlineState Mobile
|
|
public OnlineState Web
|
|
public atomic< std::vector< Activity > > Activities
|
|
public inline CUser()
|
|
public inline ~CUser()
|
public atomic< std::string > Discriminator
public std::atomic< bool > Bot
public std::atomic< bool > System
public std::atomic< bool > MFAEnabled
public std::atomic< bool > Verified
public UserFlags Flags
public PremiumTypes PremiumType
public UserFlags PublicFlags
public Activity Game
public OnlineState State
public OnlineState Desktop
public OnlineState Mobile
public OnlineState Web
public atomic< std::vector< Activity > > Activities
public inline CUser()
public inline ~CUser()
| Members | Descriptions |
|---|---|
public Guild GuildRef
|
|
public Channel ChannelRef
|
|
public User UserRef
|
|
public atomic< std::string > SessionID
|
|
public std::atomic< bool > Deaf
|
|
public std::atomic< bool > Mute
|
|
public std::atomic< bool > SelfDeaf
|
|
public std::atomic< bool > SelfMute
|
|
public std::atomic< bool > SelfStream
|
|
public std::atomic< bool > Supress
|
|
public inline CVoiceState()
|
|
public inline ~CVoiceState()
|
public Guild GuildRef
public Channel ChannelRef
public User UserRef
public std::atomic< bool > Deaf
public std::atomic< bool > Mute
public std::atomic< bool > SelfDeaf
public std::atomic< bool > SelfMute
public std::atomic< bool > SelfStream
public std::atomic< bool > Supress
public inline CVoiceState()
public inline ~CVoiceState()
| Members | Descriptions |
|---|---|
public inline IAction(ActionType Type)
|
|
public inline ActionType GetTypes() const
|
|
public virtual ~IAction() = default
|
public inline IAction(ActionType Type)
public inline ActionType GetTypes() const
public virtual ~IAction() = default
Interface for voice connections.
| Members | Descriptions |
|---|---|
public inline IAudioSource()
|
|
public uint32_t OnRead(uint16_t * Buf,uint32_t Samples)
|
Called if more audio data is needed. |
public inline ~IAudioSource()
|
public inline IAudioSource()
public uint32_t OnRead(uint16_t * Buf,uint32_t Samples)
Called if more audio data is needed.
-
BufBuffer to fill. -
SamplesSamples per channel. The complete buffer size if Samples * Channelcount. The channel count used by this library is 2.
The audio samplerate must 48000 Hz and stereo.
Must return the filled samples. If the return value is smaller than the Samples parameter, the playback is stopped after sending.
public inline ~IAudioSource()
Interface to handle commands.
| Members | Descriptions |
|---|---|
public ICommand() = default
|
|
public void OnExecute(CommandContext Context)
|
Called by the controller if a command with is associated with this instance, is called. |
public virtual ~ICommand() = default
|
|
protected void RegisterCommandHandler(const std::string & Cmd,OnExecuteCommand call)
|
Registers a new command handler function. |
typedef OnExecuteCommand
|
public ICommand() = default
public void OnExecute(CommandContext Context)
Called by the controller if a command with is associated with this instance, is called.
public virtual ~ICommand() = default
protected void RegisterCommandHandler(const std::string & Cmd,OnExecuteCommand call)
Registers a new command handler function.
-
cmdCommand name. -
callMethod to call.
typedef OnExecuteCommand
| Members | Descriptions |
|---|---|
public inline ICommandsConfig()
|
|
public void AddRoles(const std::string & Guild,const std::string & Command,const std::vector< std::string > & Roles)
|
Adds roles to a given command for a given server. |
public std::vector< std::string > GetRoles(const std::string & Guild,const std::string & Command)
|
#### Returns |
public void DeleteCommand(const std::string & Guild,const std::string & Command)
|
Deletes the config for a given command on a given server. |
public void RemoveRoles(const std::string & Guild,const std::string & Command,const std::vector< std::string > & Roles)
|
Removes given roles of a command. |
public void ChangePrefix(const std::string & Guild,const std::string & Prefix)
|
Changes the prefix for a given guild. |
public void RemovePrefix(const std::string & Guild)
|
Removes a prefix from a guild. |
public std::string GetPrefix(const std::string & Guild,const std::string & Default)
|
#### Returns |
public inline virtual ~ICommandsConfig()
|
public inline ICommandsConfig()
public void AddRoles(const std::string & Guild,const std::string & Command,const std::vector< std::string > & Roles)
Adds roles to a given command for a given server.
-
GuildServer to save the config for. -
CommandCommand name. e.g. 'h' -
RolesList of roles to apply to the command. Only users with these roles can access the command.
public std::vector< std::string > GetRoles(const std::string & Guild,const std::string & Command)
Returns a list of a command for a given guild.
public void DeleteCommand(const std::string & Guild,const std::string & Command)
Deletes the config for a given command on a given server.
public void RemoveRoles(const std::string & Guild,const std::string & Command,const std::vector< std::string > & Roles)
Removes given roles of a command.
public void ChangePrefix(const std::string & Guild,const std::string & Prefix)
Changes the prefix for a given guild.
public void RemovePrefix(const std::string & Guild)
Removes a prefix from a guild.
public std::string GetPrefix(const std::string & Guild,const std::string & Default)
Returns the guild prefix or the default prefix.
public inline virtual ~ICommandsConfig()
Controller interface which receives events from the client.
All callbacks can called from different threads.
| Members | Descriptions |
|---|---|
public IController(IDiscordClient * client)
|
|
public inline virtual void OnReady()
|
Called if the handshake with discord is finished. |
public inline virtual void OnVoiceStateUpdate(Guild guild,GuildMember Member)
|
Called if the voice state of a guild member updates. Eg. move, connect, disconnect. |
public inline virtual void OnMemberAdd(Guild guild,GuildMember Member)
|
Called if a guild member joins. |
public inline virtual void OnMemberUpdate(Guild guild,GuildMember Member)
|
Called if a guild member updates. E.g. Nick, premium support, roles. |
public inline virtual void OnMemberRemove(Guild guild,GuildMember Member)
|
Called if a guild member leaves a guild. E.g. Ban, kick, leave. |
public inline virtual void OnPresenceUpdate(Guild guild,GuildMember Member)
|
Called if a user changes his activity state or online state. |
public void OnMessage(Message msg)
|
Called if a new message was sended. Process the message and call associated commands. |
public inline virtual void OnMessageEdited(Message msg)
|
Called if a message is updated. |
public inline virtual void OnMessageDeleted(Message msg)
|
Called if a message is deleted. |
public inline virtual void OnGuildAvailable(Guild guild)
|
Called if a guild becomes available, either after OnReady or if a guild becomes available again. |
public inline virtual void OnGuildJoin(Guild guild)
|
Called if the bot joins a new guild. |
public inline virtual void OnGuildUnavailable(Guild guild)
|
Called if a guild becomes unavailable. |
public inline virtual void OnGuildLeave(Guild guild)
|
Called if the bot leaves a guild. |
public inline virtual void OnEndSpeaking(Guild guild)
|
Called if a audio source finished playing. |
public inline virtual void OnResume()
|
Called if the client resumes the session with discord. |
public inline virtual void OnDisconnect()
|
Called if the bot lose the connection to discord or when the bot quits. |
public inline virtual void OnQuit()
|
Called if. |
public inline std::string GetPrefix()
|
#### Returns |
public std::string GetPrefix(Guild g)
|
#### Returns |
public inline CommandsConfig GetCmdConfig()
|
#### Returns |
public inline bool CommandExists(const std::string & Cmd)
|
|
public inline AccessMode GetAccessMode(const std::string & Cmd)
|
|
public std::vector< SCommandDescription>GetCommands(Guild guild,GuildMember member)
|
#### Returns |
public virtual ~IController() = default
|
|
protected IDiscordClient*Client
|
|
protected std::string Prefix
|
Default command prefix. |
protected CommandsConfig CmdsConfig
|
Member to save and load the config for the different commands. |
protected template<> inline void RegisterCommand(SCommandDescription Desc,Args ... args)
|
|
protected inline virtual void OnMessage(Message msg,bool & Handled)
|
Called if a new message was sended. |
public IController(IDiscordClient * client)
public inline virtual void OnReady()
Called if the handshake with discord is finished.
public inline virtual void OnVoiceStateUpdate(Guild guild,GuildMember Member)
Called if the voice state of a guild member updates. Eg. move, connect, disconnect.
-
guildGuild which contains the member -
MemberMember which voice states has been updated.
The GUILD_VOICE_STATES intent needs to be set to receive this event. This intent is set by default.
See also: Intent
public inline virtual void OnMemberAdd(Guild guild,GuildMember Member)
Called if a guild member joins.
-
guildGuild which contains the member -
MemberMember which has been join.
The GUILD_MEMBERS intent needs to be set to receive this event. Also you must activate "Server Members Intent" under the bot section of your Discord Application (Website).This intent is set by default.
See also: Intent
public inline virtual void OnMemberUpdate(Guild guild,GuildMember Member)
Called if a guild member updates. E.g. Nick, premium support, roles.
-
guildGuild which contains the member -
MemberMember which has been updated.
The GUILD_MEMBERS intent needs to be set to receive this event. Also you must activate "Server Members Intent" under the bot section of your Discord Application (Website).This intent is set by default.
See also: Intent
public inline virtual void OnMemberRemove(Guild guild,GuildMember Member)
Called if a guild member leaves a guild. E.g. Ban, kick, leave.
-
guildGuild which had contains the member -
MemberMember which leaves
The GUILD_MEMBERS Also you must activate "Server Members Intent" under the bot section of your Discord Application (Website).This intent is set by default.
See also: Intent
public inline virtual void OnPresenceUpdate(Guild guild,GuildMember Member)
Called if a user changes his activity state or online state.
-
guildGuild which had contains the member -
MemberMember which updates
The GUILD_PRESENCES intent needs to be set to receive this event. Please visit this website to use this intent.
public void OnMessage(Message msg)
Called if a new message was sended. Process the message and call associated commands.
Integrated help command "Prefix h" or "Prefix help".
-
msgMessage object.
See also: CMessage for more informations.
The GUILD_MESSAGES intent needs to be set to receive this event. This intent is set by default.
See also: Intent
public inline virtual void OnMessageEdited(Message msg)
Called if a message is updated.
-
msgMessage object which contains the update data.
The GUILD_MESSAGES intent needs to be set to receive this event. This intent is set by default.
See also: Intent
public inline virtual void OnMessageDeleted(Message msg)
Called if a message is deleted.
-
msgPartial message object which contains the message id, guild and channel.
The GUILD_MESSAGES intent needs to be set to receive this event. This intent is set by default.
See also: Intent
public inline virtual void OnGuildAvailable(Guild guild)
Called if a guild becomes available, either after OnReady or if a guild becomes available again.
-
guildGuild which comes available.
public inline virtual void OnGuildJoin(Guild guild)
Called if the bot joins a new guild.
-
guildThe joined guild.
public inline virtual void OnGuildUnavailable(Guild guild)
Called if a guild becomes unavailable.
-
guildGuild which comes unavailable.
public inline virtual void OnGuildLeave(Guild guild)
Called if the bot leaves a guild.
-
guildThe leaved guild.
public inline virtual void OnEndSpeaking(Guild guild)
Called if a audio source finished playing.
-
guildGuild where the audio source finished.
public inline virtual void OnResume()
Called if the client resumes the session with discord.
public inline virtual void OnDisconnect()
Called if the bot lose the connection to discord or when the bot quits.
public inline virtual void OnQuit()
Called if.
See also: IDiscordClient::Quit() is called.
In some situations the Quit() method is called internally from the client. This occurs if there is a huge error.
public inline std::string GetPrefix()
Gets the command prefix.
public std::string GetPrefix(Guild g)
Gets the prefix for a given guild or the default prefix, if no ones is configured.
public inline CommandsConfig GetCmdConfig()
Gets the commands config.
public inline bool CommandExists(const std::string & Cmd)
public inline AccessMode GetAccessMode(const std::string & Cmd)
public std::vector< SCommandDescription>GetCommands(Guild guild,GuildMember member)
Gets all commands for a member. Only commands which the member can execute will be return.
public virtual ~IController() = default
protected IDiscordClient*Client
protected std::string Prefix
Default command prefix.
protected CommandsConfig CmdsConfig
Member to save and load the config for the different commands.
See also: ICommandsConfig for more informations
protected template<>
inline void RegisterCommand(SCommandDescription Desc,Args ... args)
protected inline virtual void OnMessage(Message msg,bool & Handled)
Called if a new message was sended.
-
msgMessage object.
See also: CMessage for more informations.
-
HandledSet to true if no command which is associated with the message should called.
| Members | Descriptions |
|---|---|
public inline IDiscordClient()
|
|
public template<> inline void RegisterController(Args &&... args)
|
Registers a controller for this client. This controller receives all events of the client. |
public template<> inline void RegisterMusicQueue(Args &&... args)
|
Registers a music queue template for this client. This queue type will created for each connected voice server and handles the audio. |
public inline Controller GetCurrentController()
|
#### Returns |
public void SetState(OnlineState state)
|
Sets the online status of the bot. |
public void SetAFK(bool AFK)
|
Sets the bot AFK. |
public void SetActivity(const std::string & Text,const std::string & URL)
|
Sets the "Playing" status text or sets the bot in streaming mode. |
public void AddToQueue(Guild guild,SongInfo Info)
|
Adds a song to the music queue. |
public bool StartSpeaking(Channel channel)
|
Connects to the given channel and uses the queue to speak. |
public bool StartSpeaking(Channel channel,AudioSource source)
|
Connects to the given channel and uses the source to speak. |
public void PauseSpeaking(Guild guild)
|
Pauses the audio source. |
public void ResumeSpeaking(Guild guild)
|
Resumes the audio source. |
public void StopSpeaking(Guild guild)
|
Stops the audio source. |
public void RemoveSong(Channel channel,size_t Index)
|
Removes a song from the queue by its index. |
public void RemoveSong(Channel channel,const std::string & Name)
|
Removes a song from the queue by its title or part of the title. |
public void Join(Channel channel)
|
Joins a audio channel. |
public void Leave(Guild guild)
|
Leaves the audio channel. |
public void SendMessage(Channel channel,const std::string Text,Embed embed,bool TTS)
|
Sends a message to a given channel. |
public void SendMessage(User user,const std::string Text,Embed embed,bool TTS)
|
Sends a message to a given user. |
public AudioSource GetAudioSource(Guild guild)
|
#### Returns |
public MusicQueue GetMusicQueue(Guild guild)
|
#### Returns |
public bool IsPlaying(Guild guild)
|
#### Returns |
public void Run()
|
Runs the bot. The call returns if you calls Quit(). |
public void Quit()
|
Quits the bot. And disconnects all voice states. |
public void QuitAsync()
|
Same as Quit() but as asynchronous call. Internally Quit() is called. |
public User GetBotUser()
|
#### Returns |
public GuildMember GetBotMember(Guild guild)
|
#### Returns |
public Guilds GetGuilds()
|
#### Returns |
public Guild GetGuild(const std::string & GID)
|
#### Returns |
public GuildAdmin GetAdminInterface(Guild g)
|
#### Returns |
public Users GetUsers()
|
#### Returns |
public inline virtual ~IDiscordClient()
|
|
protected Controller m_Controller
|
|
protected Factory m_QueueFactory
|
public inline IDiscordClient()
public template<>
inline void RegisterController(Args &&... args)
Registers a controller for this client. This controller receives all events of the client.
See also: IController for more informations.
-
TDerived class of IController -
...ArgsArguments which are passed to the constructer of the controller.
public template<>
inline void RegisterMusicQueue(Args &&... args)
Registers a music queue template for this client. This queue type will created for each connected voice server and handles the audio.
-
TDerived class of IMusicQueue -
...ArgsArguments which are passed to the constructer of the music queue.
public inline Controller GetCurrentController()
Gets the controller which is associated with the client.
public void SetState(OnlineState state)
Sets the online status of the bot.
-
stateOnline state of the bot.
See also: State.
public void SetAFK(bool AFK)
Sets the bot AFK.
-
AFKTrue if the bot is afk.
public void SetActivity(const std::string & Text,const std::string & URL)
Sets the "Playing" status text or sets the bot in streaming mode.
-
TextThe text after "Playing" -
URL[Optional] A url to twitch or youtube, if this url is set the bot "Streams" on these platforms.
public void AddToQueue(Guild guild,SongInfo Info)
Adds a song to the music queue.
-
guildThe guild which is associated with the queue. -
InfoSong informations.
public bool StartSpeaking(Channel channel)
Connects to the given channel and uses the queue to speak.
-
channelThe voice channel to connect to.
Returns true if the connection succeeded.
public bool StartSpeaking(Channel channel,AudioSource source)
Connects to the given channel and uses the source to speak.
-
channelThe voice channel to connect to. -
sourceThe audio source for speaking.
Returns true if the connection succeeded.
public void PauseSpeaking(Guild guild)
Pauses the audio source.
See also: ResumeSpeaking to continue streaming.
-
guildThe guild to pause.
public void ResumeSpeaking(Guild guild)
Resumes the audio source.
-
guildThe guild to resume.
public void StopSpeaking(Guild guild)
Stops the audio source.
-
guildThe guild to stop.
public void RemoveSong(Channel channel,size_t Index)
Removes a song from the queue by its index.
public void RemoveSong(Channel channel,const std::string & Name)
Removes a song from the queue by its title or part of the title.
public void Join(Channel channel)
Joins a audio channel.
-
channelThe voice channel to join.
public void Leave(Guild guild)
Leaves the audio channel.
-
guildThe guild to leave the voice channel.
public void SendMessage(Channel channel,const std::string Text,Embed embed,bool TTS)
Sends a message to a given channel.
-
channelText channel which will receive the message. -
TextText to send; -
TTSTrue to enable tts.
public void SendMessage(User user,const std::string Text,Embed embed,bool TTS)
Sends a message to a given user.
-
userUserwhich will receive the message. -
TextText to send; -
TTSTrue to enable tts.
public AudioSource GetAudioSource(Guild guild)
Returns the audio source for the given guild. Null if there is no audio source available.
public MusicQueue GetMusicQueue(Guild guild)
Returns the music queue for the given guild. Null if there is no music queue available.
public bool IsPlaying(Guild guild)
Returns true if a audio source is playing in the given guild.
public void Run()
Runs the bot. The call returns if you calls Quit().
See also: Quit()
public void Quit()
Quits the bot. And disconnects all voice states.
public void QuitAsync()
Same as Quit() but as asynchronous call. Internally Quit() is called.
See also: Quit()
public User GetBotUser()
Gets the bot user.
public GuildMember GetBotMember(Guild guild)
Gets the bot guild member of a given guild.
public Guilds GetGuilds()
Gets the list of all connected servers.
public Guild GetGuild(const std::string & GID)
Gets a guild object by its id or null.
public GuildAdmin GetAdminInterface(Guild g)
Gets the administrator interface for a given guild. Or null if g is null.
public Users GetUsers()
Gets a list of all users.
public inline virtual ~IDiscordClient()
protected Controller m_Controller
protected Factory m_QueueFactory
| Members | Descriptions |
|---|---|
public inline IFactory()
|
|
public std::shared_ptr< Base > Create()
|
|
public inline ~IFactory()
|
public inline IFactory()
public std::shared_ptr< Base > Create()
public inline ~IFactory()
This interface covers all function where you need special rights on a server.
| Members | Descriptions |
|---|---|
public IGuildAdmin() = default
|
|
public void ModifyMember(const CModifyMember & mod)
|
Modifies a member. |
public void BanMember(User member,const std::string & Reason,int DeleteMsgDays)
|
Bans a member from the guild. |
public void UnbanMember(User user)
|
Unbans a user. |
public std::vector< std::pair< std::string, User > > GetGuildBans()
|
> The bot needs following permission BAN_MEMBERS
|
public void KickMember(User member)
|
Kicks a member from the guild. |
public void CreateChannel(const CModifyChannel & channel)
|
Create a new channel. |
public void ModifyChannel(const CModifyChannel & channel)
|
Modifies a channel. |
public void DeleteChannel(Channel channel,const std::string & reason)
|
Deletes a channel. |
public void AddChannelAction(Channel channel,Action action)
|
Add an action to a channel which is triggered, if a given event occured. |
public void RemoveChannelAction(Channel channel,ActionType types)
|
Removes an action from a channel. |
public virtual ~IGuildAdmin() = default
|
public IGuildAdmin() = default
public void ModifyMember(const CModifyMember & mod)
Modifies a member.
-
modModification object.
The bot needs some permissions which you can find inside the ::CModifyMember class.
-
[CDiscordClientException](#class_discord_bot_1_1_c_discord_client_exception)on error.
public void BanMember(User member,const std::string & Reason,int DeleteMsgDays)
Bans a member from the guild.
-
memberMember to ban. -
ReasonBan reason. -
DeleteMsgDaysDeletes all messages of the banned user. (0 - 7 are valid values. -1 ignores the value.)
The bot needs following permission
BAN_MEMBERS
-
[CDiscordClientException](#class_discord_bot_1_1_c_discord_client_exception)on error.
public void UnbanMember(User user)
Unbans a user.
-
guildThe guild were the user is banned. -
userUser which is banned.
The bot needs following permission
BAN_MEMBERS
-
[CDiscordClientException](#class_discord_bot_1_1_c_discord_client_exception)on error.
public std::vector< std::pair< std::string, User > > GetGuildBans()
The bot needs following permission
BAN_MEMBERS
Returns a list of banned users of a guild. (ret.first = reason, ret.second = user)
public void KickMember(User member)
Kicks a member from the guild.
-
memberMember to kick.
The bot needs following permission
KICK_MEMBERS
public void CreateChannel(const CModifyChannel & channel)
Create a new channel.
-
channelChannel informations.
The bot needs following permission
MANAGE_CHANNELS
-
[CDiscordClientException](#class_discord_bot_1_1_c_discord_client_exception)on error.
public void ModifyChannel(const CModifyChannel & channel)
Modifies a channel.
-
channelChannel informations.
The bot needs following permission
MANAGE_CHANNELS
-
[CDiscordClientException](#class_discord_bot_1_1_c_discord_client_exception)on error.
public void DeleteChannel(Channel channel,const std::string & reason)
Deletes a channel.
-
channelChannel to delete.
This can't be undone.
The bot needs following permission
MANAGE_CHANNELS
-
[CDiscordClientException](#class_discord_bot_1_1_c_discord_client_exception)on error.
public void AddChannelAction(Channel channel,Action action)
Add an action to a channel which is triggered, if a given event occured.
-
channelChannel to add the action to or null for all channels. -
actionAction which is triggered.
-
[CDiscordClientException](#class_discord_bot_1_1_c_discord_client_exception)on error.
public void RemoveChannelAction(Channel channel,ActionType types)
Removes an action from a channel.
-
channelChannel to remove the action from or null. -
typesAction types to remove
public virtual ~IGuildAdmin() = default
Thread safe music queue interface.
| Members | Descriptions |
|---|---|
public inline IMusicQueue()
|
|
public virtual void AddSong(SongInfo Info)
|
Adds a song to the queue. Calls OnUpdate after the song is added. Called from the client. |
public virtual void RemoveSong(size_t Index)
|
Removes a song at a given index. Calls OnRemove after removing the song. |
public virtual void RemoveSong(std::string Name)
|
Removes a song with a given name. Calls OnRemove after removing the song. |
public virtual void ClearQueue()
|
Called if the queue finished playing. Calls OnRemove for each element. |
public virtual AudioSource Next()
|
#### Returns |
public bool HasNext()
|
#### Returns |
public inline bool NeedWait()
|
Returns true if a song is not ready. |
public inline void SetGuildID(const std::string & ID)
|
|
public inline void SetOnWaitFinishCallback(OnWaitFinish Call)
|
Called by the client to the on wait finish callback. |
public inline virtual ~IMusicQueue()
|
|
protected SongInfo GetSong(size_t Index)
|
#### Returns |
protected size_t GetQueueIndex()
|
#### Returns |
protected size_t GetQueueSize()
|
#### Returns |
protected void WaitFinished()
|
Should called after Wait, if the song becomes ready. Calls OnNext. |
protected void WaitFailed()
|
Should called after Wait, if the song becomes not ready. Calls indirect Next. |
protected inline virtual void OnUpdate(SongInfo Info,size_t Index)
|
Called after adding songs to the queue. |
protected inline virtual void OnRemove(SongInfo Info,size_t Index)
|
Called after removing a song from the queue. |
protected inline virtual void OnFinishPlaying(SongInfo Info)
|
Called if the song is finished playing. |
protected AudioSource OnNext(SongInfo Info)
|
Called by Next, if a audiosource if needed. |
public inline IMusicQueue()
public virtual void AddSong(SongInfo Info)
Adds a song to the queue. Calls OnUpdate after the song is added. Called from the client.
-
InfoThe new song to insert.
public virtual void RemoveSong(size_t Index)
Removes a song at a given index. Calls OnRemove after removing the song.
-
IndexThe song index to remove.
public virtual void RemoveSong(std::string Name)
Removes a song with a given name. Calls OnRemove after removing the song.
-
NameName or part of the name to remove.
public virtual void ClearQueue()
Called if the queue finished playing. Calls OnRemove for each element.
public virtual AudioSource Next()
Returns a audio source for the next song. If a song is not ready call Wait and return null.
public bool HasNext()
Returns true if there is a next song.
public inline bool NeedWait()
Returns true if a song is not ready.
public inline void SetGuildID(const std::string & ID)
public inline void SetOnWaitFinishCallback(OnWaitFinish Call)
Called by the client to the on wait finish callback.
public inline virtual ~IMusicQueue()
protected SongInfo GetSong(size_t Index)
Gets the song at a given index. Returns null if the index is out of bounds.
protected size_t GetQueueIndex()
Gets the current queue index.
protected size_t GetQueueSize()
Gets the current queue size.
protected void WaitFinished()
Should called after Wait, if the song becomes ready. Calls OnNext.
protected void WaitFailed()
Should called after Wait, if the song becomes not ready. Calls indirect Next.
protected inline virtual void OnUpdate(SongInfo Info,size_t Index)
Called after adding songs to the queue.
-
InfoSong which was added. -
IndexIndex inside the queue.
protected inline virtual void OnRemove(SongInfo Info,size_t Index)
Called after removing a song from the queue.
-
InfoSong which was removed. -
IndexOld index inside the queue.
protected inline virtual void OnFinishPlaying(SongInfo Info)
Called if the song is finished playing.
-
InfoSong which finished playing.
protected AudioSource OnNext(SongInfo Info)
Called by Next, if a audiosource if needed.
-
InfoSong to play.
Returns a new audio source to play or null if the song isn't ready.
Describes the command.
| Members | Descriptions |
|---|---|
public std::string Cmd
|
Command name. |
public std::string Description
|
Command description. Shows in the help dialog. |
public int ParamCount
|
Expected parameter count. |
public std::string ParamDelimiter
|
Delimiter for multiple parameters. |
public AccessMode Mode
|
Access mode for this command. This is the default mode for a new server. The owner can access all commands. |
public std::string Cmd
Command name.
public std::string Description
Command description. Shows in the help dialog.
public int ParamCount
Expected parameter count.
public std::string ParamDelimiter
Delimiter for multiple parameters.
public AccessMode Mode
Access mode for this command. This is the default mode for a new server. The owner can access all commands.
See also: AccessMode
| Members | Descriptions |
|---|---|
public MentionTypes Type
|
|
public std::string ID
|
public MentionTypes Type
public std::string ID
| Members | Descriptions |
|---|
| Members | Descriptions |
|---|---|
typedef Seq
|
typedef Seq
| Members | Descriptions |
|---|---|
public inline locked_ref(std::recursive_mutex & lock,T * ref)
|
|
public inline T * operator->()
|
|
public inline ~locked_ref()
|
public inline locked_ref(std::recursive_mutex & lock,T * ref)
public inline T * operator->()
public inline ~locked_ref()
| Members | Descriptions |
|---|
Generated by Moxygen