D++ (DPP)
C++ Discord API Bot Library
|
Represents a guild on Discord (AKA a server) More...
#include <guild.h>
Public Member Functions | |
guild () | |
virtual | ~guild ()=default |
Destroy the guild object. More... | |
guild & | fill_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, bool self_mute=false, bool self_deaf=false) |
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< snowflake > | roles |
std::vector< snowflake > | channels |
std::vector< snowflake > | threads |
members_container | members |
std::map< snowflake, voicestate > | voice_members |
std::vector< snowflake > | emojis |
snowflake | id |
Represents a guild on Discord (AKA a server)
dpp::guild::guild | ( | ) |
Default constructor, zeroes all values
|
virtualdefault |
Destroy the guild object.
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.
member | member to get permissions for |
std::string dpp::guild::build_json | ( | bool | with_id = false | ) | const |
Build a JSON string from this object.
with_id | True if an ID is to be included in the JSON |
bool dpp::guild::connect_member_voice | ( | snowflake | user_id, |
bool | self_mute = false , |
||
bool | self_deaf = false |
||
) |
Connect to a voice channel another guild member is in.
user_id | User id to join |
self_mute | True if the bot should mute itself |
self_deaf | True if the bot should deafen itself |
guild & dpp::guild::fill_from_json | ( | class discord_client * | shard, |
nlohmann::json * | j | ||
) |
Read class values from json object
shard | originating shard |
j | A json object to read from |
bool dpp::guild::has_animated_icon | ( | ) | const |
Guild is allowed an animated icon
bool dpp::guild::has_animated_icon_hash | ( | ) | const |
Server icon is actually an animated gif
bool dpp::guild::has_banner | ( | ) | const |
Guild has a banner image
bool dpp::guild::has_commerce | ( | ) | const |
Guild has enabled commerce channels
bool dpp::guild::has_invite_splash | ( | ) | const |
Guild has an invite splash
bool dpp::guild::has_member_verification_gate | ( | ) | const |
Guild has enabled membership screening
bool dpp::guild::has_news | ( | ) | const |
Guild has news channels
bool dpp::guild::has_vanity_url | ( | ) | const |
Guild can have a vanity url
bool dpp::guild::has_vip_regions | ( | ) | const |
Guild has VIP regions
bool dpp::guild::is_community | ( | ) | const |
Guild has enabled community
bool dpp::guild::is_discoverable | ( | ) | const |
Guild is discoverable
bool dpp::guild::is_featureable | ( | ) | const |
Guild is featureable
bool dpp::guild::is_large | ( | ) | const |
Is a large server (>250 users)
bool dpp::guild::is_partnered | ( | ) | const |
Guild is a discord partner server
bool dpp::guild::is_preview_enabled | ( | ) | const |
Guild has preview enabled
bool dpp::guild::is_unavailable | ( | ) | const |
Is unavailable due to outage (most other fields will be blank or outdated
bool dpp::guild::is_verified | ( | ) | const |
Guild is a verified server
bool dpp::guild::is_welcome_screen_enabled | ( | ) | const |
Guild has enabled welcome screen
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.
base_permissions | base permissions before overwrites, from channel::base_permissions |
member | Member to fetch permissions for |
channel | Channel to fetch permissions against |
void dpp::guild::rehash_members | ( | ) |
Rehash members map.
bool dpp::guild::widget_enabled | ( | ) | const |
Widget is enabled for this server
snowflake dpp::guild::afk_channel_id |
Snowflake ID of AFK voice channel or 0
uint8_t dpp::guild::afk_timeout |
Voice AFK timeout before moving users to AFK channel
snowflake dpp::guild::application_id |
ID of creating application, if any, or 0
utility::iconhash dpp::guild::banner |
Server banner hash
std::vector<snowflake> dpp::guild::channels |
List of channels on this server
uint8_t dpp::guild::default_message_notifications |
Setting for how notifications are to be delivered to users
std::string dpp::guild::description |
Server description for communities
utility::iconhash dpp::guild::discovery_splash |
Guild discovery splash hash
std::vector<snowflake> dpp::guild::emojis |
List of emojis
uint8_t dpp::guild::explicit_content_filter |
Whether or not explicit content filtering is enable and what setting it is
uint32_t dpp::guild::flags |
Flags bitmask as defined by values within dpp::guild_flags
utility::iconhash dpp::guild::icon |
Guild icon hash
|
inherited |
Unique ID of object
uint16_t dpp::guild::max_video_channel_users |
Maximum users in a video channel, or 0
uint32_t dpp::guild::member_count |
Approximate member count. May be sent as zero
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.
uint8_t dpp::guild::mfa_level |
If multi factor authentication is required for moderators or not
std::string dpp::guild::name |
Guild name
snowflake dpp::guild::owner_id |
Snowflake id of guild owner
uint16_t dpp::guild::premium_subscription_count |
Number of boosters
uint8_t dpp::guild::premium_tier |
Boost level
snowflake dpp::guild::public_updates_channel_id |
Public updates channel id or 0
std::vector<snowflake> dpp::guild::roles |
Roles defined on this server
snowflake dpp::guild::rules_channel_id |
ID of rules channel for communities
uint16_t dpp::guild::shard_id |
Shard ID of the guild
utility::iconhash dpp::guild::splash |
Guild splash hash
snowflake dpp::guild::system_channel_id |
ID of system channel where discord update messages are sent
std::vector<snowflake> dpp::guild::threads |
List of threads on this server
std::string dpp::guild::vanity_url_code |
Vanity url code for verified or partnered servers and boost level 3
uint8_t dpp::guild::verification_level |
Verification level of server
std::map<snowflake, voicestate> dpp::guild::voice_members |
List of members in voice channels in the guild.
region dpp::guild::voice_region |
Guild voice region
snowflake dpp::guild::widget_channel_id |
Snowflake ID of widget channel, or 0