-
Notifications
You must be signed in to change notification settings - Fork 3
API Documentation
| Members | Descriptions |
|---|---|
namespace DiscordBot
|
|
struct DiscordBot::CFactory::gen
|
|
struct DiscordBot::CFactory::gen< 0, S... >
|
|
struct DiscordBot::CFactory::seq
|
| Members | Descriptions |
|---|---|
enum AccessMode
|
Access modes for commands. |
enum Intent
|
|
enum ActivityType
|
|
enum ActivityFlags
|
|
enum ChannelTypes
|
|
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 ActivityFlags operator|(ActivityFlags lhs,ActivityFlags rhs)
|
|
public inline Permission operator|(Permission lhs,Permission rhs)
|
|
public inline Permission operator&(Permission lhs,Permission rhs)
|
|
class DiscordBot::CActivity
|
|
class DiscordBot::CChannel
|
|
class DiscordBot::CCommandContext
|
Contains all informations about a command which was sended. |
class DiscordBot::CEmbed
|
|
class DiscordBot::CFactory
|
|
class DiscordBot::CGuild
|
|
class DiscordBot::CGuildMember
|
|
class DiscordBot::CMessage
|
|
class DiscordBot::CParty
|
|
class DiscordBot::CPermissionOverwrites
|
|
class DiscordBot::CRole
|
|
class DiscordBot::CSecrets
|
|
class DiscordBot::CSongInfo
|
|
class DiscordBot::CUser
|
|
class DiscordBot::CVoiceState
|
|
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::IMusicQueue
|
Thread safe music queue interface. |
struct DiscordBot::SCommandDescription
|
Describes the command. |
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 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 |
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 ActivityFlags operator|(ActivityFlags lhs,ActivityFlags rhs)
public inline Permission operator|(Permission lhs,Permission rhs)
public inline Permission operator&(Permission lhs,Permission rhs)
| Members | Descriptions |
|---|---|
public std::string Name
|
|
public ActivityType Type
|
|
public std::string URL
|
|
public int CreatedAt
|
|
public int StartTime
|
|
public int EndTime
|
|
public std::string AppID
|
|
public std::string Details
|
|
public std::string State
|
|
public Party PartyObject
|
|
public Secrets Secret
|
|
public bool Instance
|
|
public ActivityFlags Flags
|
|
public inline CActivity()
|
|
public inline ~CActivity()
|
public std::string Name
public ActivityType Type
public std::string URL
public int CreatedAt
public int StartTime
public int EndTime
public std::string AppID
public std::string Details
public std::string State
public Party PartyObject
public Secrets Secret
public bool Instance
public ActivityFlags Flags
public inline CActivity()
public inline ~CActivity()
| Members | Descriptions |
|---|---|
public std::string ID
|
|
public ChannelTypes Type
|
|
public std::string GuildID
|
|
public int Position
|
|
public std::vector< PermissionOverwrites > Overwrites
|
|
public std::string Name
|
|
public std::string Topic
|
|
public bool NSFW
|
|
public std::string LastMessageID
|
|
public int Bitrate
|
|
public int UserLimit
|
|
public int RateLimit
|
|
public std::vector< User > Recipients
|
|
public std::string Icon
|
|
public std::string OwnerID
|
|
public std::string AppID
|
|
public std::string ParentID
|
|
public std::string LastPinTimestamp
|
|
public inline CChannel()
|
|
public inline ~CChannel()
|
public std::string ID
public ChannelTypes Type
public std::string GuildID
public int Position
public std::vector< PermissionOverwrites > Overwrites
public std::string Name
public std::string Topic
public bool NSFW
public std::string LastMessageID
public int Bitrate
public int UserLimit
public int RateLimit
public std::vector< User > Recipients
public std::string Icon
public std::string OwnerID
public std::string AppID
public std::string ParentID
public 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
| Members | Descriptions |
|---|---|
public std::string Title
|
|
public std::string Description
|
|
public std::string Type
|
|
public std::string URL
|
|
public inline CEmbed()
|
|
public inline ~CEmbed()
|
public std::string Title
public std::string Description
public std::string Type
public std::string URL
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 std::string ID
|
|
public std::string Name
|
|
public std::string Icon
|
|
public GuildMember Owner
|
|
public std::map< std::string, GuildMember > Members
|
|
public std::map< std::string, Channel > Channels
|
|
public std::map< std::string, Role > Roles
|
|
public inline CGuild()
|
|
public inline ~CGuild()
|
public std::string ID
public std::string Name
public std::string Icon
public GuildMember Owner
public std::map< std::string, GuildMember > Members
public std::map< std::string, Channel > Channels
public std::map< std::string, Role > Roles
public inline CGuild()
public inline ~CGuild()
| Members | Descriptions |
|---|---|
public User UserRef
|
|
public std::string Nick
|
|
public std::vector< Role > Roles
|
|
public std::string JoinedAt
|
|
public std::string PremiumSince
|
|
public bool Deaf
|
|
public bool Mute
|
|
public VoiceState State
|
|
public inline CGuildMember()
|
|
public inline ~CGuildMember()
|
public User UserRef
public std::string Nick
public std::vector< Role > Roles
public std::string JoinedAt
public std::string PremiumSince
public bool Deaf
public 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 inline CMessage()
|
|
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 inline CMessage()
public inline ~CMessage()
| Members | Descriptions |
|---|---|
public std::string ID
|
|
public std::vector< int > Size
|
|
public inline CParty()
|
|
public inline ~CParty()
|
public std::string ID
public std::vector< int > Size
public inline CParty()
public inline ~CParty()
| Members | Descriptions |
|---|---|
public std::string ID
|
User or role id. |
public std::string Type
|
role or user |
public Permission Allow
|
|
public Permission Deny
|
|
public inline CPermissionOverwrites()
|
|
public inline ~CPermissionOverwrites()
|
public std::string ID
User or role id.
public std::string Type
role or user
public Permission Allow
public Permission Deny
public inline CPermissionOverwrites()
public inline ~CPermissionOverwrites()
| Members | Descriptions |
|---|---|
public std::string ID
|
|
public std::string Name
|
|
public uint32_t Color
|
|
public bool Hoist
|
|
public int Position
|
|
public Permission Permissions
|
|
public bool Managed
|
|
public bool Mentionable
|
|
public inline CRole()
|
|
public inline ~CRole()
|
public std::string ID
public std::string Name
public uint32_t Color
public bool Hoist
public int Position
public Permission Permissions
public bool Managed
public bool Mentionable
public inline CRole()
public inline ~CRole()
| Members | Descriptions |
|---|---|
public std::string Join
|
|
public std::string Spectate
|
|
public std::string Match
|
|
public inline CSecrets()
|
|
public inline ~CSecrets()
|
public std::string Join
public std::string Spectate
public std::string Match
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 std::string ID
|
|
public std::string Username
|
|
public std::string Discriminator
|
|
public std::string Avatar
|
|
public bool Bot
|
|
public bool System
|
|
public bool MFAEnabled
|
|
public std::string Locale
|
|
public bool Verified
|
|
public 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 std::vector< Activity > Activities
|
|
public inline CUser()
|
|
public inline ~CUser()
|
public std::string ID
public std::string Username
public std::string Discriminator
public std::string Avatar
public bool Bot
public bool System
public bool MFAEnabled
public std::string Locale
public bool Verified
public 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 std::vector< Activity > Activities
public inline CUser()
public inline ~CUser()
| Members | Descriptions |
|---|---|
public Guild GuildRef
|
|
public Channel ChannelRef
|
|
public User UserRef
|
|
public std::string SessionID
|
|
public bool Deaf
|
|
public bool Mute
|
|
public bool SelfDeaf
|
|
public bool SelfMute
|
|
public bool SelfStream
|
|
public bool Supress
|
|
public inline CVoiceState()
|
|
public inline ~CVoiceState()
|
public Guild GuildRef
public Channel ChannelRef
public User UserRef
public std::string SessionID
public bool Deaf
public bool Mute
public bool SelfDeaf
public bool SelfMute
public bool SelfStream
public bool Supress
public inline CVoiceState()
public inline ~CVoiceState()
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 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 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 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 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
|
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 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 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
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 Guilds GetGuilds()
|
#### 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 Guilds GetGuilds()
Gets the list of all connected servers.
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()
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 |
|---|
| Members | Descriptions |
|---|---|
typedef Seq
|
typedef Seq
| Members | Descriptions |
|---|
Generated by Moxygen