3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-14 21:31:50 +00:00

Persist: fix errors when the leaving member was not cached

This commit is contained in:
Miikka 2018-12-25 09:21:29 +02:00 committed by GitHub
parent d0f8ec2b57
commit 96953ce159
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@ export class PersistPlugin extends Plugin {
const persistData: IPartialPersistData = {};
const persistedRoles = this.configValue("persisted_roles");
if (persistedRoles.length) {
if (persistedRoles.length && member.roles) {
const rolesToPersist = intersection(persistedRoles, member.roles);
if (rolesToPersist.length) {
persist = true;
@ -44,7 +44,7 @@ export class PersistPlugin extends Plugin {
persistData.nickname = member.nick;
}
if (this.configValue("persist_voice_mutes") && member.voiceState.mute) {
if (this.configValue("persist_voice_mutes") && member.voiceState && member.voiceState.mute) {
persist = true;
persistData.is_voice_muted = true;
}