second batch of fixes (#2596)

Co-authored-by: programminglaboratorys <107296738+programminglaboratorys@users.noreply.github.com>
Co-authored-by: Haruka <personal@shiroko.me>
Co-authored-by: Amia <9750071+aamiaa@users.noreply.github.com>
Co-authored-by: AutumnVN <autumnvnchino@gmail.com>
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
This commit is contained in:
vee 2024-06-19 04:36:21 +02:00 committed by GitHub
parent d6f1209438
commit d19b0aeb5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 58 additions and 63 deletions

View file

@ -18,8 +18,10 @@
import { Settings } from "@api/Settings";
import { Devs } from "@utils/constants";
import { Logger } from "@utils/Logger";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack";
import { Message } from "discord-types/general";
const RelationshipStore = findByPropsLazy("getRelationships", "isBlocked");
@ -59,6 +61,12 @@ export default definePlugin({
restartNeeded: true,
},
},
isBlocked: message =>
RelationshipStore.isBlocked(message.author.id)
isBlocked(message: Message) {
try {
return RelationshipStore.isBlocked(message.author.id);
} catch (e) {
new Logger("NoBlockedMessages").error("Failed to check if user is blocked:", e);
}
}
});