Skip to content

API Documentation

tostc edited this page Dec 31, 2020 · 5 revisions

Summary

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

Members

define VERSION

define VERSION_MAJOR

define VERSION_MINOR

define VERSION_PATCH

namespace DiscordBot

Summary

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

Members

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
Values Descriptions
GAME
STREAMING
LISTENING
CUSTOM
Values Descriptions
INSTANCE
JOIN
SPECTATE
JOIN_REQUEST
SYNC
PLAY
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.
Values Descriptions
USER
NICKNAME
CHANNEL
ROLE
EMOJI
CUSTOM_EMOJI
CUSTOM_ANIM_EMOJI
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
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 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

Summary

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()

Members

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()

class DiscordBot::CAction

class DiscordBot::CAction
  : public DiscordBot::IAction

Summary

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

Members

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.

Parameters

  • Type Type of the action

  • c Channel which triggered this action

  • val Discord object which had triggered the channel.

Returns

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.

Parameters

  • Type Type of the action

  • c Channel which triggered this action

  • val Discord object which had triggered the channel.

public virtual ~CAction() = default

class DiscordBot::CActivity

Summary

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()

Members

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()

class DiscordBot::CChannel

Summary

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()

Members

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()

class DiscordBot::CCommandContext

Contains all informations about a command which was sended.

Summary

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

Members

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

class DiscordBot::CDiscordClientException
  : public exception

Summary

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

Members

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

class DiscordBot::CEmbed

Summary

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()

Members

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()

class DiscordBot::CFactory

class DiscordBot::CFactory
  : public DiscordBot::IFactory< Base >

Summary

Members Descriptions
public inline CFactory(Tuple Params)
public inline virtual std::shared_ptr< Base > Create()
public inline ~CFactory()

Members

public inline CFactory(Tuple Params)

public inline virtual std::shared_ptr< Base > Create()

public inline ~CFactory()

class DiscordBot::CGuild

Summary

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()

Members

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()

class DiscordBot::CGuildMember

Summary

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()

Members

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()

class DiscordBot::CMessage

Summary

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()

Members

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

Returns a list of mentions.

public inline ~CMessage()

class DiscordBot::CModifyChannel

Summary

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()

Members

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()

class DiscordBot::CModifyMember

Summary

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()

Members

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()

class DiscordBot::CParty

Summary

Members Descriptions
public atomic< std::string > ID
public atomic< std::vector< int > > Size
public inline CParty()
public inline ~CParty()

Members

public atomic< std::string > ID

public atomic< std::vector< int > > Size

public inline CParty()

public inline ~CParty()

class DiscordBot::CPermissionOverwrites

Summary

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()

Members

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()

class DiscordBot::CRole

Summary

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()

Members

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()

class DiscordBot::CSecrets

Summary

Members Descriptions
public atomic< std::string > Join
public atomic< std::string > Spectate
public atomic< std::string > Match
public inline CSecrets()
public inline ~CSecrets()

Members

public atomic< std::string > Join

public atomic< std::string > Spectate

public atomic< std::string > Match

public inline CSecrets()

public inline ~CSecrets()

class DiscordBot::CSongInfo

Summary

Members Descriptions
public std::string Name
public std::string Path
public std::string Duration
public inline CSongInfo()
public inline virtual ~CSongInfo()

Members

public std::string Name

public std::string Path

public std::string Duration

public inline CSongInfo()

public inline virtual ~CSongInfo()

class DiscordBot::CUser

Summary

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()

Members

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()

class DiscordBot::CVoiceState

Summary

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()

Members

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()

class DiscordBot::IAction

Summary

Members Descriptions
public inline IAction(ActionType Type)
public inline ActionType GetTypes() const
public virtual ~IAction() = default

Members

public inline IAction(ActionType Type)

public inline ActionType GetTypes() const

public virtual ~IAction() = default

class DiscordBot::IAudioSource

Interface for voice connections.

Summary

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()

Members

public inline IAudioSource()

public uint32_t OnRead(uint16_t * Buf,uint32_t Samples)

Called if more audio data is needed.

Parameters

  • Buf Buffer to fill.

  • Samples Samples 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.

Returns

Must return the filled samples. If the return value is smaller than the Samples parameter, the playback is stopped after sending.

public inline ~IAudioSource()

class DiscordBot::ICommand

Interface to handle commands.

Summary

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

Members

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.

Parameters

  • cmd Command name.

  • call Method to call.

class DiscordBot::ICommandsConfig

Summary

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()

Members

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.

Parameters

  • Guild Server to save the config for.

  • Command Command name. e.g. 'h'

  • Roles List 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

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

