Update GuildStore -> GuildRoleStore

This commit is contained in:
Vendicated 2025-06-27 21:36:31 +02:00
parent 864ee7c7ad
commit 65f41cb7bd
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
11 changed files with 30 additions and 22 deletions

View file

@ -10,7 +10,7 @@ import { Devs } from "@utils/constants";
import { Logger } from "@utils/Logger";
import definePlugin, { OptionType, PluginNative, ReporterTestable } from "@utils/types";
import { findByCodeLazy, findLazy } from "@webpack";
import { Button, ChannelStore, GuildStore, UserStore } from "@webpack/common";
import { Button, ChannelStore, GuildRoleStore, GuildStore, UserStore } from "@webpack/common";
import type { Channel, Embed, GuildMember, MessageAttachment, User } from "discord-types/general";
const ChannelTypes = findLazy(m => m.ANNOUNCEMENT_THREAD === 10);
@ -267,7 +267,7 @@ export default definePlugin({
// color role mentions (unity styling btw lol)
if (message.mention_roles.length > 0) {
for (const roleId of message.mention_roles) {
const role = GuildStore.getRole(channel.guild_id, roleId);
const role = GuildRoleStore.getRole(channel.guild_id, roleId);
if (!role) continue;
const roleColor = role.colorString ?? `#${pingColor}`;
finalMsg = finalMsg.replace(`<@&${roleId}>`, `<b><color=${roleColor}>@${role.name}</color></b>`);