BenBot
1.7.5
A chess engine
Loading...
Searching...
No Matches
CustomCommand.hpp
Go to the documentation of this file.
1
/*
2
* ======================================================================================
3
*
4
* ░▒▓███████▓▒░░▒▓████████▓▒░▒▓███████▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░▒▓████████▓▒░
5
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
6
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
7
* ░▒▓███████▓▒░░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
8
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
9
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
10
* ░▒▓███████▓▒░░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░ ░▒▓█▓▒░
11
*
12
* ======================================================================================
13
*/
14
21
22
#pragma once
23
24
#include <functional>
25
#include <string_view>
26
#include <utility>
27
28
namespace
ben_bot
{
29
30
using
std::string_view;
31
35
struct
CustomCommand
final {
37
using
Callback
= std::function<void(string_view)>;
38
42
string_view
name
;
43
47
Callback
action
;
48
50
string_view
description
;
51
57
string_view
argsHelp
;
58
60
[[nodiscard]]
static
auto
void_cb
(std::function<
void
()>&& func) ->
Callback
61
{
62
return
[callback = std::move(func)]([[maybe_unused]]
const
string_view args) {
63
callback();
64
};
65
}
66
};
67
68
}
// namespace ben_bot
ben_bot
ben_bot::CustomCommand
Definition
CustomCommand.hpp:35
ben_bot::CustomCommand::description
string_view description
Definition
CustomCommand.hpp:50
ben_bot::CustomCommand::Callback
std::function< void(string_view)> Callback
Definition
CustomCommand.hpp:37
ben_bot::CustomCommand::name
string_view name
Definition
CustomCommand.hpp:42
ben_bot::CustomCommand::void_cb
static auto void_cb(std::function< void()> &&func) -> Callback
Definition
CustomCommand.hpp:60
ben_bot::CustomCommand::argsHelp
string_view argsHelp
Definition
CustomCommand.hpp:57
ben_bot::CustomCommand::action
Callback action
Definition
CustomCommand.hpp:47
libbenbot
include
libbenbot
engine
CustomCommand.hpp
Generated on
for BenBot by
1.16.1