Discord.C++ 0.13.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DiscordCPP::Channel Class Reference

#include <Channel.h>

Inheritance diagram for DiscordCPP::Channel:
DiscordCPP::DiscordObject DiscordCPP::TextChannel DiscordCPP::VoiceChannel DiscordCPP::DMChannel DiscordCPP::GuildChannel

Public Types

enum  Type {
  GUILD_TEXT = 0 , DM = 1 , GUILD_VOICE = 2 , GROUP_DM = 3 ,
  GUILD_CATEGORY = 4 , GUILD_NEWS = 5 , GUILD_NEWS_THREAD = 10 , GUILD_PUBLIC_THREAD = 11 ,
  GUILD_PRIVATE_THREAD = 12 , GUILD_STAGE_VOICE = 13 , GUILD_DIRECTORY = 14 , GUILD_FORUM = 15
}
 

Public Member Functions

 Channel (const json &data, const std::string &token)
 
 Channel (const std::string &id, const std::string &token)
 
 Channel (const std::string &token)
 
 Channel ()=default
 
void delete_channel ()
 Delete this channel.
 
 operator std::string ()
 
Type get_type ()
 
int32_t get_position ()
 
std::string get_name ()
 
std::string get_icon ()
 
- Public Member Functions inherited from DiscordCPP::DiscordObject
 DiscordObject ()=default
 
 DiscordObject (std::string token)
 
 DiscordObject (std::string token, std::string id)
 
std::string get_id () const
 

Additional Inherited Members

- Protected Member Functions inherited from DiscordCPP::DiscordObject
std::string get_token () const
 
json api_call (const std::string &url, const std::string &method="GET", const json &data=json(), const std::string &content_type="", const bool cache=true)
 helper function to communicate with the http api
 

Member Enumeration Documentation

◆ Type

Enumerator
GUILD_TEXT 
DM 
GUILD_VOICE 
GROUP_DM 
GUILD_CATEGORY 
GUILD_NEWS 
GUILD_NEWS_THREAD 
GUILD_PUBLIC_THREAD 
GUILD_PRIVATE_THREAD 
GUILD_STAGE_VOICE 
GUILD_DIRECTORY 
GUILD_FORUM 

Constructor & Destructor Documentation

◆ Channel() [1/4]

DiscordCPP::Channel::Channel ( const json & data,
const std::string & token )
Parameters
[in]dataJSON data
[in]tokendiscord token

◆ Channel() [2/4]

DiscordCPP::Channel::Channel ( const std::string & id,
const std::string & token )
Parameters
[in]idthe channel's id
[in]tokendiscord token

◆ Channel() [3/4]

DiscordCPP::Channel::Channel ( const std::string & token)
explicit
Parameters
[in]tokendiscord token

◆ Channel() [4/4]

DiscordCPP::Channel::Channel ( )
default

Member Function Documentation

◆ delete_channel()

void DiscordCPP::Channel::delete_channel ( )

Delete this channel.

◆ get_icon()

std::string DiscordCPP::Channel::get_icon ( )
inline
Returns
channel's icon hash

◆ get_name()

std::string DiscordCPP::Channel::get_name ( )
inline
Returns
the channel's name

◆ get_position()

int32_t DiscordCPP::Channel::get_position ( )
inline
Returns
the sorting position

◆ get_type()

Type DiscordCPP::Channel::get_type ( )
inline
Returns
the ChannelType of the channel

◆ operator std::string()

DiscordCPP::Channel::operator std::string ( )
inlineexplicit
Returns
Channelname as std::string

The documentation for this class was generated from the following files: