Discord Social SDK
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
discordpp::GuildChannel Class Reference

Detailed Description

Represents a channel in a guild that the current user is a member of and may be able to be linked to a lobby.

Public Member Functions

 GuildChannel (GuildChannel &&other) noexcept
 Move constructor for GuildChannel.
 
GuildChanneloperator= (GuildChannel &&other) noexcept
 Move assignment operator for GuildChannel.
 
 operator bool () const
 Returns true if the instance contains a valid object.
 
 GuildChannel (const GuildChannel &arg0)
 Copy constructor for GuildChannel.
 
GuildChanneloperator= (const GuildChannel &arg0)
 Copy assignment operator for GuildChannel.
 
uint64_t Id () const
 The id of the channel.
 
void SetId (uint64_t Id)
 Setter for GuildChannel::Id.
 
std::string Name () const
 The name of the channel.
 
void SetName (std::string Name)
 Setter for GuildChannel::Name.
 
bool IsLinkable () const
 Whether the current user is able to link this channel to a lobby.
 
void SetIsLinkable (bool IsLinkable)
 Setter for GuildChannel::IsLinkable.
 
bool IsViewableAndWriteableByAllMembers () const
 Whether the channel is "fully public" which means every member of the guild is able to view and send messages in that channel.
 
void SetIsViewableAndWriteableByAllMembers (bool IsViewableAndWriteableByAllMembers)
 Setter for GuildChannel::IsViewableAndWriteableByAllMembers.
 
std::optional< discordpp::LinkedLobbyLinkedLobby () const
 Information about the currently linked lobby, if any. Currently Discord enforces that a channel can only be linked to a single lobby.
 
void SetLinkedLobby (std::optional< discordpp::LinkedLobby > LinkedLobby)
 Setter for GuildChannel::LinkedLobby.
 

Static Public Attributes

static const GuildChannel nullobj
 Uninitialized instance of GuildChannel.
 

Constructor & Destructor Documentation

◆ GuildChannel() [1/2]

discordpp::GuildChannel::GuildChannel ( GuildChannel && other)
noexcept

Move constructor for GuildChannel.

◆ GuildChannel() [2/2]

discordpp::GuildChannel::GuildChannel ( const GuildChannel & arg0)

Copy constructor for GuildChannel.

Member Function Documentation

◆ Id()

uint64_t discordpp::GuildChannel::Id ( ) const

The id of the channel.

◆ IsLinkable()

bool discordpp::GuildChannel::IsLinkable ( ) const

Whether the current user is able to link this channel to a lobby.

For this to be true:

  • The channel must be a guild text channel
  • The channel may not be marked as NSFW
  • The channel must not be currently linked to a different lobby
  • The user must have the following permissions in the channel in order to link it:
    • Manage Channels
    • View Channel
    • Send Messages

◆ IsViewableAndWriteableByAllMembers()

bool discordpp::GuildChannel::IsViewableAndWriteableByAllMembers ( ) const

Whether the channel is "fully public" which means every member of the guild is able to view and send messages in that channel.

Discord allows lobbies to be linked to private channels in a server, which enables things like a private admin chat.

However there is no permission synchronization between the game and Discord, so it is the responsibility of the game to restrict access to the lobby. Every member of the lobby will be able to view and send messages in the lobby/channel, regardless of whether that user would have permission to do so in Discord.

This may be more complexity than a game wants to take on, so instead you can only allow linking of channels that are fully public in the server so there is no confusion.

◆ LinkedLobby()

std::optional< discordpp::LinkedLobby > discordpp::GuildChannel::LinkedLobby ( ) const

Information about the currently linked lobby, if any. Currently Discord enforces that a channel can only be linked to a single lobby.

◆ Name()

std::string discordpp::GuildChannel::Name ( ) const

The name of the channel.

◆ operator bool()

discordpp::GuildChannel::operator bool ( ) const
inline

Returns true if the instance contains a valid object.

◆ operator=() [1/2]

GuildChannel & discordpp::GuildChannel::operator= ( const GuildChannel & arg0)

Copy assignment operator for GuildChannel.

◆ operator=() [2/2]

GuildChannel & discordpp::GuildChannel::operator= ( GuildChannel && other)
noexcept

Move assignment operator for GuildChannel.

◆ SetId()

void discordpp::GuildChannel::SetId ( uint64_t Id)

Setter for GuildChannel::Id.

◆ SetIsLinkable()

void discordpp::GuildChannel::SetIsLinkable ( bool IsLinkable)

◆ SetIsViewableAndWriteableByAllMembers()

void discordpp::GuildChannel::SetIsViewableAndWriteableByAllMembers ( bool IsViewableAndWriteableByAllMembers)

◆ SetLinkedLobby()

void discordpp::GuildChannel::SetLinkedLobby ( std::optional< discordpp::LinkedLobby > LinkedLobby)

◆ SetName()

void discordpp::GuildChannel::SetName ( std::string Name)

Setter for GuildChannel::Name.

Member Data Documentation

◆ nullobj

const GuildChannel discordpp::GuildChannel::nullobj
static

Uninitialized instance of GuildChannel.