trigger trigger trigger
This commit is contained in:
parent
ea25b51ae0
commit
52d0d1f99d
|
@ -85,9 +85,9 @@ class irc {
|
||||||
message: tmp.params[1],
|
message: tmp.params[1],
|
||||||
time: ~~(Date.now() / 1000),
|
time: ~~(Date.now() / 1000),
|
||||||
raw: tmp,
|
raw: tmp,
|
||||||
reply: msg => this.send(`PRIVMSG ${tmp.params[0]} :${this.format(msg)}`),
|
reply: msg => this.send(`PRIVMSG ${tmp.params[0]} :${this.format(""+msg)}`),
|
||||||
replyAction: msg => this.send(`PRIVMSG ${tmp.params[0]} :\u0001ACTION ${this.format(msg)}\u0001`),
|
replyAction: msg => this.send(`PRIVMSG ${tmp.params[0]} :\u0001ACTION ${this.format(""+msg)}\u0001`),
|
||||||
replyNotice: msg => this.send(`NOTICE ${tmp.params[0]} :${this.format(msg)}`),
|
replyNotice: msg => this.send(`NOTICE ${tmp.params[0]} :${this.format(""+msg)}`),
|
||||||
_chan: this.server.channel[tmp.params[0]],
|
_chan: this.server.channel[tmp.params[0]],
|
||||||
_user: this.server.user,
|
_user: this.server.user,
|
||||||
_cmd: this._cmd,
|
_cmd: this._cmd,
|
||||||
|
|
|
@ -52,7 +52,7 @@ class tg {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
format(msg) {
|
format(msg) {
|
||||||
return msg
|
return ""+msg
|
||||||
.replace(/\[b\](.*?)\[\/b\]/g, "<b>$1</b>") // bold
|
.replace(/\[b\](.*?)\[\/b\]/g, "<b>$1</b>") // bold
|
||||||
.replace(/\[i\](.*?)\[\/i\]/g, "<i>$1</i>") // italic
|
.replace(/\[i\](.*?)\[\/i\]/g, "<i>$1</i>") // italic
|
||||||
;
|
;
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
const Dest = [
|
|
||||||
"nach Syrien", "in die Ukraine", "nach Timbuktu", "nach Uruguay",
|
|
||||||
"nach Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch",
|
|
||||||
"nach Bagdad", "nach Nordkorea", "nach Kurdistan", "nach Bayern",
|
|
||||||
"nach Japan", "nach Irak", "in den Iran", "nach Saudi-Arabien",
|
|
||||||
"nach Libyen", "nach Niger", "nach Uganda", "nach Afghanistan"
|
|
||||||
];
|
|
||||||
|
|
||||||
module.exports = bot => {
|
|
||||||
bot._trigger.set("abschieben", {
|
|
||||||
call: /^(.|\/)abschieben/i,
|
|
||||||
level: 0,
|
|
||||||
active: true,
|
|
||||||
clients: ["irc", "tg"],
|
|
||||||
f: e => {
|
|
||||||
let args = e.message.trim().split(" ");
|
|
||||||
args.shift();
|
|
||||||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
|
||||||
e.replyAction(`schiebt [b]${args[0]}[/b] ${Dest[~~(Math.random() * Dest.length)]} ab.`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
|
@ -1,14 +0,0 @@
|
||||||
module.exports = bot => {
|
|
||||||
bot._trigger.set("butterkaese", {
|
|
||||||
call: /^(.|\/)butterkäse/i,
|
|
||||||
level: 0,
|
|
||||||
active: true,
|
|
||||||
clients: ["irc", "tg"],
|
|
||||||
f: e => {
|
|
||||||
let args = e.message.trim().split(" ");
|
|
||||||
args.shift();
|
|
||||||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
|
||||||
e.replyAction(`drischt mit einem großen Stück Butterkäse auf [b]${args[0]}[/b] ein.`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
|
@ -1,47 +1,15 @@
|
||||||
const strains = {
|
import sql from "../sql.js";
|
||||||
'sativa': [
|
|
||||||
'Sour Diesel', 'Green Crack', 'Jack Herer', 'Durban Poison',
|
const data = {
|
||||||
'Lemon Haze', 'Strawberry Cough', 'Super Silver Haze',
|
dope_actions: {},
|
||||||
'Alaskan Thunder Fuck', 'Super Lemon Haze', 'Amnesia Haze',
|
dope_strains: {}
|
||||||
'Maui Wowie', 'Chocolope', 'Harlequin'
|
|
||||||
],
|
|
||||||
'indica': [
|
|
||||||
'Granddaddy Purple', 'Bubba Kush', 'Northern Lights',
|
|
||||||
'Blue Cheese', 'Purple Kush', 'Blueberry', 'Grape Ape',
|
|
||||||
'Blackberry Kush', 'Master Kush', 'God\'s Gift',
|
|
||||||
'LA Confidential', 'Death Star', 'Purple Urkle',
|
|
||||||
'Afghan Kush', 'Skywalker', 'White Rhino', 'Hindu Kush'
|
|
||||||
],
|
|
||||||
'hybrid': [
|
|
||||||
'Blue Dream', 'Girl Scout Cookies', 'OG Kush', 'White Widow',
|
|
||||||
'Gorilla Glue #4', 'Pineapple Express', 'Trainwreck',
|
|
||||||
'AK-47', 'Headband', 'Chemdawg', 'Cheese', 'Cherry Pie',
|
|
||||||
'Skywalker OG', 'Tahoe OG Kush', 'Lemon Kush',
|
|
||||||
'Platinum Girl Scout Cookies', 'Golden Goat', 'Agent Orange'
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
const actions = {
|
|
||||||
'joint': [
|
Object.keys(data).forEach(cur => {
|
||||||
['passes', 'to'],
|
sql.exec(`select \`data\` from \`useless\` where \`trigger\` = '${cur}' limit 1`, (err, row) => {
|
||||||
['rolls', 'for'],
|
data[cur] = JSON.parse(row[0].data);
|
||||||
['lights', 'for']
|
});
|
||||||
],
|
});
|
||||||
'bong': [
|
|
||||||
['passes', 'to'],
|
|
||||||
['preps', 'for'],
|
|
||||||
['lights', 'for']
|
|
||||||
],
|
|
||||||
'vape': [
|
|
||||||
['passes', 'to']
|
|
||||||
],
|
|
||||||
'blunt': [
|
|
||||||
['passes', 'to'],
|
|
||||||
['rolls', 'for'],
|
|
||||||
['lights', 'for']
|
|
||||||
]
|
|
||||||
};
|
|
||||||
const strain_types = Object.keys(strains);
|
|
||||||
const action_types = Object.keys(actions);
|
|
||||||
|
|
||||||
module.exports = bot => {
|
module.exports = bot => {
|
||||||
bot._trigger.set("dope", {
|
bot._trigger.set("dope", {
|
||||||
|
@ -54,10 +22,13 @@ module.exports = bot => {
|
||||||
args.shift();
|
args.shift();
|
||||||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||||||
|
|
||||||
|
const strain_types = Object.keys(data.dope_strains);
|
||||||
|
const action_types = Object.keys(data.dope_actions);
|
||||||
|
|
||||||
const strain_type = strain_types[~~(Math.random() * strain_types.length)]
|
const strain_type = strain_types[~~(Math.random() * strain_types.length)]
|
||||||
, consume_type = action_types[~~(Math.random() * action_types.length)]
|
, consume_type = action_types[~~(Math.random() * action_types.length)]
|
||||||
, action = actions[consume_type][~~(Math.random() * actions[consume_type].length)]
|
, action = data.dope_actions[consume_type][~~(Math.random() * data.dope_actions[consume_type].length)]
|
||||||
, strain = strains[strain_type][~~(Math.random() * strains[strain_type].length)];
|
, 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]${args[0]}[/b]`);
|
e.replyAction(`${action[0]} a ${consume_type} of the finest ${strain_type} "${strain}" ${action[1]} [b]${args[0]}[/b]`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
const texte = [
|
|
||||||
`einen frisch gebrühten Kaffee aus aromatisch hochwertigen und laktosefreien Kaffeebohnen, die nach dem Vorbild der kolonisierten Ausbeutung herangewachsen und importiert worden sind`,
|
|
||||||
`einen frisch gebrühten Kaffee aus aromatisch minderwertigen Kaffeebohnen, die zu einem überhöhten Preis und nach dem Prinzip des Fairtrade® herangewachsen und importiert worden sind`
|
|
||||||
];
|
|
||||||
|
|
||||||
module.exports = bot => {
|
|
||||||
bot._trigger.set("kaffee", {
|
|
||||||
call: /^(.|\/)kaffee/i,
|
|
||||||
level: 0,
|
|
||||||
active: true,
|
|
||||||
clients: ["irc", "tg"],
|
|
||||||
f: e => {
|
|
||||||
let args = e.message.trim().split(" ");
|
|
||||||
args.shift();
|
|
||||||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
|
||||||
e.replyAction(`serviert [b]${args.join(" ")}[/b] ${texte[~~(Math.random() * texte.length)]}; Prost!`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
|
@ -1,11 +0,0 @@
|
||||||
module.exports = bot => {
|
|
||||||
bot._trigger.set("lachs", {
|
|
||||||
call: /^(.|\/)lachs/i,
|
|
||||||
level: 0,
|
|
||||||
active: true,
|
|
||||||
clients: ["irc", "tg"],
|
|
||||||
f: e => {
|
|
||||||
e.reply("öhöhöhöhöhöhö");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
|
@ -1,14 +0,0 @@
|
||||||
module.exports = bot => {
|
|
||||||
bot._trigger.set("notschlachten", {
|
|
||||||
call: /^(.|\/)notschlachten/i,
|
|
||||||
level: 0,
|
|
||||||
active: true,
|
|
||||||
clients: ["irc", "tg"],
|
|
||||||
f: e => {
|
|
||||||
let args = e.message.trim().split(" ");
|
|
||||||
args.shift();
|
|
||||||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
|
||||||
e.replyAction(`notschlachtet [b]${args[0]}[/b] und entsorgt die Leiche im Biomüll`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
148
src/inc/trigger/useless.js
Normal file
148
src/inc/trigger/useless.js
Normal file
|
@ -0,0 +1,148 @@
|
||||||
|
import sql from "../sql.js";
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
yiff: [],
|
||||||
|
kill_templates: [],
|
||||||
|
kill_parts: {},
|
||||||
|
abschieben: [],
|
||||||
|
kaffee: []
|
||||||
|
};
|
||||||
|
|
||||||
|
Object.keys(data).forEach(cur => {
|
||||||
|
sql.exec(`select \`data\` from \`useless\` where \`trigger\` = '${cur}' limit 1`, (err, row) => {
|
||||||
|
data[cur] = JSON.parse(row[0].data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = bot => {
|
||||||
|
bot._trigger.set("kiss", {
|
||||||
|
call: /^(.|\/)kiss/i,
|
||||||
|
level: 0,
|
||||||
|
active: true,
|
||||||
|
clients: ["irc", "tg"],
|
||||||
|
f: e => {
|
||||||
|
let args = e.message.trim().split(" ");
|
||||||
|
args.shift();
|
||||||
|
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||||||
|
e.reply(`[b](づ。◕‿‿◕。)づ" 。。・゜゜・。。・゜❤ ${args.join(" ").trim()} ❤[/b]`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
bot._trigger.set("hug", {
|
||||||
|
call: /^(.|\/)hug/i,
|
||||||
|
level: 0,
|
||||||
|
active: true,
|
||||||
|
clients: ["irc", "tg"],
|
||||||
|
f: e => {
|
||||||
|
let args = e.message.trim().split(" ");
|
||||||
|
args.shift();
|
||||||
|
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||||||
|
e.reply(`[b]♥♡❤♡♥ ${args.join(" ").trim()} ♥♡❤♡♥[/b]`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
bot._trigger.set("kill", {
|
||||||
|
call: /^(.|\/)kill/i,
|
||||||
|
level: 0,
|
||||||
|
active: true,
|
||||||
|
clients: ["irc", "tg"],
|
||||||
|
f: e => {
|
||||||
|
let args = e.message.trim().split(" ");
|
||||||
|
args.shift();
|
||||||
|
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||||||
|
|
||||||
|
e.replyAction(data.kill_templates[~~(Math.random() * data.kill_templates.length)]
|
||||||
|
.replace("{user}", `[b]${args[0]}[/b]`)
|
||||||
|
.replace("{limbs}", data.kill_parts.limbs[~~(Math.random() * data.kill_parts.limbs.length)])
|
||||||
|
.replace("{gun}", data.kill_parts.gun[~~(Math.random() * data.kill_parts.gun.length)])
|
||||||
|
.replace("{weapon_stab}", data.kill_parts.weapon_stab[~~(Math.random() * data.kill_parts.weapon_stab.length)])
|
||||||
|
.replace("{weapon_slice}", data.kill_parts.weapon_slice[~~(Math.random() * data.kill_parts.weapon_slice.length)])
|
||||||
|
.replace("{weapon_crush}", data.kill_parts.weapon_crush[~~(Math.random() * data.kill_parts.weapon_crush.length)])
|
||||||
|
.replace("{weapon_explosive}", data.kill_parts.weapon_explosive[~~(Math.random() * data.kill_parts.weapon_explosive.length)])
|
||||||
|
.replace("{tall_thing}", data.kill_parts.tall_thing[~~(Math.random() * data.kill_parts.tall_thing.length)])
|
||||||
|
.replace("{spiked_thing}", data.kill_parts.spiked_thing[~~(Math.random() * data.kill_parts.spiked_thing.length)])
|
||||||
|
.replace("{bomb}", data.kill_parts.bomb[~~(Math.random() * data.kill_parts.bomb.length)])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
bot._trigger.set("yiff", {
|
||||||
|
call: /^(.|\/)yiff/i,
|
||||||
|
level: 0,
|
||||||
|
active: true,
|
||||||
|
clients: ["irc", "tg"],
|
||||||
|
f: e => {
|
||||||
|
let args = e.message.trim().split(" ");
|
||||||
|
args.shift();
|
||||||
|
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||||||
|
|
||||||
|
e.replyAction(data.yiff[~~(Math.random() * data.yiff.length)]
|
||||||
|
.replace("{user}", `[b]${args[0]}[/b]`)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
bot._trigger.set("abschieben", {
|
||||||
|
call: /^(.|\/)abschieben/i,
|
||||||
|
level: 0,
|
||||||
|
active: true,
|
||||||
|
clients: ["irc", "tg"],
|
||||||
|
f: e => {
|
||||||
|
let args = e.message.trim().split(" ");
|
||||||
|
args.shift();
|
||||||
|
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||||||
|
e.replyAction(`schiebt [b]${args[0]}[/b] ${data.abschieben[~~(Math.random() * data.abschieben.length)]} ab.`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
bot._trigger.set("butterkaese", {
|
||||||
|
call: /^(.|\/)butterkäse/i,
|
||||||
|
level: 0,
|
||||||
|
active: true,
|
||||||
|
clients: ["irc", "tg"],
|
||||||
|
f: e => {
|
||||||
|
let args = e.message.trim().split(" ");
|
||||||
|
args.shift();
|
||||||
|
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||||||
|
e.replyAction(`drischt mit einem großen Stück Butterkäse auf [b]${args[0]}[/b] ein.`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
bot._trigger.set("notschlachten", {
|
||||||
|
call: /^(.|\/)notschlachten/i,
|
||||||
|
level: 0,
|
||||||
|
active: true,
|
||||||
|
clients: ["irc", "tg"],
|
||||||
|
f: e => {
|
||||||
|
let args = e.message.trim().split(" ");
|
||||||
|
args.shift();
|
||||||
|
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||||||
|
e.replyAction(`notschlachtet [b]${args[0]}[/b] und entsorgt die Leiche im Biomüll`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
bot._trigger.set("lachs", {
|
||||||
|
call: /^(.|\/)lachs/i,
|
||||||
|
level: 0,
|
||||||
|
active: true,
|
||||||
|
clients: ["irc", "tg"],
|
||||||
|
f: e => {
|
||||||
|
e.reply("öhöhöhöhöhöhö");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
bot._trigger.set("kaffee", {
|
||||||
|
call: /^(.|\/)kaffee/i,
|
||||||
|
level: 0,
|
||||||
|
active: true,
|
||||||
|
clients: ["irc", "tg"],
|
||||||
|
f: e => {
|
||||||
|
let args = e.message.trim().split(" ");
|
||||||
|
args.shift();
|
||||||
|
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||||||
|
e.replyAction(data.kaffee[~~(Math.random() * data.kaffee.length)]
|
||||||
|
.replace("{user}", `[b]${args[0]}[/b]`)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user