Schmuser im Discord

This commit is contained in:
Flummi 2018-06-20 06:55:54 +02:00
parent 6923b973ad
commit aa2c597631

View File

@ -1,6 +1,7 @@
import { logger } from "../inc/log";
import { getLevel } from "../inc/admin";
import { spurdo } from "../inc/spurdo";
import { schmuser } from "../inc/schmuser";
import Discord from "discord.js";
import EventEmitter from "events";
@ -21,7 +22,8 @@ export class discord extends EventEmitter {
channel: new Map(),
user: new Map(),
me: {},
spurdo: false
spurdo: false,
schmuser = false
};
this.bot.on("ready", () => {
@ -81,6 +83,8 @@ export class discord extends EventEmitter {
format(msg) {
if(this.server.spurdo)
msg = spurdo(msg);
if(this.server.schmuser)
msg = schmuser(msg);
return msg.toString()
.replace(/\[b\](.*?)\[\/b\]/g, "**$1**") // bold
.replace(/\[i\](.*?)\[\/i\]/g, "*$1*") // italic