FoofyFox Sandstorm 2
General-purpose Discord bot in C++
ffss::SSMsgHandler Class Reference

Public Member Functions

 SSMsgHandler (dpp::cluster &bot, std::vector< std::string > &opt_names, std::vector< std::function< void(const dpp::message_create_t &, const std::vector< std::string > &)> > &opt_funcs)
 Construct a SSMsgHandler object. More...
 
void operator() (const dpp::message_create_t &ev)
 Overriden operator overload for this functor. More...
 

Constructor & Destructor Documentation

◆ SSMsgHandler()

ffss::SSMsgHandler::SSMsgHandler ( dpp::cluster &  bot,
std::vector< std::string > &  opt_names,
std::vector< std::function< void(const dpp::message_create_t &, const std::vector< std::string > &)>  ,
opt_funcs 
)

Construct a SSMsgHandler object.

Parameters
bota reference to a cluster.
opt_namesthe vector of all options to be registered wit the bot.
opt_funcsfunctions to be executed for each option in opt_names

Documented preconditions are as follows:

  • opt_names and opt_funcs must be of the same size.
  • Each option name in opt_names must be unique and non-empty.
Exceptions
std::runtime_errorif opt_names and opt_funcs are not of the same size.
std::logic_errorif preconditions of opt_names are violated.

Member Function Documentation

◆ operator()()

void ffss::SSMsgHandler::operator() ( const dpp::message_create_t &  ev)

Overriden operator overload for this functor.

Parameters
eva reference to a message event.

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