Fix color changing and various messages on Discord

This commit is contained in:
Hri7566 2024-03-15 04:41:04 -04:00
parent dcd3930be5
commit e9786754d3
1 changed files with 6 additions and 5 deletions

View File

@ -29,7 +29,8 @@ export class DiscordBot extends EventEmitter {
"Guilds", "Guilds",
"GuildMessages", "GuildMessages",
"MessageContent", "MessageContent",
"GuildMembers" "GuildMembers",
"GuildModeration"
] ]
}); });
@ -140,6 +141,8 @@ export class DiscordBot extends EventEmitter {
} }
} }
} catch (err) { } catch (err) {
this.logger.error(err);
this.logger.warn("Unable to parse server message");
return; return;
} }
}, 1000 / 20); }, 1000 / 20);
@ -173,7 +176,7 @@ export class DiscordBot extends EventEmitter {
return; return;
} }
} else { } else {
await existingRole.setColor(msg.color); await existingRole.setColor(msg.color.toUpperCase());
} }
}); });
@ -181,9 +184,7 @@ export class DiscordBot extends EventEmitter {
// this.logger.debug("sendchat message:", msg); // this.logger.debug("sendchat message:", msg);
if (!this.defaultChannel) return; if (!this.defaultChannel) return;
this.defaultChannel.send( this.defaultChannel.send(
msg.message msg.message.split(`@${msg.id}`).join(`<@${msg.id}>`)
.split(`@${msg.author.id}`)
.join(`<@${msg.author.id}>`)
); );
}); });
} }