blob: 69b906dc69b8367cf11c6030b6df7988b1e8310a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#pragma once
#include <optional>
#include <string>
#define GET_DATABASE_CONNECTION_URL(c) \
"dbname = " + c.database.name + " user = " + c.database.user + \
" password = " + c.database.password + " host = " + c.database.host + \
" port = " + c.database.port
namespace bot {
struct DatabaseConfiguration {
std::string name;
std::string user;
std::string password;
std::string host;
std::string port;
};
struct TwitchCredentialsConfiguration {
std::string client_id;
std::string token;
};
struct CommandConfiguration {
bool join_allowed = true;
bool join_allow_from_other_chats = false;
};
struct Configuration {
TwitchCredentialsConfiguration twitch_credentials;
DatabaseConfiguration database;
CommandConfiguration commands;
};
std::optional<Configuration> parse_configuration_from_file(
const std::string &file_path);
}
|