Skip to content

feat(plugin): server tag everywhere#4231

Closed
oatsfx wants to merge 3 commits into
Vendicated:mainfrom
oatsfx:server-tag-everywhere
Closed

feat(plugin): server tag everywhere#4231
oatsfx wants to merge 3 commits into
Vendicated:mainfrom
oatsfx:server-tag-everywhere

Conversation

@oatsfx

@oatsfx oatsfx commented May 18, 2026

Copy link
Copy Markdown

Similar to RoleColorEverywhere, this plugin adds a server tag everywhere, specificially to 4 locations: Server Tooltip, Server Header, App Title Bar, and User Name Tag.

There are toggles for each location in plugin settings.

image image

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the ServerTagEverywhere plugin, which displays server tags in various UI locations such as tooltips, headers, and the title bar. The review feedback identifies several critical issues: the use of this.props in a patch may cause crashes in functional components, guild.profile is likely to be undefined and should be accessed via a proper store, the variable vcGuild is being assigned without a declaration (polluting the global scope), and injecting a style prop directly may overwrite existing component styles.

find: ".DISPLAY_NAME_STYLES_COACHMARK)",
replacement: {
match: /children:\(0,(\i).jsx\)\((\i).(\i),\{userN(.+?)\}\)/,
replace: "children:[(0,$1.jsx)($2.$3,{userN$4}),$self.renderUser(this.props.currentUser)]"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using this.props.currentUser assumes that the patched component is a class component. Most modern Discord components have been migrated to functional components, where this is undefined. If this is a functional component, this patch will cause a crash. You should instead capture the user object from the local scope of the component if possible.

],

renderTooltip: ErrorBoundary.wrap((guild) =>
guild.profile &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Standard Guild objects in Discord's internal stores typically do not have a profile property. Guild identity data (tags and badges) is usually stored separately or requires a specific fetch. Accessing guild.profile here might result in undefined, causing the tag not to render. You should verify if guild.profile is actually available on the objects you are patching or consider using a store like GuildProfileStore to retrieve this information.

find: "?\"BACK_FORWARD_NAVIGATION\":",
replacement: {
match: /guild_id,(\i)=(.+?)getGuild\((\i)\),\[(\i)\]\),/,
replace: "$&vcGuild = $1,"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Assigning to vcGuild without a declaration (var, let, or const) will create a global variable on the window object. This is generally discouraged as it pollutes the global namespace. If you need to share this variable between patches, it's better to explicitly use window.vcGuild or, preferably, find a way to keep it local to the component's scope.

find: "?\"BACK_FORWARD_NAVIGATION\":",
replacement: {
match: /children:(\i)\}\)\]/,
replace: "style:{display:\"flex\",alignItems:\"center\"},children:[$1, $self.renderTitleBar(vcGuild)]})]"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Adding a style property directly to the props object may overwrite any existing style prop that the component already has. It is safer to merge the styles if they exist, although in this specific title bar context, it might be acceptable if you are certain no other styles are being applied to this element.

@Vendicated

Copy link
Copy Markdown
Owner

too niche

@Vendicated Vendicated closed this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants