droplet 1.3.0
A multipurpose Discord bot with the hacker in mind
Loading...
Searching...
No Matches
Bot.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include "CommandTypes.hpp"
6
7class Bot {
8 public:
9 explicit Bot(const std::string& token);
10 Bot(const Bot&) = delete;
11 Bot& operator=(const Bot&) = delete;
12
13 [[nodiscard]] dpp::cluster& discord() noexcept {
14 return *ctx;
15 }
16
17 void add_slash_command(const std::shared_ptr<IGlobalSlashCommand>& slash_command);
18 void add_button_command(const std::shared_ptr<IButtonCommand>& button_command);
19 void add_form_command(const std::shared_ptr<IFormCommand>& form_command);
20 void add_message_command(const std::shared_ptr<IMessageCommand>& message_command);
21 void add_message_delete_command(const std::shared_ptr<IMessageCommand>& message_command);
22 void add_reaction_command(const std::shared_ptr<IReactionCommand>& reaction_command);
23 void add_ready_command(const std::shared_ptr<IReady>& ready_command);
24 void run();
25 void shutdown() noexcept;
26
34
35 private:
36 ctx_t ctx;
37};
std::vector< std::shared_ptr< IFormCommand > > form_commands_t
Definition CommandTypes.hpp:17
std::vector< std::shared_ptr< IButtonCommand > > button_commands_t
Definition CommandTypes.hpp:16
std::map< std::string, std::shared_ptr< IGlobalSlashCommand > > slash_commands_t
Definition CommandTypes.hpp:15
std::unique_ptr< dpp::cluster > ctx_t
Definition CommandTypes.hpp:14
std::vector< std::shared_ptr< IReactionCommand > > reaction_commands_t
Definition CommandTypes.hpp:19
std::vector< std::shared_ptr< IMessageCommand > > message_commands_t
Definition CommandTypes.hpp:18
std::vector< std::shared_ptr< IReady > > ready_commands_t
Definition CommandTypes.hpp:20
void add_slash_command(const std::shared_ptr< IGlobalSlashCommand > &slash_command)
Definition Bot.cpp:21
slash_commands_t slash_commands
Definition Bot.hpp:27
form_commands_t form_commands
Definition Bot.hpp:29
void add_form_command(const std::shared_ptr< IFormCommand > &form_command)
Definition Bot.cpp:29
void add_message_command(const std::shared_ptr< IMessageCommand > &message_command)
Definition Bot.cpp:33
dpp::cluster & discord() noexcept
Definition Bot.hpp:13
reaction_commands_t reaction_commands
Definition Bot.hpp:32
Bot(const Bot &)=delete
void shutdown() noexcept
Definition Bot.cpp:54
void add_message_delete_command(const std::shared_ptr< IMessageCommand > &message_command)
Definition Bot.cpp:37
Bot(const std::string &token)
Definition Bot.cpp:16
Bot & operator=(const Bot &)=delete
void add_button_command(const std::shared_ptr< IButtonCommand > &button_command)
Definition Bot.cpp:25
void run()
Definition Bot.cpp:49
message_commands_t message_commands
Definition Bot.hpp:30
button_commands_t button_commands
Definition Bot.hpp:28
void add_reaction_command(const std::shared_ptr< IReactionCommand > &reaction_command)
Definition Bot.cpp:41
void add_ready_command(const std::shared_ptr< IReady > &ready_command)
Definition Bot.cpp:45
ready_commands_t ready_commands
Definition Bot.hpp:33
message_commands_t message_delete_commands
Definition Bot.hpp:31