D++ (DPP)
C++ Discord API Bot Library
dpp::guild Class Reference

Represents a guild on Discord (AKA a server) More...

#include <guild.h>

+ Inheritance diagram for dpp::guild:
+ Collaboration diagram for dpp::guild:

Public Member Functions

 guild ()
 
guildfill_from_json (class discord_client *shard, nlohmann::json *j)
 
std::string build_json (bool with_id=false) const
 
uint64_t base_permissions (const class user *member) const
 Get the base permissions for a member on this guild, before permission overwrites are applied. More...
 
uint64_t permission_overwrites (const uint64_t base_permissions, const user *member, const channel *channel) const
 Get the permission overwrites for a member merged into a bitmask. More...
 
void rehash_members ()
 Rehash members map. More...
 
bool connect_member_voice (snowflake user_id)
 Connect to a voice channel another guild member is in. More...
 
bool is_large () const
 
bool is_unavailable () const
 
bool widget_enabled () const
 
bool has_invite_splash () const
 
bool has_vip_regions () const
 
bool has_vanity_url () const
 
bool is_verified () const
 
bool is_partnered () const
 
bool is_community () const
 
bool has_commerce () const
 
bool has_news () const
 
bool is_discoverable () const
 
bool is_featureable () const
 
bool has_animated_icon () const
 
bool has_banner () const
 
bool is_welcome_screen_enabled () const
 
bool has_member_verification_gate () const
 
bool is_preview_enabled () const
 
bool has_animated_icon_hash () const
 

Public Attributes

uint16_t shard_id
 
uint32_t flags
 
std::string name
 
std::string description
 
std::string vanity_url_code
 
utility::iconhash icon
 
utility::iconhash splash
 
utility::iconhash discovery_splash
 
snowflake owner_id
 
region voice_region
 
snowflake afk_channel_id
 
uint8_t afk_timeout
 
snowflake widget_channel_id
 
uint8_t verification_level
 
uint8_t default_message_notifications
 
uint8_t explicit_content_filter
 
uint8_t mfa_level
 
snowflake application_id
 
snowflake system_channel_id
 
snowflake rules_channel_id
 
uint32_t member_count
 
utility::iconhash banner
 
uint8_t premium_tier
 
uint16_t premium_subscription_count
 
snowflake public_updates_channel_id
 
uint16_t max_video_channel_users
 
std::vector< snowflakeroles
 
std::vector< snowflakechannels
 
std::vector< snowflakethreads
 
members_container members
 
std::map< snowflake, voicestatevoice_members
 
std::vector< snowflakeemojis
 
snowflake id
 

Detailed Description

Represents a guild on Discord (AKA a server)

Constructor & Destructor Documentation

◆ guild()

dpp::guild::guild ( )

Default constructor, zeroes all values

Member Function Documentation

◆ base_permissions()

uint64_t dpp::guild::base_permissions ( const class user member) const

Get the base permissions for a member on this guild, before permission overwrites are applied.

Parameters
membermember to get permissions for
Returns
uint64_t permissions bitmask

◆ build_json()

std::string dpp::guild::build_json ( bool  with_id = false) const

Build a JSON string from this object.

Parameters
with_idTrue if an ID is to be included in the JSON

◆ connect_member_voice()

bool dpp::guild::connect_member_voice ( snowflake  user_id)

Connect to a voice channel another guild member is in.

Parameters
user_idUser id to join
Returns
True if the user specified is in a vc, false if they aren't

◆ fill_from_json()

guild & dpp::guild::fill_from_json ( class discord_client shard,
nlohmann::json j 
)

Read class values from json object

Parameters
shardoriginating shard
jA json object to read from
Returns
A reference to self

◆ has_animated_icon()

bool dpp::guild::has_animated_icon ( ) const

Guild is allowed an animated icon

◆ has_animated_icon_hash()

bool dpp::guild::has_animated_icon_hash ( ) const

Server icon is actually an animated gif

◆ has_banner()

bool dpp::guild::has_banner ( ) const

Guild has a banner image

◆ has_commerce()

bool dpp::guild::has_commerce ( ) const

Guild has enabled commerce channels

◆ has_invite_splash()

bool dpp::guild::has_invite_splash ( ) const

Guild has an invite splash

◆ has_member_verification_gate()

bool dpp::guild::has_member_verification_gate ( ) const

Guild has enabled membership screening

◆ has_news()

bool dpp::guild::has_news ( ) const

Guild has news channels

◆ has_vanity_url()

bool dpp::guild::has_vanity_url ( ) const

Guild can have a vanity url

◆ has_vip_regions()

bool dpp::guild::has_vip_regions ( ) const

Guild has VIP regions

◆ is_community()

bool dpp::guild::is_community ( ) const

Guild has enabled community

◆ is_discoverable()

bool dpp::guild::is_discoverable ( ) const

Guild is discoverable

◆ is_featureable()

bool dpp::guild::is_featureable ( ) const

Guild is featureable

◆ is_large()

bool dpp::guild::is_large ( ) const

Is a large server (>250 users)

◆ is_partnered()

bool dpp::guild::is_partnered ( ) const

Guild is a discord partner server

◆ is_preview_enabled()

bool dpp::guild::is_preview_enabled ( ) const

Guild has preview enabled

◆ is_unavailable()

bool dpp::guild::is_unavailable ( ) const

