blob: 6f0791f3bb4b05e5b7c107a02908a3f98f109259 (
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
39
40
41
42
43
44
|
#pragma once
#include <ixwebsocket/IXWebSocket.h>
#include <string>
#include "message.hpp"
namespace RedpilledBot {
namespace IRC {
class Client {
public:
Client(std::string username, std::string password);
~Client() = default;
void run();
template <MessageType T>
void on(typename MessageHandler<T>::fn function) {
switch (T) {
case Privmsg:
this->onPrivmsg = function;
break;
default:
break;
}
}
private:
void authorize();
std::string username;
std::string password;
std::string host;
std::string port;
ix::WebSocket websocket;
// Message handlers
typename MessageHandler<MessageType::Privmsg>::fn onPrivmsg;
};
}
}
|