bugfix
This commit is contained in:
parent
4af52d6609
commit
ddd1530c8e
11
src/bot.js
11
src/bot.js
|
@ -10,13 +10,12 @@ read().then(() => {
|
|||
_trigger: new Map()
|
||||
};
|
||||
|
||||
const files = fs.readdirSync(`${__dirname}/inc/trigger/`);
|
||||
for (let file in files) {
|
||||
if (files[file].substr(-3, 3) === ".js") {
|
||||
logger.info(`(main) loading trigger: ${files[file]}`);
|
||||
require(`${__dirname}/inc/trigger/${files[file]}`)(self);
|
||||
}
|
||||
fs.readdirSync(`${__dirname}/inc/trigger/`).forEach(file => {
|
||||
if(file.substr(-3, 3) === ".js") {
|
||||
logger.info(`(main) loading trigger: ${file}`);
|
||||
require(`${__dirname}/inc/trigger/${file}`)(self);
|
||||
}
|
||||
});
|
||||
|
||||
bot.on("message", e => { // Todo: eventhandler
|
||||
for (var [name, trigger] of self._trigger.entries()) {
|
||||
|
|
|
@ -37,7 +37,11 @@ module.exports = bot => {
|
|||
return e.reply(`holy fuck, Ausgabe wäre viel zu lang! (${output.length} Zeichen :DDDDDD)`);
|
||||
else {
|
||||
_contexts.set(`${e.network}.${e.channel}.${e.user.nick}`, context);
|
||||
sql.exec("update `useless` set `data` = ? where `trigger` = 'sandbox_js';", JSON.stringify(stringify([..._contexts]).replace(/\n/g, "").replace(/\t/g, "")))
|
||||
let tmp = JSON.stringify(stringify([..._contexts])
|
||||
.replace(/\n/g, "")
|
||||
.replace(/\t/g, "")
|
||||
.split("[native code]").join(""));
|
||||
sql.exec("update `useless` set `data` = ? where `trigger` = 'sandbox_js';", tmp)
|
||||
.then(() => {
|
||||
e.reply(output);
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user