DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
DiscordCoreAPI::Permissions Class Reference

Permissions class, for representing and manipulating Permission values. More...

#include <Utilities.hpp>

Public Member Functions

void addPermissions (const std::vector< Permission > &permissionsToAdd)
 Adds one or more Permissions to the current Permissions value.
 
bool checkForPermission (const GuildMember &guildMember, const ChannelData &channel, Permission permission)
 Checks for a given Permission in a chosen Channel, for a specific User.
 
std::vector< std::string > displayPermissions ()
 Displays the currently present Permissions in a string, and returns a vector with each of them stored in string format.
 
std::string getCurrentPermissionString ()
 Returns a string containing the currently held Permissions.
 
void removePermissions (const std::vector< Permission > &permissionsToRemove)
 Removes one or more Permissions from the current Permissions value.
 

Static Public Member Functions

static std::string getAllPermissions ()
 Returns a string containing ALL of the possible Permissions.
 
static std::string getCurrentChannelPermissions (const GuildMember &guildMember, const ChannelData &channel)
 Returns a string containing all of a given User's Permissions for a given Channel.
 
static std::string getCurrentGuildPermissions (const GuildMember &guildMember)
 Returns a string containing the currently held Permissions in a given Guild.
 

Member Function Documentation

◆ addPermissions()

void DiscordCoreAPI::Permissions::addPermissions ( const std::vector< Permission > &  permissionsToAdd)
Parameters
permissionsToAddA vector containing the Permissions you wish to add.

Definition at line 1296 of file Utilities.cpp.

◆ checkForPermission()

bool DiscordCoreAPI::Permissions::checkForPermission ( const GuildMember guildMember,
const ChannelData channel,
Permission  permission 
)
Parameters
guildMemberThe GuildMember who to check the Permissions of.
channelThe Channel within which to check for the Permission's presence.
permissionA Permission to check the current Channel for.
Returns
bool A bool suggesting the presence of the chosen Permission.

Definition at line 1272 of file Utilities.cpp.

◆ displayPermissions()

std::vector< std::string > DiscordCoreAPI::Permissions::displayPermissions ( )
Returns
std::vector A vector full of strings of the Permissions that are in the input std::string's value.

Definition at line 1306 of file Utilities.cpp.

◆ getAllPermissions()

std::string DiscordCoreAPI::Permissions::getAllPermissions ( )
static
Returns
std::string A string containing all of the possible Permissions.

Definition at line 1445 of file Utilities.cpp.

◆ getCurrentChannelPermissions()

std::string DiscordCoreAPI::Permissions::getCurrentChannelPermissions ( const GuildMember guildMember,
const ChannelData channel 
)
static
Parameters
guildMemberThe GuildMember who's Permissions to analyze.
channelThe Channel withint which to check for Permissions.
Returns
std::string A string containing the final Permission's value for a given Channel.

Definition at line 1267 of file Utilities.cpp.

◆ getCurrentGuildPermissions()

std::string DiscordCoreAPI::Permissions::getCurrentGuildPermissions ( const GuildMember guildMember)
static
Parameters
guildMemberThe GuildMember who's Permissions are to be evaluated.
Returns
std::string A string containing the current Permissions.

Definition at line 1281 of file Utilities.cpp.

◆ getCurrentPermissionString()

std::string DiscordCoreAPI::Permissions::getCurrentPermissionString ( )
Returns
std::string A string containing the current Permissions.

Definition at line 1440 of file Utilities.cpp.

◆ removePermissions()

void DiscordCoreAPI::Permissions::removePermissions ( const std::vector< Permission > &  permissionsToRemove)
Parameters
permissionsToRemoveA vector containing the Permissions you wish to remove.

Definition at line 1286 of file Utilities.cpp.


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