3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 22:21:51 +00:00

Fix occasional error when unknown roles are added or removed

This commit is contained in:
Dragory 2019-04-21 15:18:07 +03:00
parent ff8e7c6afc
commit f45e745d54

View file

@ -335,7 +335,7 @@ export class LogsPlugin extends ZeppelinPlugin<ILogsPluginConfig> {
{ {
member, member,
roles: addedRoles roles: addedRoles
.map(roleId => this.guild.roles.get(roleId)) .map(roleId => this.guild.roles.get(roleId) || { id: roleId, name: `Unknown (${roleId})` })
.map(r => r.name) .map(r => r.name)
.join(", "), .join(", "),
mod: stripObjectToScalars(mod), mod: stripObjectToScalars(mod),
@ -349,7 +349,7 @@ export class LogsPlugin extends ZeppelinPlugin<ILogsPluginConfig> {
{ {
member, member,
roles: removedRoles roles: removedRoles
.map(roleId => this.guild.roles.get(roleId)) .map(roleId => this.guild.roles.get(roleId) || { id: roleId, name: `Unknown (${roleId})` })
.map(r => r.name) .map(r => r.name)
.join(", "), .join(", "),
mod: stripObjectToScalars(mod), mod: stripObjectToScalars(mod),