Is unavailable due to outage (most other fields will be blank or outdated

◆ is_verified()

bool dpp::guild::is_verified ( ) const

Guild is a verified server

◆ is_welcome_screen_enabled()

bool dpp::guild::is_welcome_screen_enabled ( ) const

Guild has enabled welcome screen

◆ permission_overwrites()

uint64_t dpp::guild::permission_overwrites ( const uint64_t  base_permissions,
const user member,
const channel channel 
) const

Get the permission overwrites for a member merged into a bitmask.

Parameters
base_permissionsbase permissions before overwrites, from channel::base_permissions
memberMember to fetch permissions for
channelChannel to fetch permissions against
Returns
uint64_t Merged permissions bitmask of overwrites.

◆ rehash_members()

void dpp::guild::rehash_members ( )

Rehash members map.

◆ widget_enabled()

bool dpp::guild::widget_enabled ( ) const

Widget is enabled for this server

Member Data Documentation

◆ afk_channel_id

snowflake dpp::guild::afk_channel_id

Snowflake ID of AFK voice channel or 0

◆ afk_timeout

uint8_t dpp::guild::afk_timeout

Voice AFK timeout before moving users to AFK channel

◆ application_id

snowflake dpp::guild::application_id

ID of creating application, if any, or 0

◆ banner

utility::iconhash dpp::guild::banner

Server banner hash

◆ channels

std::vector<snowflake> dpp::guild::channels

List of channels on this server

◆ default_message_notifications

uint8_t dpp::guild::default_message_notifications

Setting for how notifications are to be delivered to users

◆ description

std::string dpp::guild::description

Server description for communities

◆ discovery_splash

utility::iconhash dpp::guild::discovery_splash

Guild discovery splash hash

◆ emojis

std::vector<snowflake> dpp::guild::emojis

List of emojis

◆ explicit_content_filter

uint8_t dpp::guild::explicit_content_filter

Wether or not explicit content filtering is enable and what setting it is

◆ flags

uint32_t dpp::guild::flags

Flags bitmask as defined by values within dpp::guild_flags

◆ icon

utility::iconhash dpp::guild::icon

Guild icon hash

◆ id

snowflake dpp::managed::id
inherited

Unique ID of object

◆ max_video_channel_users

uint16_t dpp::guild::max_video_channel_users

Maximum users in a video channel, or 0

◆ member_count

uint32_t dpp::guild::member_count

Approximate member count. May be sent as zero

◆ members

members_container dpp::guild::members

List of guild members. Note that when you first receive the guild create event, this may be empty or near empty. This depends upon your dpp::intents and the size of your bot. It will be filled by guild member chunk requests.

◆ mfa_level

uint8_t dpp::guild::mfa_level

If multi factor authentication is required for moderators or not

◆ name

std::string dpp::guild::name

Guild name

◆ owner_id

snowflake dpp::guild::owner_id

Snowflake id of guild owner

◆ premium_subscription_count

uint16_t dpp::guild::premium_subscription_count

Number of boosters

◆ premium_tier

uint8_t dpp::guild::premium_tier

Boost level

◆ public_updates_channel_id

snowflake dpp::guild::public_updates_channel_id

Public updates channel id or 0

◆ roles

std::vector<snowflake> dpp::guild::roles

Roles defined on this server

◆ rules_channel_id

snowflake dpp::guild::rules_channel_id

ID of rules channel for communities

◆ shard_id

uint16_t dpp::guild::shard_id

Shard ID of the guild

◆ splash

utility::iconhash dpp::guild::splash

Guild splash hash

◆ system_channel_id

snowflake dpp::guild::system_channel_id

ID of system channel where discord update messages are sent

◆ threads

std::vector<snowflake> dpp::guild::threads

List of threads on this server

◆ vanity_url_code

std::string dpp::guild::vanity_url_code

Vanity url code for verified or partnered servers and boost level 3

◆ verification_level

uint8_t dpp::guild::verification_level

Verification level of server

◆ voice_members

std::map<snowflake, voicestate> dpp::guild::voice_members

List of members in voice channels in the guild.

◆ voice_region

region dpp::guild::voice_region

Guild voice region

◆ widget_channel_id

snowflake dpp::guild::widget_channel_id

Snowflake ID of widget channel, or 0

D++ Library version 10.0.35D++ Library version 10.0.34D++ Library version 10.0.33D++ Library version 10.0.32D++ Library version 10.0.31D++ Library version 10.0.30D++ Library version 10.0.29D++ Library version 10.0.28D++ Library version 10.0.27D++ Library version 10.0.26D++ Library version 10.0.25D++ Library version 10.0.24D++ Library version 10.0.23D++ Library version 10.0.22D++ Library version 10.0.21D++ Library version 10.0.20D++ Library version 10.0.19D++ Library version 10.0.18D++ Library version 10.0.17D++ Library version 10.0.16D++ Library version 10.0.15D++ Library version 10.0.14D++ Library version 10.0.13D++ Library version 10.0.12D++ Library version 10.0.11D++ Library version 10.0.10D++ Library version 10.0.9D++ Library version 10.0.8D++ Library version 10.0.7D++ Library version 10.0.6D++ Library version 10.0.5D++ Library version 10.0.4D++ Library version 10.0.3D++ Library version 10.0.2D++ Library version 10.0.1D++ Library version 10.0.0D++ Library version 9.0.19D++ Library version 9.0.18D++ Library version 9.0.17D++ Library version 9.0.16D++ Library version 9.0.15D++ Library version 9.0.14D++ Library version 9.0.13D++ Library version 9.0.12D++ Library version 9.0.11D++ Library version 9.0.10D++ Library version 9.0.9D++ Library version 9.0.8D++ Library version 9.0.7D++ Library version 9.0.6D++ Library version 9.0.5D++ Library version 9.0.4D++ Library version 9.0.3D++ Library version 9.0.2D++ Library version 9.0.1D++ Library version 9.0.0D++ Library version 1.0.2D++ Library version 1.0.1D++ Library version 1.0.0