database connectivity for timers

This commit is contained in:
Flummi
2018-03-03 07:12:40 +01:00
parent 703152f170
commit 47faa9dff4
5 changed files with 76 additions and 19 deletions

View File

@@ -11,6 +11,7 @@ export class discord extends EventEmitter {
this.options = options || {};
this.token = options.token || null;
this.set = this.options.set || "all";
this.network = "discord";
this.bot = new Discord.Client();
this.bot.login(this.token);
@@ -74,6 +75,9 @@ export class discord extends EventEmitter {
break;
}
}
sendmsg(mode, recipient, msg) {
this.bot.channels.get(recipient).send(msg);
}
format(msg) {
if(this.server.spurdo)
msg = spurdo(msg);

View File

@@ -98,6 +98,7 @@ export class irc extends EventEmitter {
type: "irc",
network: this.network,
channel: tmp.params[0],
channelid: tmp.params[0],
user: Object.assign(this.parsePrefix(tmp.prefix), {
account: this.server.user.geti(this.parsePrefix(tmp.prefix).nick).account,
prefix: tmp.prefix.charAt(0) === ":" ? tmp.prefix.substring(1) : tmp.prefix,

View File

@@ -100,6 +100,9 @@ export class tg extends EventEmitter {
logger.error(`(${this.network}) ${err.message}`);
});
}
sendmsg(mode, recipient, msg) {
this.send(recipient, msg);
}
reply(tmp) {
return {
type: "tg",