-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.example.js
168 lines (135 loc) · 7.53 KB
/
config.example.js
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
var config = {
saveFolder : "save",
saveName : "cm.json",
init : function (commandManager, helper) {
// load gateway to irc server
var IrcRouter = require('./lib/router/ircrouter');
var ircConfig = {
host: "chat.freenode.net",
nick: "repltbot",
channels: ["#test5566", "#text5577"],
port: null,
SASL: null,
// SASL : {account:"your_awesome_account", password: "pa$$w()rd"},
identifier: "*"
}
var ircRouter = new IrcRouter(
ircConfig.host,
ircConfig.nick,
ircConfig.channels,
ircConfig.port,
ircConfig.SASL,
ircConfig.identifier
);
ircRouter.enableFloodProtection(1000);
// ircRouter.enableTimeout(600 * 1000)
commandManager.addRouter(ircRouter);
// load gateway to telegram
// var TelegramRouter = require('./lib/router/tgrouter')
// commandManager.addRouter(new TelegramRouter('000000000:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'))
var path = require("path");
var chatLogPath = 'chatlog.json';
var regexConfigPath = 'regex.json';
var titleParserConfigPath = 'titleparse.json';
var mailboxPath = 'mailbox.json';
var CommandSay = require('./lib/commands/commandsay.js')
var CommandRainbow = require('./lib/commands/commandrainbow.js')
var CommandRainbow2 = require('./lib/commands/commandrainbow2.js')
var CommandLog = require('./lib/commands/commandlog.js')
var CommandUptime = require('./lib/commands/commanduptime.js')
var CommandPass = require('./lib/commands/commandpass.js')
var CommandLookup = require('./lib/commands/commandnslookup.js')
var CommandNotifyAll = require('./lib/commands/commandnotifyall.js')
var CommandRand = require('./lib/commands/commandrand.js')
var CommandReply = require('./lib/commands/commandreply.js')
var CommandFortune = require('./lib/commands/fortune')
var CommandRegex = require('./lib/commands/commandregex.js')
var CommandPython = require('./lib/commands/commandpy.js')
var CommandMorse = require('./lib/commands/commandmorse.js')
var CommandMe = require('./lib/commands/commandme.js')
var CommandMail = require('./lib/commands/commandmail.js')
var CommandMcStatus = require('./lib/commands/commandmcstatus.js');
var CommandDemorse = require('./lib/commands/commanddemorse.js');
var CommandMe = require('./lib/commands/commandme.js');
var CommandMail = require('./lib/commands/commandmail.js');
var CommandMcStatus = require('./lib/commands/commandmcstatus.js');
var CommandTranslate = require('./lib/commands/commandtranslate.js');
var CommandHello = require('./lib/commands/commandhello.js');
var CommandGoogle = require('./lib/commands/commandgoogle.js');
commandManager.register ("say", new CommandSay, []);
commandManager.register ("rainbow", new CommandRainbow, []);
commandManager.register ("rainbow2", new CommandRainbow2, []);
commandManager.register ("log", new CommandLog(helper.createStorage(chatLogPath)), []);
commandManager.register ("uptime", new CommandUptime(), []);
commandManager.register ("pass", new CommandPass(), []);
commandManager.register ("notifyall", new CommandNotifyAll(), ['na']);
commandManager.register ("lookup", new CommandLookup(), []);
commandManager.register ("rand", new CommandRand(), []);
commandManager.register ("reply", new CommandReply(), []);
commandManager.register ("fortune", new CommandFortune(), []);
commandManager.register ("regex", new CommandRegex(helper.createStorage(regexConfigPath)), []);
commandManager.register ("python", new CommandPython(), ['py']);
commandManager.register ("morse", new CommandMorse(), []);
commandManager.register ("me", new CommandMe(), []);
commandManager.register ("mail", new CommandMail(helper.createStorage(mailboxPath)), []);
commandManager.register ("mcstatus", new CommandMcStatus(), ['mc']);
commandManager.register ("demorse", new CommandDemorse(), []);
commandManager.register ("me", new CommandMe(), []);
commandManager.register ("mail", new CommandMail(helper.createStorage(mailboxPath)), []);
commandManager.register ("mcstatus", new CommandMcStatus(), ['mc']);
commandManager.register ("translate", new CommandTranslate(), ['tr']);
commandManager.register ("hello", new CommandHello(), ['start']);
commandManager.register ("google", new CommandGoogle({
tld: "com.tw",
lang: "zh-TW",
nextText: "下一頁"
}), ['g']);
var CommandTranslate = require('./lib/commands/commandtranslate.js');
commandManager.register ("translate", new CommandTranslate(), ['tr']);
// mongodb based log command
//var CommandLog2 = require('./lib/commands/commandlog2.js');
//commandManager.register ("log", new CommandLog2('mongodb://localhost/test', '+08:00', 'zh-tw'), []);
var CommandZhengTai = require('./lib/funnycommands/commandzhengtai.js');
commandManager.register ("zhengtai", new CommandZhengTai(), ['cute', '正太']);
var CommandFeiZhai = require('./lib/funnycommands/commandfeizhai.js');
commandManager.register ("feizhai", new CommandFeiZhai(), ['fat', '肥宅']);
var CommandChannelName = require('./lib/commands/commandchannelname.js');
commandManager.register ("channel_name", new CommandChannelName(), ['channel']);
var CommandEchoReply = require('./lib/commands/commandechoreply.js');
commandManager.register ("echo_reply", new CommandEchoReply(), []);
var CommandReplyHtml = require('./lib/commands/commandreplyhtml.js');
commandManager.register ("reply_html", new CommandReplyHtml(), []);
var CommandUpsideDown = require('./lib/commands/commandupsidedown.js');
commandManager.register ("upsidedown", new CommandUpsideDown(), ['upd']);
// potential memeroy and cpu usage spam
// var CommandMath = require('./lib/commands/commandmath.js');
// commandManager.register ("calc", new CommandMath(), ['math', 'c']);
var CommandCpu = require('./lib/commands/commandcpu.js');
commandManager.register ("cpu", new CommandCpu(), []);
var CommandOsInfo = require('./lib/commands/commandosinfo.js');
commandManager.register ("os", new CommandOsInfo(), []);
var CommandMemory = require('./lib/commands/commandmemory.js');
commandManager.register ("memory", new CommandMemory(), []);
var CommandProcess = require('./lib/commands/commandprocess.js');
commandManager.register ("process", new CommandProcess(), []);
var CommandBotName = require('./lib/commands/commandbotname.js');
commandManager.register ("botname", new CommandBotName(), []);
var CommandWhoami = require('./lib/commands/commandwhoami.js');
commandManager.register ("whoami", new CommandWhoami(), ['selfname']);
var CommandTime = require('./lib/commands/commandtime.js');
commandManager.register ("time", new CommandTime(), []);
helper.safeLoad(function(){
var CommandTrace = require('./lib/commands/commandtrace.js')
commandManager.register ("trace", new CommandTrace(), ['t']);
}, "trace");
helper.safeLoad(function(){
var CommandPing = require('./lib/commands/commandping.js')
commandManager.register ("ping", new CommandPing(), ['p']);
}, "ping");
helper.safeLoad(function(){
var CommandFindFastestServer = require('./lib/commands/commandfindfastestserver.js')
commandManager.register ("findfastestserver", new CommandFindFastestServer(), ['ffs']);
}, "findFastestServer");
}
}
module.exports = config