Compare commits

..

1 Commits

Author SHA1 Message Date
c9f0e8879d chore(deps): add renovate.json
All checks were successful
Sync to Codeberg / codeberg (push) Has been skipped
test / test (pull_request) Successful in 1m40s
2023-11-17 12:02:43 +00:00
12 changed files with 50 additions and 19 deletions

View File

@ -4,9 +4,7 @@
The cutest Discord client mod The cutest Discord client mod
| ![image](https://github.com/Vendicated/Vencord/assets/45497981/706722b1-32de-4d99-bee9-93993b504334) | ![image](https://github.com/Vendicated/Vencord/assets/45497981/706722b1-32de-4d99-bee9-93993b504334)
|:--:|
| A screenshot of vencord showcasing the [vencord-theme](https://github.com/synqat/vencord-theme) |
## Features ## Features

6
renovate.json Normal file
View File

@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>Fascinated/renovate-config"
]
}

View File

@ -32,8 +32,6 @@ function isNewer($new: string, old: string) {
} }
function patchLatest() { function patchLatest() {
if (process.env.DISABLE_UPDATER_AUTO_PATCHING) return;
try { try {
const currentAppPath = dirname(process.execPath); const currentAppPath = dirname(process.execPath);
const currentVersion = basename(currentAppPath); const currentVersion = basename(currentAppPath);

View File

@ -50,7 +50,7 @@ async function embedDidMount(this: Component<Props>) {
const { titles, thumbnails } = await res.json(); const { titles, thumbnails } = await res.json();
const hasTitle = titles[0]?.votes >= 0; const hasTitle = titles[0]?.votes >= 0;
const hasThumb = thumbnails[0]?.votes >= 0 && !thumbnails[0].original; const hasThumb = thumbnails[0]?.votes >= 0;
if (!hasTitle && !hasThumb) return; if (!hasTitle && !hasThumb) return;
@ -58,12 +58,12 @@ async function embedDidMount(this: Component<Props>) {
enabled: true enabled: true
}; };
if (hasTitle) { if (titles[0]?.votes >= 0) {
embed.dearrow.oldTitle = embed.rawTitle; embed.dearrow.oldTitle = embed.rawTitle;
embed.rawTitle = titles[0].title; embed.rawTitle = titles[0].title;
} }
if (hasThumb) { if (thumbnails[0]?.votes >= 0 && thumbnails[0].timestamp) {
embed.dearrow.oldThumb = embed.thumbnail.proxyURL; embed.dearrow.oldThumb = embed.thumbnail.proxyURL;
embed.thumbnail.proxyURL = `https://dearrow-thumb.ajay.app/api/v1/getThumbnail?videoID=${videoId}&time=${thumbnails[0].timestamp}`; embed.thumbnail.proxyURL = `https://dearrow-thumb.ajay.app/api/v1/getThumbnail?videoID=${videoId}&time=${thumbnails[0].timestamp}`;
} }

View File

@ -77,6 +77,15 @@ export default definePlugin({
} }
] ]
}, },
// Fix search history being disabled / broken with isStaff
{
find: '("showNewSearch")',
predicate: () => settings.store.enableIsStaff,
replacement: {
match: /(?<=showNewSearch"\);return)\s?/,
replace: "!1&&"
}
},
{ {
find: 'H1,title:"Experiments"', find: 'H1,title:"Experiments"',
replacement: { replacement: {

View File

@ -302,7 +302,6 @@ export default definePlugin({
match: /attachments:(\i)\((\i)\)/, match: /attachments:(\i)\((\i)\)/,
replace: replace:
"attachments: $1((() => {" + "attachments: $1((() => {" +
" if ($self.shouldIgnore($2)) return $2;" +
" let old = arguments[1]?.attachments;" + " let old = arguments[1]?.attachments;" +
" if (!old) return $2;" + " if (!old) return $2;" +
" let new_ = $2.attachments?.map(a => a.id) ?? [];" + " let new_ = $2.attachments?.map(a => a.id) ?? [];" +

View File

@ -25,6 +25,10 @@ import definePlugin, { OptionType } from "@utils/types";
const EMOTE = "<:luna:1035316192220553236>"; const EMOTE = "<:luna:1035316192220553236>";
const DATA_KEY = "MessageTags_TAGS"; const DATA_KEY = "MessageTags_TAGS";
const MessageTagsMarker = Symbol("MessageTags"); const MessageTagsMarker = Symbol("MessageTags");
const author = {
id: "821472922140803112",
bot: false
};
interface Tag { interface Tag {
name: string; name: string;
@ -55,12 +59,14 @@ function createTagCommand(tag: Tag) {
execute: async (_, ctx) => { execute: async (_, ctx) => {
if (!await getTag(tag.name)) { if (!await getTag(tag.name)) {
sendBotMessage(ctx.channel.id, { sendBotMessage(ctx.channel.id, {
author,
content: `${EMOTE} The tag **${tag.name}** does not exist anymore! Please reload ur Discord to fix :)` content: `${EMOTE} The tag **${tag.name}** does not exist anymore! Please reload ur Discord to fix :)`
}); });
return { content: `/${tag.name}` }; return { content: `/${tag.name}` };
} }
if (Settings.plugins.MessageTags.clyde) sendBotMessage(ctx.channel.id, { if (Settings.plugins.MessageTags.clyde) sendBotMessage(ctx.channel.id, {
author,
content: `${EMOTE} The tag **${tag.name}** has been sent!` content: `${EMOTE} The tag **${tag.name}** has been sent!`
}); });
return { content: tag.message.replaceAll("\\n", "\n") }; return { content: tag.message.replaceAll("\\n", "\n") };
@ -156,6 +162,7 @@ export default definePlugin({
if (await getTag(name)) if (await getTag(name))
return sendBotMessage(ctx.channel.id, { return sendBotMessage(ctx.channel.id, {
author,
content: `${EMOTE} A Tag with the name **${name}** already exists!` content: `${EMOTE} A Tag with the name **${name}** already exists!`
}); });
@ -169,6 +176,7 @@ export default definePlugin({
await addTag(tag); await addTag(tag);
sendBotMessage(ctx.channel.id, { sendBotMessage(ctx.channel.id, {
author,
content: `${EMOTE} Successfully created the tag **${name}**!` content: `${EMOTE} Successfully created the tag **${name}**!`
}); });
break; // end 'create' break; // end 'create'
@ -178,6 +186,7 @@ export default definePlugin({
if (!await getTag(name)) if (!await getTag(name))
return sendBotMessage(ctx.channel.id, { return sendBotMessage(ctx.channel.id, {
author,
content: `${EMOTE} A Tag with the name **${name}** does not exist!` content: `${EMOTE} A Tag with the name **${name}** does not exist!`
}); });
@ -185,12 +194,14 @@ export default definePlugin({
await removeTag(name); await removeTag(name);
sendBotMessage(ctx.channel.id, { sendBotMessage(ctx.channel.id, {
author,
content: `${EMOTE} Successfully deleted the tag **${name}**!` content: `${EMOTE} Successfully deleted the tag **${name}**!`
}); });
break; // end 'delete' break; // end 'delete'
} }
case "list": { case "list": {
sendBotMessage(ctx.channel.id, { sendBotMessage(ctx.channel.id, {
author,
embeds: [ embeds: [
{ {
// @ts-ignore // @ts-ignore
@ -213,10 +224,12 @@ export default definePlugin({
if (!tag) if (!tag)
return sendBotMessage(ctx.channel.id, { return sendBotMessage(ctx.channel.id, {
author,
content: `${EMOTE} A Tag with the name **${name}** does not exist!` content: `${EMOTE} A Tag with the name **${name}** does not exist!`
}); });
sendBotMessage(ctx.channel.id, { sendBotMessage(ctx.channel.id, {
author,
content: tag.message.replaceAll("\\n", "\n") content: tag.message.replaceAll("\\n", "\n")
}); });
break; // end 'preview' break; // end 'preview'
@ -224,6 +237,7 @@ export default definePlugin({
default: { default: {
sendBotMessage(ctx.channel.id, { sendBotMessage(ctx.channel.id, {
author,
content: "Invalid sub-command" content: "Invalid sub-command"
}); });
break; break;

View File

@ -26,13 +26,15 @@ export default definePlugin({
authors: [Devs.Ven, Devs.adryd], authors: [Devs.Ven, Devs.adryd],
start() { start() {
fetch("https://raw.githubusercontent.com/adryd325/oneko.js/8fa8a1864aa71cd7a794d58bc139e755e96a236c/oneko.js") fetch("https://raw.githubusercontent.com/adryd325/oneko.js/5977144dce83e4d71af1de005d16e38eebeb7b72/oneko.js")
.then(x => x.text()) .then(x => x.text())
.then(s => s.replace("./oneko.gif", "https://raw.githubusercontent.com/adryd325/oneko.js/14bab15a755d0e35cd4ae19c931d96d306f99f42/oneko.gif")) .then(s => s.replace("./oneko.gif", "https://raw.githubusercontent.com/adryd325/oneko.js/14bab15a755d0e35cd4ae19c931d96d306f99f42/oneko.gif"))
.then(eval); .then(eval);
}, },
stop() { stop() {
clearInterval(window.onekoInterval);
delete window.onekoInterval;
document.getElementById("oneko")?.remove(); document.getElementById("oneko")?.remove();
} }
}); });

View File

@ -100,10 +100,10 @@ export default definePlugin({
}, },
{ {
// Fix getRowHeight's check for whether this is the DMs section // Fix getRowHeight's check for whether this is the DMs section
// DMS (inlined) === section // section === DMS
match: /(?<=getRowHeight=\(.{2,50}?)1===\i/, match: /===\i\.DMS&&0/,
// DMS (inlined) === section - 1 // section -1 === DMS
replace: "$&-1" replace: "-1$&"
}, },
{ {
// Override scrollToChannel to properly account for pinned channels // Override scrollToChannel to properly account for pinned channels

View File

@ -67,7 +67,7 @@ export default definePlugin({
createHighlighter, createHighlighter,
renderHighlighter: ({ lang, content }: { lang: string; content: string; }) => { renderHighlighter: ({ lang, content }: { lang: string; content: string; }) => {
return createHighlighter({ return createHighlighter({
lang: lang?.toLowerCase(), lang,
content, content,
isPreview: false, isPreview: false,
}); });

View File

@ -68,7 +68,7 @@ export default definePlugin({
patches: [ patches: [
{ {
// RenderLevel defines if a channel is hidden, collapsed in category, visible, etc // RenderLevel defines if a channel is hidden, collapsed in category, visible, etc
find: '"placeholder-channel-id"', find: ".CannotShow=",
replacement: [ replacement: [
// Remove the special logic for channels we don't have access to // Remove the special logic for channels we don't have access to
{ {
@ -82,8 +82,13 @@ export default definePlugin({
}, },
// Make channels we dont have access to be the same level as normal ones // Make channels we dont have access to be the same level as normal ones
{ {
match: /(activeJoinedRelevantThreads:.{0,50}VIEW_CHANNEL.+?renderLevel:(.+?),threadIds.+?renderLevel:).+?(?=,threadIds)/g, match: /(?<=renderLevel:(\i\(this,\i\)\?\i\.Show:\i\.WouldShowIfUncollapsed).+?renderLevel:).+?(?=,)/,
replace: (_, rest, defaultRenderLevel) => `${rest}${defaultRenderLevel}` replace: (_, renderLevelExpression) => renderLevelExpression
},
// Make channels we dont have access to be the same level as normal ones
{
match: /(?<=activeJoinedRelevantThreads.+?renderLevel:.+?,threadIds:\i\(this.record.+?renderLevel:)(\i)\..+?(?=,)/,
replace: (_, RenderLevels) => `${RenderLevels}.Show`
}, },
// Remove permission checking for getRenderLevel function // Remove permission checking for getRenderLevel function
{ {

View File

@ -31,7 +31,7 @@ waitFor(["ComponentDispatch", "ComponentDispatcher"], m => ComponentDispatch = m
export const RestAPI: t.RestAPI = findByPropsLazy("getAPIBaseURL", "get"); export const RestAPI: t.RestAPI = findByPropsLazy("getAPIBaseURL", "get");
export const moment: typeof import("moment") = findByPropsLazy("parseTwoDigitYear"); export const moment: typeof import("moment") = findByPropsLazy("parseTwoDigitYear");
export const hljs: typeof import("highlight.js") = findByPropsLazy("highlight", "registerLanguage"); export const hljs: typeof import("highlight.js") = findByPropsLazy("highlight");
export const lodash: typeof import("lodash") = findByPropsLazy("debounce", "cloneDeep"); export const lodash: typeof import("lodash") = findByPropsLazy("debounce", "cloneDeep");