Compare commits

..

1 Commits

Author SHA1 Message Date
Lewis Crichton
fb963b6887 ci: automatically enforce contributor requirement on issues 2023-11-11 10:39:05 +00:00
12 changed files with 89 additions and 27 deletions

View File

@ -0,0 +1,45 @@
name: Enforce contributor requirement
on:
issues:
types:
- created
jobs:
enforcement:
runs-on: ubuntu-latest
steps:
- name: Delay to allow contributor comment
run: sleep 180
- name: Find potential contributor comment
uses: peter-evans/find-comment@d362b58d73ad53d089dd54460397ec1b8b47dbfd
id: comment
with:
issue-number: ${{ github.event.number }}
body-includes: /ok
- name: Check commenter is contributor
uses: actions-cool/check-user-permission@a0668c9aec87f3875fc56170b6452a453e9dd819
id: comment-contrib
if: ${{ !steps.comment.outputs.comment-id }}
with:
username: ${{ steps.comment.outputs.comment-author }}
check-contributor: true
- name: Check author is contributor
uses: actions-cool/check-user-permission@a0668c9aec87f3875fc56170b6452a453e9dd819
id: author-contrib
if: ${{ !steps.comment-contrib.check-result }}
with:
# no username means it checks the person who triggered the workflow run i.e. the issue creator
check-contributor: true
- name: Tag and close issue
if: ${{ !steps.comment-contrib.check-result && !steps.author-contrib.check-result }}
run: |
gh issue close $ISSUE -c "Your issue does not comply with our contributor requirement. Please do not ignore the issue template." -r "not planned"
gh issue edit $ISSUE --add-label "ignored contributor requirement"
gh issue lock $ISSUE
env:
ISSUE: ${{ github.event.issue.html_url }}

View File

@ -4,9 +4,7 @@
The cutest Discord client mod
| ![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) |
![image](https://github.com/Vendicated/Vencord/assets/45497981/706722b1-32de-4d99-bee9-93993b504334)
## Features
@ -30,14 +28,6 @@ Visit https://vencord.dev/download
https://discord.gg/D9uwnFnqmd
## Sponsors
| **Thanks a lot to all Vencord [sponsors](https://github.com/sponsors/Vendicated)!!** |
|:--:|
| [![](https://meow.vendicated.dev/sponsors.png)](https://github.com/sponsors/Vendicated) |
| *generated using [github-sponsor-graph](https://github.com/Vendicated/github-sponsor-graph)* |
## Star History
<a href="https://star-history.com/#Vendicated/Vencord&Timeline">

View File

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

View File

@ -50,7 +50,7 @@ async function embedDidMount(this: Component<Props>) {
const { titles, thumbnails } = await res.json();
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;
@ -58,12 +58,12 @@ async function embedDidMount(this: Component<Props>) {
enabled: true
};
if (hasTitle) {
if (titles[0]?.votes >= 0) {
embed.dearrow.oldTitle = embed.rawTitle;
embed.rawTitle = titles[0].title;
}
if (hasThumb) {
if (thumbnails[0]?.votes >= 0 && thumbnails[0].timestamp) {
embed.dearrow.oldThumb = embed.thumbnail.proxyURL;
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"',
replacement: {

View File

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

View File

@ -26,13 +26,15 @@ export default definePlugin({
authors: [Devs.Ven, Devs.adryd],
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(s => s.replace("./oneko.gif", "https://raw.githubusercontent.com/adryd325/oneko.js/14bab15a755d0e35cd4ae19c931d96d306f99f42/oneko.gif"))
.then(eval);
},
stop() {
clearInterval(window.onekoInterval);
delete window.onekoInterval;
document.getElementById("oneko")?.remove();
}
});

View File

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

View File

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

View File

@ -68,7 +68,7 @@ export default definePlugin({
patches: [
{
// RenderLevel defines if a channel is hidden, collapsed in category, visible, etc
find: '"placeholder-channel-id"',
find: ".CannotShow=",
replacement: [
// 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
{
match: /(activeJoinedRelevantThreads:.{0,50}VIEW_CHANNEL.+?renderLevel:(.+?),threadIds.+?renderLevel:).+?(?=,threadIds)/g,
replace: (_, rest, defaultRenderLevel) => `${rest}${defaultRenderLevel}`
match: /(?<=renderLevel:(\i\(this,\i\)\?\i\.Show:\i\.WouldShowIfUncollapsed).+?renderLevel:).+?(?=,)/,
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
{

View File

@ -31,7 +31,7 @@ waitFor(["ComponentDispatch", "ComponentDispatcher"], m => ComponentDispatch = m
export const RestAPI: t.RestAPI = findByPropsLazy("getAPIBaseURL", "get");
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");