fix :_D
This commit is contained in:
parent
e99f318125
commit
70ce50fc9b
@ -13,7 +13,24 @@ export class discord extends EventEmitter {
|
|||||||
this.bot = new Discord.Client();
|
this.bot = new Discord.Client();
|
||||||
this.bot.login(this.token);
|
this.bot.login(this.token);
|
||||||
|
|
||||||
|
this.server = {
|
||||||
|
channel: new Map(),
|
||||||
|
user: new Map(),
|
||||||
|
me: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.bot.on("ready", () => {
|
||||||
|
this.server.me = {
|
||||||
|
nickname: this.bot.user.username,
|
||||||
|
username: this.bot.user.username,
|
||||||
|
account: this.bot.user.id.toString(),
|
||||||
|
prefix: `${this.bot.user.username}!${this.bot.user.id.toString()}`,
|
||||||
|
id: this.bot.user.id.toString()
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
this.bot.on("message", msg => {
|
this.bot.on("message", msg => {
|
||||||
|
if(msg.author.id !== this.server.me.id)
|
||||||
this.emit("data", ["message", this.reply(msg)]);
|
this.emit("data", ["message", this.reply(msg)]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -37,7 +54,6 @@ export class discord extends EventEmitter {
|
|||||||
},
|
},
|
||||||
message: tmp.content,
|
message: tmp.content,
|
||||||
time: ~~(Date.now() / 1000),
|
time: ~~(Date.now() / 1000),
|
||||||
//raw: tmp,
|
|
||||||
reply: msg => this.send(tmp, this.format(msg)),
|
reply: msg => this.send(tmp, this.format(msg)),
|
||||||
replyAction: msg => this.send(tmp, this.format(`*${msg}*`), "normal"),
|
replyAction: msg => this.send(tmp, this.format(`*${msg}*`), "normal"),
|
||||||
replyNotice: msg => this.send(tmp, this.format(msg))
|
replyNotice: msg => this.send(tmp, this.format(msg))
|
||||||
|
@ -11,7 +11,7 @@ export default bot => {
|
|||||||
bot._trigger.set("cfg", new bot.trigger({
|
bot._trigger.set("cfg", new bot.trigger({
|
||||||
call: /^\!cfg/i,
|
call: /^\!cfg/i,
|
||||||
level: 100,
|
level: 100,
|
||||||
clients: ["irc"],
|
clients: ["irc", "discord"],
|
||||||
f: e => {
|
f: e => {
|
||||||
let args = e.message.substring(5);
|
let args = e.message.substring(5);
|
||||||
let opts = {};
|
let opts = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user