Returns the guild prefix or the default prefix.

public inline virtual ~ICommandsConfig()

class DiscordBot::IController

Controller interface which receives events from the client.

All callbacks can called from different threads.

Summary

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.

Members

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.

Parameters

  • guild Guild which contains the member

  • Member Member 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.

Parameters

  • guild Guild which contains the member

  • Member Member 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.

Parameters

  • guild Guild which contains the member

  • Member Member 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.

Parameters

  • guild Guild which had contains the member

  • Member Member 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.

Parameters

  • guild Guild which had contains the member

  • Member Member 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".

Parameters

  • msg Message 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.

Parameters

  • msg Message 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.

Parameters

  • msg Partial 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.

Parameters

  • guild Guild which comes available.

public inline virtual void OnGuildJoin(Guild guild)

Called if the bot joins a new guild.

Parameters

  • guild The joined guild.

public inline virtual void OnGuildUnavailable(Guild guild)

Called if a guild becomes unavailable.

Parameters

  • guild Guild which comes unavailable.

public inline virtual void OnGuildLeave(Guild guild)

Called if the bot leaves a guild.

Parameters

  • guild The leaved guild.

public inline virtual void OnEndSpeaking(Guild guild)

Called if a audio source finished playing.

Parameters

  • guild Guild 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()

Returns

Gets the command prefix.

public std::string GetPrefix(Guild g)

Returns

Gets the prefix for a given guild or the default prefix, if no ones is configured.

public inline CommandsConfig GetCmdConfig()

Returns

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)

Returns

Gets all commands for a member. Only commands which the member can execute will be return.

public virtual ~IController() = default

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.

Parameters

  • msg Message object.

See also: CMessage for more informations.

Parameters

  • Handled Set to true if no command which is associated with the message should called.

class DiscordBot::IDiscordClient

Summary

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

Members

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.

Parameters

  • T Derived class of IController

  • ...Args Arguments 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.

Parameters

  • T Derived class of IMusicQueue

  • ...Args Arguments which are passed to the constructer of the music queue.

public inline Controller GetCurrentController()

Returns

Gets the controller which is associated with the client.

public void SetState(OnlineState state)

Sets the online status of the bot.

Parameters

  • state Online state of the bot.

See also: State.

public void SetAFK(bool AFK)

Sets the bot AFK.

Parameters

  • AFK True 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.

Parameters

  • Text The 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.

Parameters

  • guild The guild which is associated with the queue.

  • Info Song informations.

public bool StartSpeaking(Channel channel)

Connects to the given channel and uses the queue to speak.

Parameters

  • channel The voice channel to connect to.

Returns

Returns true if the connection succeeded.

public bool StartSpeaking(Channel channel,AudioSource source)

Connects to the given channel and uses the source to speak.

Parameters

  • channel The voice channel to connect to.

  • source The audio source for speaking.

Returns

Returns true if the connection succeeded.

public void PauseSpeaking(Guild guild)

Pauses the audio source.

See also: ResumeSpeaking to continue streaming.

Parameters

  • guild The guild to pause.

public void ResumeSpeaking(Guild guild)

Resumes the audio source.

Parameters

  • guild The guild to resume.

public void StopSpeaking(Guild guild)

Stops the audio source.

Parameters

  • guild The 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.

Parameters

  • channel The voice channel to join.

public void Leave(Guild guild)

Leaves the audio channel.

Parameters

  • guild The 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.

Parameters

  • channel Text channel which will receive the message.

  • Text Text to send;

  • TTS True to enable tts.

public void SendMessage(User user,const std::string Text,Embed embed,bool TTS)

Sends a message to a given user.

Parameters

  • user Userwhich will receive the message.

  • Text Text to send;

  • TTS True to enable tts.

public AudioSource GetAudioSource(Guild guild)

Returns

Returns the audio source for the given guild. Null if there is no audio source available.

public MusicQueue GetMusicQueue(Guild guild)

Returns

Returns the music queue for the given guild. Null if there is no music queue available.

public bool IsPlaying(Guild guild)

Returns

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()

Returns

Gets the bot user.

public GuildMember GetBotMember(Guild guild)

Returns

Gets the bot guild member of a given guild.

public Guilds GetGuilds()

Returns

Gets the list of all connected servers.

public Guild GetGuild(const std::string & GID)

Returns

Gets a guild object by its id or null.

public GuildAdmin GetAdminInterface(Guild g)

Returns

Gets the administrator interface for a given guild. Or null if g is null.

public Users GetUsers()

Returns

Gets a list of all users.

public inline virtual ~IDiscordClient()

protected Controller m_Controller

