Fix occasional error when unknown roles are added or removed
This commit is contained in:
parent
ff8e7c6afc
commit
f45e745d54
1 changed files with 2 additions and 2 deletions
|
@ -335,7 +335,7 @@ export class LogsPlugin extends ZeppelinPlugin<ILogsPluginConfig> {
|
|||
{
|
||||
member,
|
||||
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)
|
||||
.join(", "),
|
||||
mod: stripObjectToScalars(mod),
|
||||
|
@ -349,7 +349,7 @@ export class LogsPlugin extends ZeppelinPlugin<ILogsPluginConfig> {
|
|||
{
|
||||
member,
|
||||
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)
|
||||
.join(", "),
|
||||
mod: stripObjectToScalars(mod),
|
||||
|
|
Loading…
Add table
Reference in a new issue