droplet 1.1.0
A multipurpose Discord bot with the hacker in mind
Loading...
Searching...
No Matches
Core.hpp
Go to the documentation of this file.
1/*
2 * (c) Copyright dropsoft.org - All rights reserved
3 * Author: Erarnitox <david@erarnitox.de>
4 *
5 * License: MIT License
6 *
7 * Description: This class offers access to all the
8 * core functionality and utility needed by the bot
9 *
10 * Documentation: https://droplet.erarnitox.de/doxygen/html/core
11 */
12
13#pragma once
14
15#include <dpp/dpp.h>
16#include <dpp/misc-enum.h>
17
18#include <Database.hpp>
19#include <IButtonCommand.hpp>
20#include <IFormCommand.hpp>
22#include <IMemberCommand.hpp>
23#include <IMessageCommand.hpp>
24#include <IReactionCommand.hpp>
25#include <string>
26
27class Core {
28 public:
29 static auto is_admin(const dpp::guild_member& member) noexcept -> bool;
30
31 static auto is_dropsoft_admin(const dpp::guild_member& member) noexcept -> bool;
32
33 static auto get_role_id(const std::string& mention) noexcept -> std::string;
34
35 static auto get_channel_id(const std::string& mention) noexcept -> std::string;
36
37 static void timed_reply(dpp::cluster& bot,
38 const dpp::slashcommand_t event,
39 const std::string& message,
40 size_t time_mills) noexcept;
41
42 static void timed_reply(dpp::cluster& bot,
43 const dpp::form_submit_t event,
44 const std::string& message,
45 size_t time_mills) noexcept;
46
47 static void timed_reply_private(dpp::cluster& bot,
48 const dpp::slashcommand_t event,
49 const std::string& message,
50 size_t time_mills) noexcept;
51
52 static void timed_reply_private(dpp::cluster& bot,
53 const dpp::form_submit_t event,
54 const std::string& message,
55 size_t time_mills) noexcept;
56
57 [[nodiscard]] static auto get_parameter(dpp::cluster& bot,
58 const dpp::slashcommand_t event,
59 const std::string& name,
60 bool required = true) noexcept -> std::string;
61
62 [[nodiscard]] static auto simple_hash(const std::string& string) -> std::string;
63};
Definition Core.hpp:27
static auto get_parameter(dpp::cluster &bot, const dpp::slashcommand_t event, const std::string &name, bool required=true) noexcept -> std::string
get the parameter from a slash command
Definition Core.cpp:222
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
Definition Core.cpp:190
static auto is_dropsoft_admin(const dpp::guild_member &member) noexcept -> bool
checks if a guild member is admin of dropsoft
Definition Core.cpp:46
static auto get_channel_id(const std::string &mention) noexcept -> std::string
get the id of a channel from a mention
Definition Core.cpp:89
static auto is_admin(const dpp::guild_member &member) noexcept -> bool
checks if a guild member is admin of that guild
Definition Core.cpp:31
static auto get_role_id(const std::string &mention) noexcept -> std::string
gets the id of a mentioned role
Definition Core.cpp:72
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
Definition Core.cpp:133
static auto simple_hash(const std::string &string) -> std::string
Definition Core.cpp:240