-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecho.cpp
More file actions
26 lines (21 loc) · 686 Bytes
/
Copy pathecho.cpp
File metadata and controls
26 lines (21 loc) · 686 Bytes
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
#include "../irc/client.hpp"
#include "../irc/message.hpp"
#include "../logger.hpp"
#include "../plugin/plugin.hpp"
using namespace droid0;
// Plugin code
void print_log(const std::string &message);
void handle_echo(irc::client &client, const irc::message &message, void *);
void droid0_bootstrap(droid0::plugin::subscriptions<std::string> &subs)
{
subs.subscribe("echo", handle_echo);
}
void print_log(const std::string &message)
{
logging.info("(plugin:echo) " + message);
}
void handle_echo(irc::client &client, const irc::message &message, void *)
{
print_log("(plugin:core) '!echo' invoked");
client.privmsg(message.elements().at(2), message.command_arg());
}