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

Static Public Member Functions

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

Member Function Documentation

◆ addPermissions()

void DiscordCoreAPI::Permissions::addPermissions ( const std::vector< Permission > &  permissionsToAdd)

Adds one or more Permissions to the current Permissions value.

Parameters
permissionsToAddA vector containing the Permissions you wish to add.

Definition at line 1130 of file Utilities.cpp.

◆ checkForPermission()

Bool DiscordCoreAPI::Permissions::checkForPermission ( const GuildMember guildMember,
ChannelData channel,
Permission  permission 
)

Checks for a given Permission in a chosen Channel, for a specific User.

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 1106 of file Utilities.cpp.

◆ displayPermissions()

std::vector< String > DiscordCoreAPI::Permissions::displayPermissions ( )

Displays the currently present Permissions in a string, and returns a vector with each of them stored in string format.

Returns
std::vector A vector full of strings of the Permissions that are in the input String's value.

Definition at line 1140 of file Utilities.cpp.

◆ getAllPermissions()

String DiscordCoreAPI::Permissions::getAllPermissions ( )
static

Returns a string containing ALL of the possible Permissions.

Returns
String A string containing all of the possible Permissions.

Definition at line 1279 of file Utilities.cpp.

◆ getCurrentChannelPermissions()

String DiscordCoreAPI::Permissions::getCurrentChannelPermissions ( const GuildMember guildMember,
ChannelData channel 
)
static

Returns a string containing all of a given User's Permissions for a given Channel.

Parameters
guildMemberThe GuildMember who's Permissions to analyze.
channelThe Channel withint which to check for Permissions.
Returns
String A string containing the final Permission's value for a given Channel.

Definition at line 1101 of file Utilities.cpp.

◆ getCurrentGuildPermissions()

String DiscordCoreAPI::Permissions::getCurrentGuildPermissions ( const GuildMember guildMember)
static

Returns a string containing the currently held Permissions in a given Guild.

Parameters
guildMemberThe GuildMember who's Permissions are to be evaluated.
Returns
String A string containing the current Permissions.

Definition at line 1115 of file Utilities.cpp.

◆ getCurrentPermissionString()

String DiscordCoreAPI::Permissions::getCurrentPermissionString ( )

Returns a string containing the currently held Permissions.

Returns
String A string containing the current Permissions.

Definition at line 1274 of file Utilities.cpp.

◆ removePermissions()

void DiscordCoreAPI::Permissions::removePermissions ( const std::vector< Permission > &  permissionsToRemove)

Removes one or more Permissions from the current Permissions value.

Parameters
permissionsToRemoveA vector containing the Permissions you wish to remove.

Definition at line 1120 of file Utilities.cpp.


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