Update Kyuu Plugins

This commit is contained in:
thororen1234 2024-07-13 01:30:19 -04:00
parent cb57be9e01
commit f4d04f12ad
6 changed files with 211 additions and 6 deletions

View file

@ -31,8 +31,10 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
- BlockKrsip by D3SOX
- BypassDND by Inbestigator
- CleanChannelName by AutumnVN
- ColorMessage by Kyuuhachi
- CopyUserMention by Cortex and castdrian
- CustomAppIcons by Happy Enderman and SerStars
- DeadMembers by Kyuuhachi
- DiscordColorways by DaBluLite
- DNDWhilePlaying by thororen
- DoNotLeak by Perny
@ -76,6 +78,7 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
- SoundBoardLogger by Moxxie, fres, echo, thororen
- TalkInReverse by Tolgchu
- ThemeLibrary by Fafa
- Title by Kyuuhachi
- UnlimitedAccounts by Balaclava and thororen
- UserPFP by nexpid and thororen
- VCSupport by thororen

View file

@ -27,6 +27,12 @@ export const settings = definePluginSettings({
description: "Remove gift button",
restartNeeded: true,
},
emojiList: {
type: OptionType.BOOLEAN,
default: true,
description: "Remove unavailable categories from the emoji picker",
restartNeeded: true,
},
});
export default definePlugin({
@ -66,10 +72,16 @@ export default definePlugin({
},
{ // Settings, sidebar
find: "Messages.BILLING_SETTINGS",
replacement: {
match: /\{header:[^:,]*\.Messages.BILLING_SETTINGS,[^}]*\]},/,
replace: "/*$&*/"
},
replacement: [
{
match: /(?<=Messages.BILLING_SETTINGS,)/,
replace: "capitalism:true,"
},
{
match: /\i\?\i:\i\.toSpliced\(3,0,\i\)/,
replace: "($&).filter(e=>!e.capitalism)",
},
],
predicate: () => settings.store.billing,
},
{ // Gift button
@ -79,6 +91,22 @@ export default definePlugin({
replace: "return null;",
},
predicate: () => settings.store.gift,
},
{ // Emoji list
find: "Messages.EMOJI_PICKER_CREATE_EMOJI_TITLE,size:",
replacement: {
match: /(\w+)=!\w+&&\w+.\i.isEmojiCategoryNitroLocked\(\{[^}]*\}\);/,
replace: "$&$1||"
},
predicate: () => settings.store.emojiList,
},
{ // Emoji category list
find: "Messages.EMOJI_CATEGORY_TOP_GUILD_EMOJI.format({",
replacement: {
match: /(?<=(\i)\.unshift\((\i)\):)(?=\1\.push\(\2\))/,
replace: "$2.isNitroLocked||"
},
predicate: () => settings.store.emojiList,
}
],
});

View file

@ -0,0 +1,62 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { definePluginSettings } from "@api/Settings";
import * as Styles from "@api/Styles";
import { makeRange } from "@components/PluginSettings/components";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { findByCodeLazy } from "@webpack";
const useMessageAuthor = findByCodeLazy('"Result cannot be null because the message is not null"');
import style from "./style.css?managed";
export const settings = definePluginSettings({
saturation: {
type: OptionType.SLIDER,
description: "Message color saturation",
markers: makeRange(0, 100, 10),
default: 20,
onChange() {
updateStyle();
},
},
});
function updateStyle() {
(Styles.requireStyle(style).dom!.sheet!.cssRules[0] as CSSStyleRule)
.style.setProperty("--98-message-color-saturation", `${settings.store.saturation}`);
}
export default definePlugin({
name: "ColorMessage",
description: "Colors message content with author's role color",
authors: [Devs.Kyuuhachi],
settings,
patches: [
{
find: '.Messages.MESSAGE_EDITED,")"',
replacement: {
match: /(?<=isUnsupported\]:(\i)\.isUnsupported\}\),)(?=children:\[)/,
replace: 'style:{"--98-message-color":$self.useMessageColor($1)},'
}
},
],
useMessageColor(messageId: string) {
return useMessageAuthor(messageId).colorString;
},
start() {
Styles.enableStyle(style);
updateStyle();
},
stop() {
Styles.disableStyle(style);
},
});

View file

@ -0,0 +1,62 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { ChannelStore, GuildMemberStore, useStateFromStores } from "@webpack/common";
export default definePlugin({
name: "DeadMembers",
description: "Shows when the sender of a message has left the guild",
authors: [Devs.Kyuuhachi],
patches: [
{
find: '.BADGES=1]="BADGES"',
replacement: {
match: /(\i)=\{className:\i.username,style:.*?onContextMenu:\i,children:.*?\},/,
replace: "$&__dummyvar=($1.children=$self.wrapMessageAuthor(arguments[0],$1.children)),"
}
},
{
find: "Messages.FORUM_POST_AUTHOR_A11Y_LABEL",
replacement: {
match: /(?<=\}=(\i),\{(user:\i,author:\i)\}=.{0,400}?\(\i\.Fragment,{children:)\i(?=}\),)/,
replace: "$self.wrapForumAuthor({...$1,$2},$&)"
}
},
],
wrapMessageAuthor({ message }, text) {
const channel = ChannelStore.getChannel(message.channel_id);
return message.webhookId
? text
: <DeadIndicator
channel={channel}
userId={message.author.id}
text={text}
/>;
},
wrapForumAuthor({ channel, user }, text) {
return !user
? text
: <DeadIndicator
channel={channel}
userId={user.id}
text={text}
/>;
},
});
function DeadIndicator({ channel, userId, text }) {
const isMember = useStateFromStores(
[GuildMemberStore],
() => GuildMemberStore.isMember(channel?.guild_id, userId),
);
return channel?.guild_id && !isMember ? <s className="c98-author-dead">{text}</s> : text;
}

View file

@ -38,7 +38,7 @@ const { Spinner } = proxyLazy(() => Forms as any as {
SpinnerTypes: typeof SpinnerTypes;
});
const ChannelMessage = findComponentByCodeLazy("childrenExecutedCommand:", ".hideAccessories");
const ChannelMessage = findComponentByCodeLazy("isFirstMessageInForumPost", "trackAnnouncementViews") as ComponentType<any>;
export default definePlugin({
name: "MessageLinkTooltip",
@ -49,7 +49,7 @@ export default definePlugin({
{
find: ',className:"channelMention",children:[',
replacement: {
match: /(?<=\.jsxs\)\()(\i\.\i)/,
match: /(?<=\.jsxs\)\()(\i\.\i)(?=,\{role:"link")/,
replace: "$self.wrapComponent(arguments[0], $1)"
}
}

View file

@ -0,0 +1,50 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { findByCodeLazy } from "@webpack";
const flashPageTitle = findByCodeLazy("=>({flashQueue:[...");
const rootTitle = { base: null as string | null };
export const settings = definePluginSettings({
title: {
type: OptionType.STRING,
default: "Vencord",
description: "Window title prefix",
onChange: setTitle,
},
});
function setTitle(v: string) {
rootTitle.base = v || null;
flashPageTitle({ messages: 0 })();
}
export default definePlugin({
name: "Title",
description: "Replaces the window title prefix",
authors: [Devs.Kyuuhachi],
settings,
patches: [
{
find: 'isPlatformEmbedded?void 0:"Discord"',
replacement: {
match: /\{base:\i\("?\d+?"?\)\.isPlatformEmbedded\?void 0:"Discord"\}/,
replace: "$self.rootTitle",
},
},
],
start() {
setTitle(settings.store.title);
},
rootTitle,
});