droplet 1.3.0
A multipurpose Discord bot with the hacker in mind
Loading...
Searching...
No Matches
Core Class Reference

#include <Core.hpp>

Collaboration diagram for Core:

Static Public Member Functions

static bool is_admin (const dpp::guild_member &member) noexcept
 checks if a guild member is admin of that guild
static bool is_erarnitox_admin (const dpp::guild_member &member) noexcept
 checks if a guild member is admin erarnitox's server
static std::string get_role_id (const std::string &mention) noexcept
 gets the id of a mentioned role
static std::string get_channel_id (const std::string &mention) noexcept
 get the id of a channel from a mention
static void timed_reply (dpp::cluster &bot, const dpp::slashcommand_t event, const std::string &message, size_t time_mills) noexcept
 replies to an event and displays the reply for a limited time
static void timed_reply (dpp::cluster &bot, const dpp::form_submit_t event, const std::string &message, size_t time_mills) noexcept
 replies to an event and displays the reply for a limited time
static void timed_reply_private (dpp::cluster &bot, const dpp::slashcommand_t event, const std::string &message, size_t time_mills) noexcept
 replies to an event and displays the reply for a limited time and only to the sender of the event
static void timed_reply_private (dpp::cluster &bot, const dpp::form_submit_t event, const std::string &message, size_t time_mills) noexcept
 replies to an event and displays the reply for a limited time and only to the sender of the event
static std::string get_parameter (dpp::cluster &bot, const dpp::slashcommand_t event, const std::string &name, bool required=true) noexcept
 get the parameter from a slash command
static std::string simple_hash (const std::string &string) noexcept
 a very simply hashing function

Member Function Documentation

◆ get_channel_id()

std::string Core::get_channel_id ( const std::string & mention)
staticnoexcept

get the id of a channel from a mention

Parameters
mentionthe mention string of a channel
Returns
the channel id as a std::string

◆ get_parameter()

std::string Core::get_parameter ( dpp::cluster & bot,
const dpp::slashcommand_t event,
const std::string & name,
bool required = true )
staticnodiscardnoexcept

get the parameter from a slash command

Parameters
botthe cluster that can be thought of the current bot instance
eventthe slash command event
namethe name of the parameter
Returns
the parameter with the given name as a std::string

◆ get_role_id()

std::string Core::get_role_id ( const std::string & mention)
staticnoexcept

gets the id of a mentioned role

Parameters
mentionthe mention string of a role
Returns
returns the role id as a std::string

◆ is_admin()

bool Core::is_admin ( const dpp::guild_member & member)
staticnoexcept

checks if a guild member is admin of that guild

Parameters
memberthe guild member
Returns
whether the member has admin right on guild or not

◆ is_erarnitox_admin()

bool Core::is_erarnitox_admin ( const dpp::guild_member & member)
staticnoexcept

checks if a guild member is admin erarnitox's server

Parameters
memberthe guild member
Returns
whether the member has admin right on erarnitox's server

◆ simple_hash()

std::string Core::simple_hash ( const std::string & string)
staticnodiscardnoexcept

a very simply hashing function

Parameters
stringthe data to be hashed
Returns
the generated hash (similar to md5) as a std::string

◆ timed_reply() [1/2]

void Core::timed_reply ( dpp::cluster & bot,
const dpp::form_submit_t event,
const std::string & message,
size_t time_mills )
staticnoexcept

replies to an event and displays the reply for a limited time

Parameters
botthe cluster that can be thought of the current bot instance
eventthe event to be replied to
messagethe text to be put into the reply message
time_millsthe time to display the reply in milliseconds
Returns
doesn't return

◆ timed_reply() [2/2]

void Core::timed_reply ( dpp::cluster & bot,
const dpp::slashcommand_t event,
const std::string & message,
size_t time_mills )
staticnoexcept

replies to an event and displays the reply for a limited time

Parameters
botthe cluster that can be thought of the current bot instance
eventthe event to be replied to
messagethe text to be put into the reply message
time_millsthe time to display the reply in milliseconds
Returns
doesn't return

◆ timed_reply_private() [1/2]

void Core::timed_reply_private ( dpp::cluster & bot,
const dpp::form_submit_t event,
const std::string & message,
size_t time_mills )
staticnoexcept

replies to an event and displays the reply for a limited time and only to the sender of the event

Parameters
botthe cluster that can be thought of the current bot instance
eventthe event to be replied to
messagethe text to be put into the reply message
time_millsthe time to display the reply in milliseconds
Returns
doesn't return

◆ timed_reply_private() [2/2]

void Core::timed_reply_private ( dpp::cluster & bot,
const dpp::slashcommand_t event,
const std::string & message,
size_t time_mills )
staticnoexcept

replies to an event and displays the reply for a limited time and only to the sender of the event

Parameters
botthe cluster that can be thought of the current bot instance
eventthe event to be replied to
messagethe text to be put into the reply message
time_millsthe time to display the reply in milliseconds
Returns
doesn't return

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