mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-18 21:33:35 -05:00
Fix most patches
This commit is contained in:
parent
e0098deaab
commit
3cf79ec436
6 changed files with 15 additions and 9 deletions
|
@ -34,7 +34,7 @@ export default definePlugin({
|
|||
{
|
||||
find: '#{intl::SERVERS}"]),children',
|
||||
replacement: {
|
||||
match: /(?<=#{intl::SERVERS}\),children:)\i\.map\(\i\)/,
|
||||
match: /(?<=#{intl::SERVERS}"\]\),children:)\i\.map\(\i\)/,
|
||||
replace: "Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ export default definePlugin({
|
|||
patches: [{
|
||||
find: "#{intl::BEGINNING_DM}",
|
||||
replacement: {
|
||||
match: /#{intl::BEGINNING_DM}"],{.+?}\),(?=.{0,300}(\i)\.isMultiUserDM)/,
|
||||
match: /#{intl::BEGINNING_DM}"\],{.+?}\),(?=.{0,300}(\i)\.isMultiUserDM)/,
|
||||
replace: "$& $self.renderContributorDmWarningCard({ channel: $1 }),"
|
||||
}
|
||||
}],
|
||||
|
|
|
@ -41,7 +41,7 @@ export default definePlugin({
|
|||
{
|
||||
find: "DefaultCustomizationSections",
|
||||
replacement: {
|
||||
match: /(?<=#{intl::USER_SETTINGS_AVATAR_DECORATION}\)},"decoration"\),)/,
|
||||
match: /(?<=#{intl::USER_SETTINGS_AVATAR_DECORATION}"\]\)},"decoration"\),)/,
|
||||
replace: "$self.DecorSection(),"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -128,7 +128,7 @@ export default definePlugin({
|
|||
{
|
||||
find: "#{intl::USER_SETTINGS_RESET_PROFILE_THEME}",
|
||||
replacement: {
|
||||
match: /#{intl::USER_SETTINGS_RESET_PROFILE_THEME}\)}\)(?<=color:(\i),.{0,500}?color:(\i),.{0,500}?)/,
|
||||
match: /#{intl::USER_SETTINGS_RESET_PROFILE_THEME}"\]\)}\)(?<=color:(\i),.{0,500}?color:(\i),.{0,500}?)/,
|
||||
replace: "$&,$self.addCopy3y3Button({primary:$1,accent:$2})"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ export default definePlugin({
|
|||
{
|
||||
find: "#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}",
|
||||
replacement: {
|
||||
match: /#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}"]\)/,
|
||||
match: /#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}"\]\)/,
|
||||
replace: "$&,onMouseEnter:()=>$self.fetchReply(arguments[0])"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -23,11 +23,17 @@ export function canonicalizeMatch<T extends RegExp | string>(match: T): T {
|
|||
let partialCanon = typeof match === "string" ? match : match.source;
|
||||
partialCanon = partialCanon.replaceAll(/#{intl::([A-Za-z_$][\w$]*)}/g, (_, key) => {
|
||||
const hashed = runtimeHashMessageKey(key);
|
||||
const isStr = typeof match === "string";
|
||||
|
||||
return /^[\d]/.test(hashed) || !/^[\w$]+$/.test(hashed)
|
||||
? isStr ? `["${hashed}` : String.raw`(?:\["${hashed})`
|
||||
: isStr ? `.${hashed}` : String.raw`(?:\.${hashed})`;
|
||||
const isString = typeof match === "string";
|
||||
const hasSpecialChars = /^[\d]/.test(hashed) || !/^[\w$]+$/.test(hashed);
|
||||
|
||||
if (hasSpecialChars) {
|
||||
return isString
|
||||
? `["${hashed}`
|
||||
: String.raw`(?:\["${hashed})`.replaceAll("+", "\\+");
|
||||
}
|
||||
|
||||
return isString ? `.${hashed}` : String.raw`(?:\.${hashed})`;
|
||||
});
|
||||
|
||||
if (typeof match === "string") {
|
||||
|
|
Loading…
Reference in a new issue