protected Factory m_QueueFactory

class DiscordBot::IFactory

Summary

Members Descriptions
public inline IFactory()
public std::shared_ptr< Base > Create()
public inline ~IFactory()

Members

public inline IFactory()

public std::shared_ptr< Base > Create()

public inline ~IFactory()

class DiscordBot::IGuildAdmin

This interface covers all function where you need special rights on a server.

Summary

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

Members

public IGuildAdmin() = default

public void ModifyMember(const CModifyMember & mod)

Modifies a member.

Parameters

  • mod Modification object.

The bot needs some permissions which you can find inside the ::CModifyMember class.

Exceptions

  • [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.

Parameters

  • member Member to ban.

  • Reason Ban reason.

  • DeleteMsgDays Deletes all messages of the banned user. (0 - 7 are valid values. -1 ignores the value.)

The bot needs following permission BAN_MEMBERS

Exceptions

  • [CDiscordClientException](#class_discord_bot_1_1_c_discord_client_exception) on error.

public void UnbanMember(User user)

Unbans a user.

Parameters

  • guild The guild were the user is banned.

  • user User which is banned.

The bot needs following permission BAN_MEMBERS

Exceptions

  • [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

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.

Parameters

  • member Member to kick.

The bot needs following permission KICK_MEMBERS

public void CreateChannel(const CModifyChannel & channel)

Create a new channel.

Parameters

  • channel Channel informations.

The bot needs following permission MANAGE_CHANNELS

Exceptions

  • [CDiscordClientException](#class_discord_bot_1_1_c_discord_client_exception) on error.

public void ModifyChannel(const CModifyChannel & channel)

Modifies a channel.

Parameters

  • channel Channel informations.

The bot needs following permission MANAGE_CHANNELS

Exceptions

  • [CDiscordClientException](#class_discord_bot_1_1_c_discord_client_exception) on error.

public void DeleteChannel(Channel channel,const std::string & reason)

Deletes a channel.

Parameters

  • channel Channel to delete.

This can't be undone.

The bot needs following permission MANAGE_CHANNELS

Exceptions

  • [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.

Parameters

  • channel Channel to add the action to or null for all channels.

  • action Action which is triggered.

Exceptions

  • [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.

Parameters

  • channel Channel to remove the action from or null.

  • types Action types to remove

public virtual ~IGuildAdmin() = default

class DiscordBot::IMusicQueue

Thread safe music queue interface.

Summary

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.

Members

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.

Parameters

  • Info The new song to insert.

public virtual void RemoveSong(size_t Index)

Removes a song at a given index. Calls OnRemove after removing the song.

Parameters

  • Index The song index to remove.

public virtual void RemoveSong(std::string Name)

Removes a song with a given name. Calls OnRemove after removing the song.

Parameters

  • Name Name 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

Returns a audio source for the next song. If a song is not ready call Wait and return null.

public bool HasNext()

Returns

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)

Returns

Gets the song at a given index. Returns null if the index is out of bounds.

protected size_t GetQueueIndex()

Returns

Gets the current queue index.

protected size_t GetQueueSize()

Returns

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.

Parameters

  • Info Song which was added.

  • Index Index inside the queue.

protected inline virtual void OnRemove(SongInfo Info,size_t Index)

Called after removing a song from the queue.

Parameters

  • Info Song which was removed.

  • Index Old index inside the queue.

protected inline virtual void OnFinishPlaying(SongInfo Info)

Called if the song is finished playing.

Parameters

  • Info Song which finished playing.

protected AudioSource OnNext(SongInfo Info)

Called by Next, if a audiosource if needed.

Parameters

  • Info Song to play.

Returns

Returns a new audio source to play or null if the song isn't ready.

struct DiscordBot::SCommandDescription

Describes the command.

Summary

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.

Members

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

struct DiscordBot::SMention

Summary

Members Descriptions
public MentionTypes Type
public std::string ID

Members

public MentionTypes Type

public std::string ID

struct DiscordBot::CFactory::gen

Summary

Members Descriptions

Members

struct DiscordBot::CFactory::gen< 0, S... >

Summary

Members Descriptions
typedef Seq

Members

typedef Seq

struct DiscordBot::atomic::locked_ref

Summary

Members Descriptions
public inline locked_ref(std::recursive_mutex & lock,T * ref)
public inline T * operator->()
public inline ~locked_ref()

Members

public inline locked_ref(std::recursive_mutex & lock,T * ref)

public inline T * operator->()

public inline ~locked_ref()

struct DiscordBot::CFactory::seq

Summary

Members Descriptions

Members

Generated by Moxygen

Clone this wiki locally