Update GuildStore -> GuildRoleStore
This commit is contained in:
parent
864ee7c7ad
commit
65f41cb7bd
11 changed files with 30 additions and 22 deletions
|
|
@ -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>`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue