236 lines
7.3 KiB
JavaScript
236 lines
7.3 KiB
JavaScript
import sql from "../sql";
|
|
import fetch from "flumm-fetch-cookies";
|
|
|
|
const data = {
|
|
yiff: [],
|
|
kill_templates: [],
|
|
kill_parts: {},
|
|
genders: [],
|
|
woahs: [],
|
|
slap: []
|
|
};
|
|
|
|
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))
|
|
.catch(console.error));
|
|
|
|
return [{
|
|
name: "kiss",
|
|
call: /^(\.|\/)kiss/i,
|
|
set: "nxy",
|
|
help: {
|
|
text: "Kisses a user",
|
|
usage: "[b].kiss[/b] [i](<nick>)[/i]"
|
|
},
|
|
f: e => {
|
|
e.reply(`(づ。◕‿‿◕。)づ" [color=red]。。・゜゜・。。・゜❤[/color] [b]${e.args[0] || e.user.nick}[/b] [color=red]❤[/color]`);
|
|
}
|
|
}, {
|
|
name: "hug",
|
|
call: /^(\.|\/)hug/i,
|
|
set: "nxy",
|
|
help: {
|
|
text: "Hugs a user",
|
|
usage: "[b].hug[/b] [i](<nick>)[/i]"
|
|
},
|
|
f: e => {
|
|
e.reply(`[color=red]♥♡❤♡♥[/color] [b]${e.args[0] || e.user.nick}[/b] [color=red]♥♡❤♡♥[/color]`);
|
|
}
|
|
}, {
|
|
name: "kill",
|
|
call: /^(\.|\/)kill/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
e.replyAction(data.kill_templates[~~(Math.random() * data.kill_templates.length)]
|
|
.replace("{user}", `[b]${e.args[0] || e.user.nick}[/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)])
|
|
);
|
|
}
|
|
}, {
|
|
name: "yiff",
|
|
call: /^(\.|\/)yiff/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
e.replyAction(data.yiff[~~(Math.random() * data.yiff.length)]
|
|
.split("{user}").join(`[b]${e.args[0] || e.user.nick}[/b]`)
|
|
.split("{yiffer}").join(`[b]${e.user.nick}[/b]`)
|
|
.split("{nick}").join(`[b]${e.self.me.nickname}[/b]`)
|
|
.split("{channel}").join(`${e.channel}`)
|
|
);
|
|
}
|
|
}, {
|
|
name: "bier",
|
|
call: /^(\.|\/)bier/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
e.replyAction(`schenkt ein kühles Blondes an [b]${e.args[0] || e.user.nick}[/b] aus.`);
|
|
}
|
|
}, {
|
|
name: "fucken",
|
|
call: /^(\.|\/)fucken/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
const user = e.args[0] || e.user.nick;
|
|
e.replyAction(`fuckt [b]${user}[/b] und tötet [b]${user}[/b] anschließend.`);
|
|
}
|
|
}, {
|
|
name: "hack",
|
|
call: /^(\.|\/)hack/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
e.reply(`hacking ${e.args[0] || e.user.nick}...`);
|
|
}
|
|
}, {
|
|
name: "spit",
|
|
call: /^(\.|\/)spit/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
e.replyAction(`spits on [b]${e.args[0] || e.user.nick}[/b] like a dirty whore.`);
|
|
}
|
|
}, {
|
|
name: "assume",
|
|
call: /^(\.|\/)assume/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
e.reply(`Assuming [b]${e.args[0] || e.user.nick}'s[/b] gender... it's a ${data.genders[~~(Math.random() * data.genders.length)]}.`);
|
|
}
|
|
}, {
|
|
name: "jn",
|
|
call: /^(\.|\/)jn/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
e.reply(`${e.user.nick}: [b]${~~(Math.random() * 2) ? "Ja" : "Nein"}[/b]`);
|
|
}
|
|
}, {
|
|
name: "chosse",
|
|
call: /^(\.|\/)choose .*/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
const args = e.message.substring(8).trim().split(",");
|
|
if (args.length < 2)
|
|
return e.reply(`${e.user.nick}: Ob du behindert bist?`);
|
|
e.reply(`${e.user.nick}: ${args[~~(Math.random() * args.length)].trim()}`);
|
|
}
|
|
}, {
|
|
name: "huehuehue",
|
|
call: /^huehuehue$/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
e.reply("huehuehue");
|
|
}
|
|
}, {
|
|
name: "woah",
|
|
call: /woah/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
if (~~(Math.random() * 4))
|
|
e.reply(data.woahs[~~(Math.random() * data.woahs.length)]);
|
|
}
|
|
}, {
|
|
name: "REEE",
|
|
call: /reee+$/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
e.reply("R".padEnd(~~(Math.random() * 20 + 10), "E"));
|
|
}
|
|
}, {
|
|
name: "meme",
|
|
call: /^(\.|\/)meme .*/i,
|
|
set: "nxy",
|
|
active: false,
|
|
f: e => {
|
|
const args = e.message.trim().substring(6).split("/");
|
|
//if(args.length < 3)
|
|
return e.reply("[WIP] too few arguments: .meme [meme] / [line 1] / [line 2]");
|
|
|
|
}
|
|
}, {
|
|
name: "slap",
|
|
call: /^(\.|\/)slap/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
e.replyAction(data.slap[~~(Math.random() * data.slap.length)]
|
|
.replace("{user}", `[b]${e.args[0] || e.user.nick}[/b]`)
|
|
);
|
|
}
|
|
}, {
|
|
name: "fw",
|
|
call: /^(\.|\/)fw .*/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
const args = e.message.substring(4).trim();
|
|
e.reply([...args.toUpperCase()].map(c => c === ' ' ? ' ' : String.fromCharCode(65248 + c.charCodeAt(0))).join``);
|
|
}
|
|
}, {
|
|
name: "waifu_husbando",
|
|
call: /^(\.|\/)(waifu|husbando)/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
let nick = e.args[0] || (e.type === "tg"?e.user.username || e.user.nick:e.user.nick)
|
|
let mode = e.cmd;
|
|
nick = nick.split("@").join("");
|
|
|
|
if(e.args.length > 0 && e.args[0].charAt(0) === "=") {
|
|
let tmp = e.args[0].slice(1);
|
|
sql.any(
|
|
`insert into nxy_users (prefix, nick, ${mode}) values ($1, lower($2), $3) on conflict (prefix) do update set ${mode} = excluded.${mode}, nick = $2`, [
|
|
e.user.prefix,
|
|
(e.type === "tg"?e.user.username || e.user.nick:e.user.nick),
|
|
tmp
|
|
])
|
|
.then(rows => {
|
|
e.reply(`${mode.charAt(0).toUpperCase()+mode.slice(1)} set to: [b]${tmp}[/b]`)
|
|
})
|
|
.catch(err => console.log(err));
|
|
}
|
|
else {
|
|
sql.any(`select ${mode} from nxy_users where lower(nick) = lower($1) limit 1`, [nick])
|
|
.then(rows => {
|
|
if(!rows[0])
|
|
return e.reply(`[b]${mode.charAt(0).toUpperCase() + mode.slice(1)}[/b]: none`);
|
|
e.reply(`${mode.charAt(0).toUpperCase() + mode.slice(1)}: [b]${rows[0][mode]}[/b]`);
|
|
})
|
|
.catch(err => console.log(err));
|
|
}
|
|
}
|
|
}, {
|
|
name: "asshole",
|
|
call: /^(\.|\/)asshole/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
e.reply(`Jamba Arschlochscanner: [b]${e.args[0] || e.user.nick}[/b] ist zu ${~~(Math.random() * 100 + 1)}% ein Arschloch.`);
|
|
}
|
|
}, {
|
|
name: "isup",
|
|
call: /^(\.|\/)isup .*/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
const addr = !e.args[0].match(/^https?/g) ? `https://${e.args[0]}` : e.args[0];
|
|
fetch(addr)
|
|
.then(res => {
|
|
e.reply(`[b]${addr}[/b] seems to be [b]up[/b].`);
|
|
})
|
|
.catch(err => {
|
|
e.reply(`[b]${addr}[/b] seems to be [b]down[/b].`);
|
|
});
|
|
}
|
|
}, {
|
|
name: "einschlaefern",
|
|
call: /^(\.|\/)einschläfern/i,
|
|
set: "nxy",
|
|
f: e => {
|
|
e.replyAction(`schläfert [b]${e.args[0] || e.user.nick}[/b] mit einer Spritze Ketamin ein.`);
|
|
}
|
|
}];
|
|
};
|