fix bot handling

master
BuckarooBanzay 2021-11-28 19:51:40 +01:00
parent b4a0c7c61f
commit ade3d3ca1a
2 changed files with 9 additions and 9 deletions

View File

@ -1,6 +1,6 @@
module.exports = {
"remotes": [{
"debug": true,
"debug": false,
"announce_channel": false,
"name": "IRC",
"type": "irc",

View File

@ -10,16 +10,12 @@ module.exports = class {
intents: [Discord.Intents.FLAGS.GUILDS]
});
this.client.on('ready', e => {
console.error("error", e);
});
this.client.on('disconnect', e => {
console.error("disconnect", e);
console.log("disconnect", e);
});
this.client.on('ready', () => {
console.log(`Logged in as ${this.client.user.tag}!`);
this.client.once('ready', () => {
console.log(`Logged in as ${this.client.user.tag}, debug: ${remote.debug}!`);
// Send connection announcement
Object.keys(remote.channels).forEach(ingame_name => {
@ -100,7 +96,11 @@ module.exports = class {
});
this.client.on('message', msg => {
if (msg.author.bot.tag == this.client.user.tag){
if (remote.debug){
console.log("discord message", msg.author.tag)
}
if (msg.author.tag == this.client.user.tag){
// ignore myself
return;
}