Discord.C++ 0.13.0
Loading...
Searching...
No Matches
DiscordCPP::Guild Class Reference

#include <Guild.h>

Inheritance diagram for DiscordCPP::Guild:
DiscordCPP::DiscordObject

Public Member Functions

 Guild (Discord *client, const json &data, const std::string &token)
 
 Guild (Discord *client, const std::string &id, const std::string &token)
 
 Guild ()=default
 
 operator std::string ()
 
void leave ()
 leave this guild
 
void delete_guild ()
 delete this guild
 
void kick (const User &user)
 kicks the given User from this Guild
 
void ban (const User &user, const std::string &reason, const int delete_message_days=0)
 bans the given User from this Guild
 
void unban (const User &user)
 unbans the given User from this Guild
 
std::string get_name ()
 
std::string get_icon ()
 
std::string get_splash ()
 
std::optional< std::string > get_owner_id ()
 
std::optional< Userget_owner ()
 
int get_permissions ()
 
std::string get_region ()
 
std::optional< std::string > get_afk_channel_id ()
 
std::optional< VoiceChannelget_afk_channel ()
 
int get_afk_timeout ()
 
bool is_embed_enabled ()
 
std::optional< std::string > get_embed_channel_id ()
 
std::optional< GuildChannelget_embed_channel ()
 
int get_verification_level ()
 
int get_default_message_notifications ()
 
int get_explicit_content_filter ()
 
std::vector< std::string > get_features ()
 
int get_mfa_level ()
 
std::string get_application_id ()
 
bool is_widget_enabled ()
 
std::optional< std::string > get_widget_channel_id ()
 
std::optional< GuildChannelget_widget_channel ()
 
std::optional< std::string > get_system_channel_id ()
 
std::optional< GuildChannelget_system_channel ()
 
std::string get_joined_at ()
 
bool is_large ()
 
bool is_unavailable ()
 
int get_member_count ()
 
std::vector< Memberget_members ()
 
std::vector< ChannelVariantget_channels ()
 
- 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
 

Constructor & Destructor Documentation

◆ Guild() [1/3]

DiscordCPP::Guild::Guild ( Discord * client,
const json & data,
const std::string & token )

◆ Guild() [2/3]

DiscordCPP::Guild::Guild ( Discord * client,
const std::string & id,
const std::string & token )

◆ Guild() [3/3]

DiscordCPP::Guild::Guild ( )
default

Member Function Documentation

◆ ban()

void DiscordCPP::Guild::ban ( const User & user,
const std::string & reason,
const int delete_message_days = 0 )

bans the given User from this Guild

Parameters
[in]userUser to ban
[in]reasonreason, why the User should be banned
[in]delete_message_days(optional) number of days to delete messages from user (0-7)
Exceptions
HTTPError

◆ delete_guild()

void DiscordCPP::Guild::delete_guild ( )

delete this guild

Exceptions
HTTPError

◆ get_afk_channel()

std::optional< DiscordCPP::VoiceChannel > DiscordCPP::Guild::get_afk_channel ( )
Returns
the guild's afk channel(voice)

◆ get_afk_channel_id()

std::optional< std::string > DiscordCPP::Guild::get_afk_channel_id ( )
inline
Returns
the id of the guild's afk channel(voice)

◆ get_afk_timeout()

int DiscordCPP::Guild::get_afk_timeout ( )
inline
Returns
afk timeout in seconds

◆ get_application_id()

std::string DiscordCPP::Guild::get_application_id ( )
inline
Returns
application id of the guild creator if the guild is bot-created

◆ get_channels()

std::vector< ChannelVariant > DiscordCPP::Guild::get_channels ( )
inline
Returns
channels of the guild

◆ get_default_message_notifications()

int DiscordCPP::Guild::get_default_message_notifications ( )
inline

◆ get_embed_channel()

std::optional< DiscordCPP::GuildChannel > DiscordCPP::Guild::get_embed_channel ( )
Returns
the embedded channel

◆ get_embed_channel_id()

std::optional< std::string > DiscordCPP::Guild::get_embed_channel_id ( )
inline
Returns
the id of the embedded channel

◆ get_explicit_content_filter()

int DiscordCPP::Guild::get_explicit_content_filter ( )
inline

◆ get_features()

std::vector< std::string > DiscordCPP::Guild::get_features ( )
inline
Returns
enabled guild features

◆ get_icon()

std::string DiscordCPP::Guild::get_icon ( )
inline
Returns
the guild's icon hash

◆ get_joined_at()

std::string DiscordCPP::Guild::get_joined_at ( )
inline
Returns
when the guild was created

◆ get_member_count()

int DiscordCPP::Guild::get_member_count ( )
inline
Returns
number of members

◆ get_members()

std::vector< Member > DiscordCPP::Guild::get_members ( )
inline
Returns
users in the guild

◆ get_mfa_level()

int DiscordCPP::Guild::get_mfa_level ( )
inline
Returns
MFALevel

◆ get_name()

std::string DiscordCPP::Guild::get_name ( )
inline
Returns
the guild's name

◆ get_owner()

std::optional< DiscordCPP::User > DiscordCPP::Guild::get_owner ( )
Returns
the owner of the guild

◆ get_owner_id()

std::optional< std::string > DiscordCPP::Guild::get_owner_id ( )
inline
Returns
the id of the owner of the guild

◆ get_permissions()

int DiscordCPP::Guild::get_permissions ( )
inline
Returns
total permissions for the user(doesn't include channel overrides)

◆ get_region()

std::string DiscordCPP::Guild::get_region ( )
inline
Returns
the guild's voice redion

◆ get_splash()

std::string DiscordCPP::Guild::get_splash ( )
inline
Returns
the guild's splash hash

◆ get_system_channel()

std::optional< DiscordCPP::GuildChannel > DiscordCPP::Guild::get_system_channel ( )
Returns
the channel to which system messages are sent

◆ get_system_channel_id()

std::optional< std::string > DiscordCPP::Guild::get_system_channel_id ( )
inline
Returns
the id of the channel to which system messages are sent

◆ get_verification_level()

int DiscordCPP::Guild::get_verification_level ( )
inline
Returns
the VerificationLevel required to join the guild

◆ get_widget_channel()

std::optional< DiscordCPP::GuildChannel > DiscordCPP::Guild::get_widget_channel ( )
Returns
the channel for the server widget

◆ get_widget_channel_id()

std::optional< std::string > DiscordCPP::Guild::get_widget_channel_id ( )
inline
Returns
the id of the channel for the server widget

◆ is_embed_enabled()

bool DiscordCPP::Guild::is_embed_enabled ( )
inline
Returns
true, if the guild is embeddable

◆ is_large()

bool DiscordCPP::Guild::is_large ( )
inline
Returns
true if it is a large guild

◆ is_unavailable()

bool DiscordCPP::Guild::is_unavailable ( )
inline
Returns
true if the guild is not available

◆ is_widget_enabled()

bool DiscordCPP::Guild::is_widget_enabled ( )
inline
Returns
true if the server widget is enabled

◆ kick()

void DiscordCPP::Guild::kick ( const User & user)

kicks the given User from this Guild

Parameters
[in]userUser to kick
Exceptions
HTTPError

◆ leave()

void DiscordCPP::Guild::leave ( )

leave this guild

Exceptions
HTTPError

◆ operator std::string()

DiscordCPP::Guild::operator std::string ( )
inlineexplicit
Returns
Guild name as std::string

◆ unban()

void DiscordCPP::Guild::unban ( const User & user)

unbans the given User from this Guild

Parameters
[in]userUser to kick
Exceptions
HTTPError

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