This repository was archived by the owner on Apr 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
52 lines (43 loc) · 1.36 KB
/
main.cpp
File metadata and controls
52 lines (43 loc) · 1.36 KB
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
45
46
47
48
49
50
51
52
// MiraiCP依赖文件(只需要引入这一个)
#include <MiraiCP.hpp>
#include "Suzuchan.h"
using namespace MiraiCP;
extern bool pyenv_ok;
// 插件实例
class Main : public CPPPlugin {
public:
// 配置插件信息
Main() : CPPPlugin(PluginConfig(
"Suzuchan-3g", "Suzuchan 3G", Suzuchan::VERSION, "Suzuco Kitsuneko",
"Suzuchan, the 3rd generation", Suzuchan::COMPILE_TIME))
{}
void onEnable() override
{
// 监听
/*
Event::processor.registerEvent<NudgeEvent>([](NudgeEvent e) -> void {
Logger::logger.info("NudgeEvent from " + std::to_string(e.from.groupid()));
if (likely(e.from.groupid() != 0)) {
// NudgeEvent from group
Member m(e.from.id(), e.from.groupid(), e.bot.id);
m.sendNudge();
}
else {
// NudgeEvent from user - unlikely!
e.from.sendMessage("喵!");
}
});*/
pyenv_ok = false;
MiraiCP::Event::registerEvent<GroupTempMessageEvent>([](const GroupTempMessageEvent & e) -> void {});
MiraiCP::Event::registerEvent<GroupMessageEvent>(& Suzuchan::process);
}
void onDisable() override
{
/*插件结束*/
}
};
// 绑定当前插件实例
void MiraiCP::enrollPlugin()
{
MiraiCP::enrollPlugin0(new Main());
}