Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
2f5870adf8
5 changed files with 34 additions and 22 deletions
|
|
@ -20,6 +20,7 @@ import { sendBotMessage } from "@api/Commands";
|
|||
import { isPluginEnabled } from "@api/PluginManager";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { getUserSettingLazy } from "@api/UserSettings";
|
||||
import { Button } from "@components/Button";
|
||||
import { Card } from "@components/Card";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Flex } from "@components/Flex";
|
||||
|
|
@ -41,7 +42,7 @@ import definePlugin from "@utils/types";
|
|||
import { checkForUpdates, isOutdated, update } from "@utils/updater";
|
||||
import { RenderModalProps } from "@vencord/discord-types";
|
||||
import { CloudUploadPlatform } from "@vencord/discord-types/enums";
|
||||
import { Alerts, Button, ChannelStore, CloudUploader, ConfirmModal, Constants, GuildMemberStore, openModal, Parser, PermissionsBits, PermissionStore, RelationshipStore, RestAPI, SelectedChannelStore, showToast, SnowflakeUtils, Text, Toasts, UserStore } from "@webpack/common";
|
||||
import { Alerts, ChannelStore, CloudUploader, ConfirmModal, Constants, GuildMemberStore, openModal, Parser, PermissionsBits, PermissionStore, RelationshipStore, RestAPI, SelectedChannelStore, showToast, SnowflakeUtils, Text, Toasts, UserStore } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
import plugins, { PluginMeta } from "~plugins";
|
||||
|
|
@ -443,7 +444,7 @@ export default definePlugin({
|
|||
buttons.push(
|
||||
<Button
|
||||
key="vc-update"
|
||||
color={Button.Colors.GREEN}
|
||||
variant="positive"
|
||||
onClick={async () => {
|
||||
try {
|
||||
if (await forceUpdate())
|
||||
|
|
@ -466,14 +467,14 @@ export default definePlugin({
|
|||
buttons.push(
|
||||
<Button
|
||||
key="vc-dbg"
|
||||
color={Button.Colors.PRIMARY}
|
||||
variant="secondary"
|
||||
onClick={async () => sendMessage(props.channel.id, { content: await generateDebugInfoMessage() })}
|
||||
>
|
||||
Run /equicord-debug
|
||||
</Button>,
|
||||
<Button
|
||||
key="vc-plg-list"
|
||||
color={Button.Colors.PRIMARY}
|
||||
variant="secondary"
|
||||
onClick={async () => {
|
||||
const pluginList = generatePluginList();
|
||||
if (typeof pluginList === "string") {
|
||||
|
|
@ -494,7 +495,7 @@ export default definePlugin({
|
|||
);
|
||||
}
|
||||
|
||||
if (equicordSupport) {
|
||||
if (equicordSupport || props.channel.parent_id === SUPPORT_CHANNEL_ID) {
|
||||
const match = CodeBlockRe.exec(props.message.content || props.message.embeds[0]?.rawDescription || "");
|
||||
if (match) {
|
||||
buttons.push(
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ import { HeadingSecondary } from "@components/Heading";
|
|||
import { InfoIcon } from "@components/Icons";
|
||||
import { Paragraph } from "@components/Paragraph";
|
||||
import { RenderModalProps } from "@vencord/discord-types";
|
||||
import { Modal,openModal, TextArea, TextInput, useState } from "@webpack/common";
|
||||
import { Modal, openModal, TextArea, TextInput, useState } from "@webpack/common";
|
||||
|
||||
import { parseTagArguments } from ".";
|
||||
import { addTag, getTag, Tag } from "./settings";
|
||||
import { addTag, getTag, removeTag, Tag } from "./settings";
|
||||
|
||||
export function openCreateTagModal(initialValue: Tag = { name: "", message: "" }) {
|
||||
openModal(modalProps => (
|
||||
|
|
@ -55,6 +55,10 @@ function CreateTagDialog({ initialValue, modalProps }: { initialValue: Tag; moda
|
|||
text: isEdit ? "Save" : "Create",
|
||||
variant: "primary",
|
||||
onClick: () => {
|
||||
if (isEdit && initialValue.name !== name) {
|
||||
removeTag(initialValue.name);
|
||||
}
|
||||
|
||||
const tag = { name, message };
|
||||
addTag(tag);
|
||||
modalProps.onClose();
|
||||
|
|
|
|||
|
|
@ -16,18 +16,22 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import "./style.css";
|
||||
|
||||
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { definePluginSettings, migratePluginSettings } from "@api/Settings";
|
||||
import { CodeBlock } from "@components/CodeBlock";
|
||||
import { Divider } from "@components/Divider";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Heading } from "@components/Heading";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { copyWithToast, getCurrentGuild, getIntlMessage } from "@utils/discord";
|
||||
import { isTruthy } from "@utils/guards";
|
||||
import { Margins } from "@utils/margins";
|
||||
import definePlugin, { IconComponent, OptionType } from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { ChannelStore, Forms, GuildRoleStore, Menu, Modal, openModal } from "@webpack/common";
|
||||
import { ChannelStore, GuildRoleStore, Menu, Modal, openModal, UserProfileStore } from "@webpack/common";
|
||||
import { MouseEventHandler } from "react";
|
||||
|
||||
const CopyIcon: IconComponent = ({ height = 20, width = 20, className }) => {
|
||||
return (
|
||||
|
|
@ -90,14 +94,18 @@ function openViewRawModal(json: string, type: string, msgContent?: string) {
|
|||
>
|
||||
{!!msgContent && (
|
||||
<>
|
||||
<Forms.FormTitle tag="h5">Content</Forms.FormTitle>
|
||||
<CodeBlock content={msgContent} lang="" />
|
||||
<Heading tag="h5">Content</Heading>
|
||||
<div className="vc-viewraw-codeblock">
|
||||
<CodeBlock content={msgContent} lang="" />
|
||||
</div>
|
||||
<Divider className={Margins.bottom20} />
|
||||
</>
|
||||
)}
|
||||
|
||||
<Forms.FormTitle tag="h5">{type} Data</Forms.FormTitle>
|
||||
<CodeBlock content={json} lang="json" />
|
||||
<Heading tag="h5">{type} Data</Heading>
|
||||
<div className="vc-viewraw-codeblock">
|
||||
<CodeBlock content={json} lang="json" />
|
||||
</div>
|
||||
</Modal>
|
||||
</ErrorBoundary >
|
||||
));
|
||||
|
|
@ -126,9 +134,9 @@ const settings = definePluginSettings({
|
|||
}
|
||||
});
|
||||
|
||||
function MakeContextCallback(name: "Guild" | "Role" | "User" | "Channel" | "Message"): NavContextMenuPatchCallback {
|
||||
function MakeContextCallback(name: "Guild" | "Role" | "User" | "Channel" | "Message" | "Profile", getData?: (props: any) => any): NavContextMenuPatchCallback {
|
||||
return (children, props) => {
|
||||
const value = props[name.toLowerCase()];
|
||||
const value = getData ? getData(props) : props[name.toLowerCase()];
|
||||
if (!value) return;
|
||||
if (props.label === getIntlMessage("CHANNEL_ACTIONS_MENU_LABEL")) return; // random shit like notification settings
|
||||
const isMessage = name === "Message";
|
||||
|
|
@ -170,6 +178,7 @@ const devContextCallback: NavContextMenuPatchCallback = (children, { id }: { id:
|
|||
);
|
||||
};
|
||||
|
||||
migratePluginSettings("ViewRaw", "ViewRawVariant");
|
||||
export default definePlugin({
|
||||
name: "ViewRaw",
|
||||
description: "Copy and view the raw content/data of any message, channel or guild",
|
||||
|
|
@ -187,6 +196,7 @@ export default definePlugin({
|
|||
"user-context": MakeContextCallback("User"),
|
||||
"dev-context": devContextCallback,
|
||||
"message": MakeContextCallback("Message"),
|
||||
"user-profile-overflow-menu": MakeContextCallback("Profile", props => UserProfileStore.getGuildMemberProfile(props.user?.id, props.guildId) ?? UserProfileStore.getUserProfile(props.user?.id))
|
||||
},
|
||||
|
||||
messagePopoverButton: {
|
||||
|
|
@ -200,7 +210,7 @@ export default definePlugin({
|
|||
}
|
||||
};
|
||||
|
||||
const handleContextMenu = e => {
|
||||
const handleContextMenu: MouseEventHandler<HTMLButtonElement> = e => {
|
||||
if (settings.store.clickMethod === "Left") {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
|
|
|||
|
|
@ -20,11 +20,7 @@ export default definePlugin({
|
|||
replacement: [
|
||||
{
|
||||
match: /`x-google-max-bitrate=\$\{\i\}`/,
|
||||
replace: '"x-google-max-bitrate=80_000"'
|
||||
},
|
||||
{
|
||||
match: ";level-asymmetry-allowed=1",
|
||||
replace: ";b=AS:800000;level-asymmetry-allowed=1"
|
||||
replace: '"x-google-max-bitrate=80000"'
|
||||
},
|
||||
{
|
||||
match: /;usedtx=\$\{(\i)\?"0":"1"\}/,
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ export const EQUICORD_TEAM = "1173520023239786538";
|
|||
export const EQUICORD_HELPERS = "1326406112144265257";
|
||||
export const VENCORD_CONTRIB_ROLE_ID = "1173343399470964856";
|
||||
export const EQUIBOT_USER_ID = "1243063117852835941";
|
||||
export const KNOWN_ISSUES_CHANNEL_ID = "1466558228379992266";
|
||||
|
||||
// Vencord
|
||||
export const VC_SUPPORT_CHANNEL_ID = "1026515880080842772";
|
||||
|
|
@ -36,7 +37,7 @@ export const VC_DONOR_ROLE_ID = "1042507929485586532";
|
|||
export const VC_CONTRIB_ROLE_ID = "1026534353167208489";
|
||||
export const VC_REGULAR_ROLE_ID = "1026504932959977532";
|
||||
export const VC_SUPPORT_CATEGORY_ID = "1108135649699180705";
|
||||
export const VC_KNOWN_ISSUES_CHANNEL_ID = "1222936386626129920";
|
||||
export const VC_KNOWN_ISSUES_CHANNEL_ID = "1257025907625951423";
|
||||
export const VESKTOP_SUPPORT_CHANNEL_ID = "1345457031426871417";
|
||||
export const VC_SUPPORT_CHANNEL_IDS = [VC_SUPPORT_CHANNEL_ID, VESKTOP_SUPPORT_CHANNEL_ID];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue