rewrite trigger system

This commit is contained in:
Flummi
2019-08-19 01:28:01 +00:00
parent 22d79eed18
commit 3a751f2e52
30 changed files with 536 additions and 570 deletions

View File

@@ -23,8 +23,10 @@ insert into nxy_quotes
($1, $2, $3, $4);
`;
export default bot => {
bot._trigger.set("qrnd", new bot.trigger({
export default async bot => {
return [{
name: "qrnd",
call: /^(\.|\/)q(rnd)?$/i,
set: "all",
f: e => {
@@ -35,8 +37,8 @@ export default bot => {
e.reply(`<[b]${quote.nick}[/b]> [i]${quote.item}[/i]`);
}).catch(console.error);
}
}));
bot._trigger.set("quotes", new bot.trigger({
}, {
name: "quotes",
call: /^(\.|\/)q .*/i,
set: "nxy",
f: e => {
@@ -118,5 +120,5 @@ export default bot => {
break;
}
}
}));
}];
};