fix(voiceChannelLog): make modes actually work

This commit is contained in:
verticalsync 2024-10-22 15:43:28 +03:00
parent 0ba03c263d
commit b9c32cdd91
No known key found for this signature in database
GPG key ID: C2BC9F32343245E1

View file

@ -66,7 +66,6 @@ function getMessageFlags(selfInChannel: boolean) {
}
function sendVoiceStatusMessage(channelId: string, content: string, userId: string, selfInChannel: boolean): Message | null {
if (settings.store.mode === 1) return null;
if (!channelId) return null;
const message: Message = createBotMessage({ channelId, content, embeds: [] });
@ -109,7 +108,7 @@ let clientOldChannelId: string | undefined;
export default definePlugin({
name: "VoiceChannelLog",
description: "Logs who joins and leaves voice channels",
authors: [Devs.Sqaaakoi, EquicordDevs.thororen],
authors: [Devs.Sqaaakoi, EquicordDevs.thororen, EquicordDevs.nyx],
contextMenus: {
"channel-context": patchChannelContextMenu
},
@ -139,10 +138,14 @@ export default definePlugin({
timestamp: new Date()
};
addLogEntry(logEntry, oldChannelId);
addLogEntry(logEntry, channelId);
if (settings.store.mode !== 2) {
addLogEntry(logEntry, oldChannelId);
addLogEntry(logEntry, channelId);
}
if (!settings.store.voiceChannelChatSelf && userId === clientUserId) return;
if (settings.store.mode === 1) return;
// Join / Leave
if ((!oldChannelId && channelId) || (oldChannelId && !channelId)) {
// empty string is to make type checker shut up