3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Fix rejoin mutes not working

This commit is contained in:
Dark 2020-07-29 01:14:02 +02:00
parent 94870ef85d
commit 59ef2e6fec
3 changed files with 41 additions and 0 deletions

View file

@ -0,0 +1,15 @@
import { eventListener } from "knub";
import { MutesPluginType } from "../types";
/**
* Clear active mute from the member if the member is banned
*/
export const ClearActiveMuteOnMemberBanEvt = eventListener<MutesPluginType>()(
"guildBanAdd",
async ({ pluginData, args: { user } }) => {
const mute = await pluginData.state.mutes.findExistingMuteForUserId(user.id);
if (mute) {
pluginData.state.mutes.clear(user.id);
}
},
);