rewrite trigger system
This commit is contained in:
@@ -5,15 +5,16 @@ const data = {
|
||||
dope_strains: {}
|
||||
};
|
||||
|
||||
Object.keys(data).forEach(cur => {
|
||||
sql.any("select data from useless where trigger = $1 limit 1", [cur])
|
||||
.then(rows => {
|
||||
data[cur] = JSON.parse(rows[0].data);
|
||||
});
|
||||
});
|
||||
export default async bot => {
|
||||
Object.keys(data).forEach(cur => {
|
||||
sql.any("select data from useless where trigger = $1 limit 1", [cur])
|
||||
.then(rows => {
|
||||
data[cur] = JSON.parse(rows[0].data);
|
||||
});
|
||||
});
|
||||
|
||||
export default bot => {
|
||||
bot._trigger.set("dope", new bot.trigger({
|
||||
return [{
|
||||
name: "dope",
|
||||
call: /^(\.|\/)dope/i,
|
||||
set: "nxy",
|
||||
help: {
|
||||
@@ -29,9 +30,8 @@ export default bot => {
|
||||
, strain = data.dope_strains[strain_type][~~(Math.random() * data.dope_strains[strain_type].length)];
|
||||
e.replyAction(`${action[0]} a ${consume_type} of the finest ${strain_type} "${strain}" ${action[1]} [b]${e.args[0] || e.user.nick}[/b]`);
|
||||
}
|
||||
}));
|
||||
|
||||
bot._trigger.set("meth", new bot.trigger({
|
||||
}, {
|
||||
name: "meth",
|
||||
call: /^(\.|\/)meth/i,
|
||||
set: "nxy",
|
||||
help: {
|
||||
@@ -41,5 +41,5 @@ export default bot => {
|
||||
f: e => {
|
||||
e.replyAction(`legt [b]${e.args[0] || e.user.nick}[/b] eine dicke Line Meth \\________`);
|
||||
}
|
||||
}));
|
||||
};
|
||||
}];
|
||||
};
|
||||
|
Reference in New Issue
Block a user