Rise
The Vieneo Province
Loading...
Searching...
No Matches
discordpp::ChannelHandle Class Reference

All messages sent on Discord are done so in a Channel. MessageHandle::ChannelId will contain the ID of the channel a message was sent in, and Client::GetChannelHandle will return an instance of this class. More...

#include <discordpp.h>

Collaboration diagram for discordpp::ChannelHandle:
[legend]

Public Member Functions

 ChannelHandle (ChannelHandle &&other) noexcept
 Move constructor for ChannelHandle.
ChannelHandle & operator= (ChannelHandle &&other) noexcept
 Move assignment operator for ChannelHandle.
 operator bool () const
 Returns true if the instance contains a valid object.
 ChannelHandle (const ChannelHandle &other)
 Copy constructor for ChannelHandle.
ChannelHandle & operator= (const ChannelHandle &other)
 Copy assignment operator for ChannelHandle.
uint64_t Id () const
 Returns the ID of the channel.
std::string Name () const
 Returns the name of the channel.
std::vector< uint64_t > Recipients () const
 For DMs and GroupDMs, returns the user IDs of the members of the channel. For all other channels returns an empty list.
discordpp::ChannelType Type () const
 Returns the type of the channel.

Static Public Attributes

static const ChannelHandle nullobj
 Uninitialized instance of ChannelHandle.

Detailed Description

All messages sent on Discord are done so in a Channel. MessageHandle::ChannelId will contain the ID of the channel a message was sent in, and Client::GetChannelHandle will return an instance of this class.

Handle objects in the SDK hold a reference both to the underlying data, and to the SDK instance. Changes to the underlying data will generally be available on existing handles objects without having to re-create them. If the SDK instance is destroyed, but you still have a reference to a handle object, note that it will return the default value for all method calls (ie an empty string for methods that return a string).

Definition at line 2127 of file discordpp.h.

Constructor & Destructor Documentation

◆ ChannelHandle() [1/2]

discordpp::ChannelHandle::ChannelHandle ( ChannelHandle && other)
noexcept

Move constructor for ChannelHandle.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ChannelHandle() [2/2]

discordpp::ChannelHandle::ChannelHandle ( const ChannelHandle & other)

Copy constructor for ChannelHandle.

Here is the call graph for this function:

Member Function Documentation

◆ Id()

uint64_t discordpp::ChannelHandle::Id ( ) const

Returns the ID of the channel.

◆ Name()

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

Returns the name of the channel.

Generally only channels in servers have names, although Discord may generate a display name for some channels as well.

◆ operator bool()

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

Returns true if the instance contains a valid object.

Definition at line 2148 of file discordpp.h.

◆ operator=() [1/2]

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

Move assignment operator for ChannelHandle.

Here is the call graph for this function:

◆ operator=() [2/2]

ChannelHandle & discordpp::ChannelHandle::operator= ( const ChannelHandle & other)

Copy assignment operator for ChannelHandle.

Here is the call graph for this function:

◆ Recipients()

std::vector< uint64_t > discordpp::ChannelHandle::Recipients ( ) const

For DMs and GroupDMs, returns the user IDs of the members of the channel. For all other channels returns an empty list.

◆ Type()

discordpp::ChannelType discordpp::ChannelHandle::Type ( ) const

Returns the type of the channel.

Member Data Documentation

◆ nullobj

const ChannelHandle discordpp::ChannelHandle::nullobj
static

Uninitialized instance of ChannelHandle.

Definition at line 2146 of file discordpp.h.


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