Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3680c26f72 | ||
|
683c92f904 | ||
|
3410ed024f | ||
|
dbad10984a | ||
|
55543d8640 | ||
|
263fbc377e | ||
|
c9c0ab5aca | ||
|
7b2bf08b8f | ||
|
43011825af | ||
|
4abcea61f8 | ||
|
cba810cab5 | ||
|
5938c7d67c | ||
|
99d8b8b75f | ||
|
503d49d295 | ||
|
137b79d95b |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -50,6 +50,7 @@ jobs:
|
|||||||
echo "release_tag=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
echo "release_tag=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Upload DevBuild as release
|
- name: Upload DevBuild as release
|
||||||
|
if: github.repository == 'Vendicated/Vencord'
|
||||||
run: |
|
run: |
|
||||||
gh release upload devbuild --clobber dist/*
|
gh release upload devbuild --clobber dist/*
|
||||||
gh release edit devbuild --title "DevBuild $RELEASE_TAG"
|
gh release edit devbuild --title "DevBuild $RELEASE_TAG"
|
||||||
@ -58,6 +59,7 @@ jobs:
|
|||||||
RELEASE_TAG: ${{ env.release_tag }}
|
RELEASE_TAG: ${{ env.release_tag }}
|
||||||
|
|
||||||
- name: Upload DevBuild to builds repo
|
- name: Upload DevBuild to builds repo
|
||||||
|
if: github.repository == 'Vendicated/Vencord'
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "$USERNAME"
|
git config --global user.name "$USERNAME"
|
||||||
git config --global user.email actions@github.com
|
git config --global user.email actions@github.com
|
||||||
|
1
.github/workflows/codeberg-mirror.yml
vendored
1
.github/workflows/codeberg-mirror.yml
vendored
@ -7,6 +7,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
codeberg:
|
codeberg:
|
||||||
|
if: github.repository == 'Vendicated/Vencord'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
1
.github/workflows/publish.yml
vendored
1
.github/workflows/publish.yml
vendored
@ -6,6 +6,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Publish:
|
Publish:
|
||||||
|
if: github.repository == 'Vendicated/Vencord'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
1
.github/workflows/reportBrokenPlugins.yml
vendored
1
.github/workflows/reportBrokenPlugins.yml
vendored
@ -7,6 +7,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
TestPlugins:
|
TestPlugins:
|
||||||
|
if: github.repository == 'Vendicated/Vencord'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
9
.vscode/settings.json
vendored
9
.vscode/settings.json
vendored
@ -12,5 +12,12 @@
|
|||||||
"javascript.format.semicolons": "insert",
|
"javascript.format.semicolons": "insert",
|
||||||
"typescript.format.semicolons": "insert",
|
"typescript.format.semicolons": "insert",
|
||||||
"typescript.preferences.quoteStyle": "double",
|
"typescript.preferences.quoteStyle": "double",
|
||||||
"javascript.preferences.quoteStyle": "double"
|
"javascript.preferences.quoteStyle": "double",
|
||||||
|
|
||||||
|
"gitlens.remotes": [
|
||||||
|
{
|
||||||
|
"domain": "codeberg.org",
|
||||||
|
"type": "Gitea"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
25
.vscode/tasks.json
vendored
Normal file
25
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Build",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "pnpm build",
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Watch",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "pnpm watch",
|
||||||
|
"problemMatcher": [],
|
||||||
|
"group": {
|
||||||
|
"kind": "build"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -1,7 +1,8 @@
|
|||||||
# Vencord
|
# Vencord
|
||||||
|
|
||||||
The cutest Discord client mod
|
[![Codeberg Mirror](https://img.shields.io/static/v1?style=for-the-badge&label=Codeberg%20Mirror&message=codeberg.org/Ven/cord&color=2185D0&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QA/wD/AP+gvaeTAAAKbUlEQVR4nNVae3AV5RX/nW/3Pva+b24e5HHzIICQKGoiYiW8NFBFgohaa6ctglpbFSujSGurzUinohWsOij/gGX6R2fqOK0d1FYTEZXaTrWCBbEikJCEyCvkeXNvkrunf+zdkJDkPnex/c3cmd29+53v/M6e73znnF2Cydj4Tntldzi6qrN/qKqzf2jy6b7BnL4B1dI7oMp9AyoRAIdVsNMqhlxWMZjtspzyK/Jhr036OMsm//bh2vzPzNSPzBD6xFutd7R0Dq758ky4orkjYuc05RCAkixbeEq2/UCJ1/LczxcX/c5IPfU5DMHmxpbCpu7o1k/b+xc1n43YjJI7EqV+W2RmvuPt0oDjB2vn5bQbITNjAzzdeKK8qTO0bU9T77zucNQUjzofHrvENWWu3aUBZfW6+ZOOZiIrbYXrmUXo9daX3v6i667O/iGRiRLpwqtIvKDc+0efJ3hb/UIaSkdGWgZ4sqGt9r2m3lc/P9HvSWe80ZiRp3TPL/UsX1+bvyvVsSkb4NE3WjbuPNj5SM8Fcvdk4bAKrqvwv7DxhuCPUxmXNIn6XSy3nWr6R8OhrqrU1btwqJ3m/bgwu/SqZJdEUgbYsuuka09b9/4Pm3tLMlPvwu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TpW4HiCJgFWzstmnSPA7ZLU827pypPwxDB/687GXl1X6Vs6bbGz/LRN80hZCT+yLFZ0cgHED4egACeiXm89GsP9EePuzy4rvGil7jAGYmQDsBjDHUBYZ4GhHBMfORigd4rpnyIS9u6d4rqgnGrUtjCmmSYuOqwB0GcwjbWh9xviurpNnxnDA1IspMPe6bOL755MHJvhKjIgOA7jbJD4pw22Thj+kSIW47h2KRaydVezeP57sCdspRPQqgGeNJJIuBAE+ReJUiOv32mXaXjPZs21C2QnmXgdghyEsMoRfkVMiDgCywF/by9z3xJMb1wCxeHAPgDczZpAh/Iq+HSYmDjCsstgThmf5t4ii8eQm7CgS0SCA5QBezoRApnBaBSyCEhIHCLJEb4ZUd+2SqZSwzE+qpUpEQ9CC4qb01M8cRIQsh8zxiKsMtsn08nvlnrpkyAPj5AGJwMw3AtgGwJ/q2ExxvHsQB74KxfKBMblAyGmTHq4pc4/5GjQeUm6qE9FrAK4E8H6ie41GlkN/jTk6F5Ak2ueUpNmpkgfSMAAAENERAAsB3AHgZDoy0oFdFnBYpXPEBfU4beLRD6Z4qmumug+kIzPjaoeZfQDWAHgAQFam8hLh4MkwWjsHemyS2OF08IYrCjynzZ4zKTCzi5nXMvOnzBw16bevIxR95JOj7DNKb1PqXWa+HMDtAGoBXII0lxq0N2OfAmgA8Hsi2muMhudgesHPzNkA5gKoADADwFRoS8UHQO+x9wLoBNAB4AsAnwM4AOADIjLVxf8L9kdXUOE0IskAAAAASUVORK5CYII=)](https://codeberg.org/Ven/cord)
|
||||||
|
|
||||||
|
The cutest Discord client mod
|
||||||
|
|
||||||
![](https://user-images.githubusercontent.com/45497981/235015332-0453d3eb-1da6-4601-963e-ef5e454123a1.png)
|
![](https://user-images.githubusercontent.com/45497981/235015332-0453d3eb-1da6-4601-963e-ef5e454123a1.png)
|
||||||
*A screenshot of Vencord featuring the [ClearVision-v6 theme](https://github.com/ClearVision/ClearVision-v6) (Vencord does not come with it pre-installed, it is only an example)*
|
*A screenshot of Vencord featuring the [ClearVision-v6 theme](https://github.com/ClearVision/ClearVision-v6) (Vencord does not come with it pre-installed, it is only an example)*
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "vencord",
|
"name": "vencord",
|
||||||
"private": "true",
|
"private": "true",
|
||||||
"version": "1.2.6",
|
"version": "1.2.7",
|
||||||
"description": "The cutest Discord client mod",
|
"description": "The cutest Discord client mod",
|
||||||
"homepage": "https://github.com/Vendicated/Vencord#readme",
|
"homepage": "https://github.com/Vendicated/Vencord#readme",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.vc-text-selectable,
|
.vc-text-selectable,
|
||||||
.vc-text-selectable :not(a, button, a *, button *, input, input *) {
|
.vc-text-selectable :where([class*="text" i], [class*="title" i]) {
|
||||||
/* make text selectable, silly discord makes the entirety of settings not selectable */
|
/* make text selectable, silly discord makes the entirety of settings not selectable */
|
||||||
user-select: text;
|
user-select: text;
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ export default definePlugin({
|
|||||||
document.addEventListener("keydown", keydown);
|
document.addEventListener("keydown", keydown);
|
||||||
document.addEventListener("keyup", keyup);
|
document.addEventListener("keyup", keyup);
|
||||||
|
|
||||||
this.onClick = addClickListener((msg, channel, event) => {
|
this.onClick = addClickListener((msg: any, channel, event) => {
|
||||||
const isMe = msg.author.id === UserStore.getCurrentUser().id;
|
const isMe = msg.author.id === UserStore.getCurrentUser().id;
|
||||||
if (!isDeletePressed) {
|
if (!isDeletePressed) {
|
||||||
if (event.detail < 2) return;
|
if (event.detail < 2) return;
|
||||||
@ -90,7 +90,16 @@ export default definePlugin({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (settings.store.enableDeleteOnClick && (isMe || PermissionStore.can(MANAGE_CHANNELS, channel))) {
|
} else if (settings.store.enableDeleteOnClick && (isMe || PermissionStore.can(MANAGE_CHANNELS, channel))) {
|
||||||
|
if (msg.deleted) {
|
||||||
|
FluxDispatcher.dispatch({
|
||||||
|
type: "MESSAGE_DELETE",
|
||||||
|
channelId: channel.id,
|
||||||
|
id: msg.id,
|
||||||
|
mlDeleted: true
|
||||||
|
});
|
||||||
|
} else {
|
||||||
MessageActions.deleteMessage(channel.id, msg.id);
|
MessageActions.deleteMessage(channel.id, msg.id);
|
||||||
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
.messagelogger-deleted :is(div, h1, h2, h3, p) {
|
/* Message content highlighting */
|
||||||
|
.messagelogger-deleted [class*="contents-"] > :is(div, h1, h2, h3, p) {
|
||||||
|
color: #f04747 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Embed highlighting */
|
||||||
|
.messagelogger-deleted article :is(div, span, h1, h2, h3, p) {
|
||||||
color: #f04747 !important;
|
color: #f04747 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,16 +2,29 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.messagelogger-deleted :is(video, .emoji, [data-type="sticker"]),
|
.messagelogger-deleted
|
||||||
.messagelogger-deleted .messagelogger-deleted-attachment,
|
:is(
|
||||||
.messagelogger-deleted div iframe {
|
video,
|
||||||
|
.emoji,
|
||||||
|
[data-type="sticker"],
|
||||||
|
iframe,
|
||||||
|
.messagelogger-deleted-attachment,
|
||||||
|
[class|="inlineMediaEmbed"]
|
||||||
|
) {
|
||||||
filter: grayscale(1) !important;
|
filter: grayscale(1) !important;
|
||||||
transition: 150ms filter ease-in-out;
|
transition: 150ms filter ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.messagelogger-deleted:hover :is(video, .emoji, [data-type="sticker"]),
|
.messagelogger-deleted
|
||||||
.messagelogger-deleted .messagelogger-deleted-attachment:hover,
|
:is(
|
||||||
.messagelogger-deleted iframe:hover {
|
video,
|
||||||
|
.emoji,
|
||||||
|
[data-type="sticker"],
|
||||||
|
iframe,
|
||||||
|
.messagelogger-deleted-attachment,
|
||||||
|
[class|="inlineMediaEmbed"]
|
||||||
|
):hover,
|
||||||
|
.messagelogger-deleted {
|
||||||
filter: grayscale(0) !important;
|
filter: grayscale(0) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
97
src/plugins/noPendingCount.ts
Normal file
97
src/plugins/noPendingCount.ts
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
* Vencord, a modification for Discord's desktop app
|
||||||
|
* Copyright (c) 2023 Vendicated and contributors
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import { definePluginSettings } from "@api/Settings";
|
||||||
|
import { Devs } from "@utils/constants";
|
||||||
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
|
import { findByPropsLazy } from "@webpack";
|
||||||
|
|
||||||
|
const MessageRequestStore = findByPropsLazy("getMessageRequestsCount");
|
||||||
|
|
||||||
|
const settings = definePluginSettings({
|
||||||
|
hideFriendRequestsCount: {
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
description: "Hide incoming friend requests count",
|
||||||
|
default: true,
|
||||||
|
restartNeeded: true
|
||||||
|
},
|
||||||
|
hideMessageRequestsCount: {
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
description: "Hide message requests count",
|
||||||
|
default: true,
|
||||||
|
restartNeeded: true
|
||||||
|
},
|
||||||
|
hidePremiumOffersCount: {
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
description: "Hide nitro offers count",
|
||||||
|
default: true,
|
||||||
|
restartNeeded: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default definePlugin({
|
||||||
|
name: "NoPendingCount",
|
||||||
|
description: "Removes the ping count of incoming friend requests, message requests, and nitro offers.",
|
||||||
|
authors: [Devs.amia],
|
||||||
|
|
||||||
|
settings: settings,
|
||||||
|
|
||||||
|
// Functions used to determine the top left count indicator can be found in the single module that calls getUnacknowledgedOffers(...)
|
||||||
|
// or by searching for "showProgressBadge:"
|
||||||
|
patches: [
|
||||||
|
{
|
||||||
|
find: ".getPendingCount=",
|
||||||
|
predicate: () => settings.store.hideFriendRequestsCount,
|
||||||
|
replacement: {
|
||||||
|
match: /(?<=\.getPendingCount=function\(\)\{)/,
|
||||||
|
replace: "return 0;"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
find: ".getMessageRequestsCount=",
|
||||||
|
predicate: () => settings.store.hideMessageRequestsCount,
|
||||||
|
replacement: {
|
||||||
|
match: /(?<=\.getMessageRequestsCount=function\(\)\{)/,
|
||||||
|
replace: "return 0;"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// This prevents the Message Requests tab from always hiding due to the previous patch (and is compatible with spam requests)
|
||||||
|
// In short, only the red badge is hidden. Button visibility behavior isn't changed.
|
||||||
|
{
|
||||||
|
find: ".getSpamChannelsCount(),",
|
||||||
|
predicate: () => settings.store.hideMessageRequestsCount,
|
||||||
|
replacement: {
|
||||||
|
match: /(?<=getSpamChannelsCount\(\),\i=)\i\.getMessageRequestsCount\(\)/,
|
||||||
|
replace: "$self.getRealMessageRequestCount()"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
find: "showProgressBadge:",
|
||||||
|
predicate: () => settings.store.hidePremiumOffersCount,
|
||||||
|
replacement: {
|
||||||
|
match: /\(function\(\){return \i\.\i\.getUnacknowledgedOffers\(\i\)\.length}\)/,
|
||||||
|
replace: "(function(){return 0})"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
getRealMessageRequestCount() {
|
||||||
|
return MessageRequestStore.getMessageRequestChannelIds().size;
|
||||||
|
}
|
||||||
|
});
|
53
src/plugins/noProfileThemes.ts
Normal file
53
src/plugins/noProfileThemes.ts
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* Vencord, a modification for Discord's desktop app
|
||||||
|
* Copyright (c) 2023 Vendicated and contributors
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { Devs } from "@utils/constants";
|
||||||
|
import definePlugin from "@utils/types";
|
||||||
|
|
||||||
|
export default definePlugin({
|
||||||
|
name: "NoProfileThemes",
|
||||||
|
description: "Completely removes Nitro profile themes",
|
||||||
|
authors: [Devs.TheKodeToad],
|
||||||
|
patches: [
|
||||||
|
{
|
||||||
|
find: ".NITRO_BANNER,",
|
||||||
|
replacement: {
|
||||||
|
// = isPremiumAtLeast(user.premiumType, TIER_2)
|
||||||
|
match: /=(?=\i\.\i\.isPremiumAtLeast\(null==(\i))/,
|
||||||
|
// = user.banner && isPremiumAtLeast(user.premiumType, TIER_2)
|
||||||
|
replace: "=$1?.banner&&"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
find: "().avatarPositionPremiumNoBanner,default:",
|
||||||
|
replacement: {
|
||||||
|
// premiumUserWithoutBanner: foo().avatarPositionPremiumNoBanner, default: foo().avatarPositionNormal
|
||||||
|
match: /\.avatarPositionPremiumNoBanner(?=,default:\i\(\)\.(\i))/,
|
||||||
|
// premiumUserWithoutBanner: foo().avatarPositionNormal...
|
||||||
|
replace: ".$1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
find: ".hasThemeColors=function(){",
|
||||||
|
replacement: {
|
||||||
|
match: /(?<=key:"canUsePremiumProfileCustomization",get:function\(\){return)/,
|
||||||
|
replace: " false;"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
@ -159,9 +159,12 @@ function getNextMessage(isUp: boolean, isReply: boolean) {
|
|||||||
return i === - 1 ? undefined : messages[messages.length - i - 1];
|
return i === - 1 ? undefined : messages[messages.length - i - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
function shouldMention() {
|
function shouldMention(message) {
|
||||||
|
const { enabled, userList, shouldPingListed } = Settings.plugins.NoReplyMention;
|
||||||
|
const shouldPing = !enabled || (shouldPingListed === userList.includes(message.author.id));
|
||||||
|
|
||||||
switch (settings.store.shouldMention) {
|
switch (settings.store.shouldMention) {
|
||||||
case MentionOptions.NO_REPLY_MENTION_PLUGIN: return !Settings.plugins.NoReplyMention.enabled;
|
case MentionOptions.NO_REPLY_MENTION_PLUGIN: return shouldPing;
|
||||||
case MentionOptions.DISABLED: return false;
|
case MentionOptions.DISABLED: return false;
|
||||||
default: return true;
|
default: return true;
|
||||||
}
|
}
|
||||||
@ -184,7 +187,7 @@ function nextReply(isUp: boolean) {
|
|||||||
type: "CREATE_PENDING_REPLY",
|
type: "CREATE_PENDING_REPLY",
|
||||||
channel,
|
channel,
|
||||||
message,
|
message,
|
||||||
shouldMention: shouldMention(),
|
shouldMention: shouldMention(message),
|
||||||
showMentionToggle: channel.guild_id !== null && message.author.id !== meId,
|
showMentionToggle: channel.guild_id !== null && message.author.id !== meId,
|
||||||
_isQuickReply: true
|
_isQuickReply: true
|
||||||
});
|
});
|
||||||
|
@ -20,7 +20,7 @@ import { Devs } from "@utils/constants";
|
|||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { findByPropsLazy } from "@webpack";
|
import { findByPropsLazy } from "@webpack";
|
||||||
|
|
||||||
const SpoilerClasses = findByPropsLazy("spoilerText");
|
const SpoilerClasses = findByPropsLazy("spoilerContent");
|
||||||
const MessagesClasses = findByPropsLazy("messagesWrapper", "messages");
|
const MessagesClasses = findByPropsLazy("messagesWrapper", "messages");
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
@ -43,14 +43,14 @@ export default definePlugin({
|
|||||||
|
|
||||||
if (!ctrlKey) { return; }
|
if (!ctrlKey) { return; }
|
||||||
|
|
||||||
const { spoilerText, hidden } = SpoilerClasses;
|
const { spoilerContent, hidden } = SpoilerClasses;
|
||||||
const { messagesWrapper } = MessagesClasses;
|
const { messagesWrapper } = MessagesClasses;
|
||||||
|
|
||||||
const parent = shiftKey
|
const parent = shiftKey
|
||||||
? document.querySelector(`div.${messagesWrapper}`)
|
? document.querySelector(`div.${messagesWrapper}`)
|
||||||
: (target as HTMLSpanElement).parentElement;
|
: (target as HTMLSpanElement).parentElement;
|
||||||
|
|
||||||
for (const spoiler of parent!.querySelectorAll(`span.${spoilerText}.${hidden}`)) {
|
for (const spoiler of parent!.querySelectorAll(`span.${spoilerContent}.${hidden}`)) {
|
||||||
(spoiler as HTMLSpanElement).click();
|
(spoiler as HTMLSpanElement).click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,8 +79,8 @@ export default definePlugin({
|
|||||||
addContextMenuPatch("guild-header-popout", guildPopoutPatch);
|
addContextMenuPatch("guild-header-popout", guildPopoutPatch);
|
||||||
|
|
||||||
if (user.banInfo) {
|
if (user.banInfo) {
|
||||||
const endDate = new Date(user.banInfo.banEndDate).getTime();
|
const endDate = new Date(user.banInfo.banEndDate);
|
||||||
if (endDate > Date.now() && (s.user?.banInfo?.banEndDate ?? 0) < endDate) {
|
if (endDate.getTime() > Date.now() && (s.user?.banInfo?.banEndDate ?? 0) < endDate.getTime()) {
|
||||||
Alerts.show({
|
Alerts.show({
|
||||||
title: "You have been banned from ReviewDB",
|
title: "You have been banned from ReviewDB",
|
||||||
body: (
|
body: (
|
||||||
|
@ -50,9 +50,9 @@ export function authorize(callback?: any) {
|
|||||||
permissions={0n}
|
permissions={0n}
|
||||||
clientId="915703782174752809"
|
clientId="915703782174752809"
|
||||||
cancelCompletesFlow={false}
|
cancelCompletesFlow={false}
|
||||||
callback={async (u: string) => {
|
callback={async (response: any) => {
|
||||||
try {
|
try {
|
||||||
const url = new URL(u);
|
const url = new URL(response.location);
|
||||||
url.searchParams.append("clientMod", "vencord");
|
url.searchParams.append("clientMod", "vencord");
|
||||||
const res = await fetch(url, {
|
const res = await fetch(url, {
|
||||||
headers: new Headers({ Accept: "application/json" })
|
headers: new Headers({ Accept: "application/json" })
|
||||||
|
@ -63,6 +63,7 @@ export default definePlugin({
|
|||||||
settings,
|
settings,
|
||||||
|
|
||||||
renderUsername: ({ author, message, isRepliedMessage, withMentionPrefix }: UsernameProps) => {
|
renderUsername: ({ author, message, isRepliedMessage, withMentionPrefix }: UsernameProps) => {
|
||||||
|
if (message.interaction) return author?.nick;
|
||||||
try {
|
try {
|
||||||
const { username } = message.author;
|
const { username } = message.author;
|
||||||
const { nick } = author;
|
const { nick } = author;
|
||||||
|
@ -71,7 +71,7 @@ function clean(str: string) {
|
|||||||
|
|
||||||
function formatText(str: string, user: string, channel: string) {
|
function formatText(str: string, user: string, channel: string) {
|
||||||
return str
|
return str
|
||||||
.replaceAll("{{USER}}", clean(user) || user ? "Someone" : "")
|
.replaceAll("{{USER}}", clean(user) || (user ? "Someone" : ""))
|
||||||
.replaceAll("{{CHANNEL}}", clean(channel) || "channel");
|
.replaceAll("{{CHANNEL}}", clean(channel) || "channel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,14 +77,14 @@ export async function authorizeCloud() {
|
|||||||
permissions={0n}
|
permissions={0n}
|
||||||
clientId={clientId}
|
clientId={clientId}
|
||||||
cancelCompletesFlow={false}
|
cancelCompletesFlow={false}
|
||||||
callback={async (callbackUrl: string) => {
|
callback={async ({ location }: any) => {
|
||||||
if (!callbackUrl) {
|
if (!location) {
|
||||||
Settings.cloud.authenticated = false;
|
Settings.cloud.authenticated = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(callbackUrl, {
|
const res = await fetch(location, {
|
||||||
headers: new Headers({ Accept: "application/json" })
|
headers: new Headers({ Accept: "application/json" })
|
||||||
});
|
});
|
||||||
const { secret } = await res.json();
|
const { secret } = await res.json();
|
||||||
|
@ -315,6 +315,14 @@ export const Devs = /* #__PURE__*/ Object.freeze({
|
|||||||
name: "UwU",
|
name: "UwU",
|
||||||
id: 691413039156690994n,
|
id: 691413039156690994n,
|
||||||
},
|
},
|
||||||
|
amia: {
|
||||||
|
name: "amia",
|
||||||
|
id: 142007603549962240n
|
||||||
|
},
|
||||||
|
ImLvna: {
|
||||||
|
name: "Luna <3",
|
||||||
|
id: 174200708818665472n
|
||||||
|
}
|
||||||
} satisfies Record<string, Dev>);
|
} satisfies Record<string, Dev>);
|
||||||
|
|
||||||
// iife so #__PURE__ works correctly
|
// iife so #__PURE__ works correctly
|
||||||
|
Reference in New Issue
Block a user