Discord Social SDK
|
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).
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. | |
|
noexcept |
Move constructor for ChannelHandle.
discordpp::ChannelHandle::ChannelHandle | ( | const ChannelHandle & | other | ) |
Copy constructor for ChannelHandle.
uint64_t discordpp::ChannelHandle::Id | ( | ) | const |
Returns the ID of the channel.
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.
|
inline |
Returns true if the instance contains a valid object.
|
noexcept |
Move assignment operator for ChannelHandle.
ChannelHandle & discordpp::ChannelHandle::operator= | ( | const ChannelHandle & | other | ) |
Copy assignment operator for ChannelHandle.
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.
discordpp::ChannelType discordpp::ChannelHandle::Type | ( | ) | const |
Returns the type of the channel.
|
static |
Uninitialized instance of ChannelHandle.