refactor discord types into separate npm package (#3520)
Co-authored-by: V <vendicated@riseup.net> Co-authored-by: sadan <117494111+sadan4@users.noreply.github.com> Co-authored-by: ezzud <contact@ezzud.fr>
This commit is contained in:
parent
c55833d95f
commit
dc9064326b
149 changed files with 1561 additions and 751 deletions
|
|
@ -30,8 +30,8 @@ import { Margins } from "@utils/margins";
|
|||
import { shouldShowContributorBadge } from "@utils/misc";
|
||||
import { closeModal, ModalContent, ModalFooter, ModalHeader, ModalRoot, openModal } from "@utils/modal";
|
||||
import definePlugin from "@utils/types";
|
||||
import { User } from "@vencord/discord-types";
|
||||
import { Forms, Toasts, UserStore } from "@webpack/common";
|
||||
import { User } from "discord-types/general";
|
||||
|
||||
const CONTRIBUTOR_BADGE = "https://cdn.discordapp.com/emojis/1092089799109775453.png?size=64";
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import { definePluginSettings } from "@api/Settings";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import definePlugin, { OptionType, StartAt } from "@utils/types";
|
||||
import { WebpackRequire } from "@webpack/wreq.d";
|
||||
import { WebpackRequire } from "@vencord/discord-types/webpack";
|
||||
|
||||
const settings = definePluginSettings({
|
||||
disableAnalytics: {
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ export default definePlugin({
|
|||
get chromiumVersion() {
|
||||
try {
|
||||
return VencordNative.native.getVersions().chrome
|
||||
// @ts-ignore Typescript will add userAgentData IMMEDIATELY
|
||||
// @ts-expect-error Typescript will add userAgentData IMMEDIATELY
|
||||
|| navigator.userAgentData?.brands?.find(b => b.brand === "Chromium" || b.brand === "Google Chrome")?.version
|
||||
|| null;
|
||||
} catch { // inb4 some stupid browser throws unsupported error for navigator.userAgentData, it's only in chromium
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ import { onlyOnce } from "@utils/onlyOnce";
|
|||
import { makeCodeblock } from "@utils/text";
|
||||
import definePlugin from "@utils/types";
|
||||
import { checkForUpdates, isOutdated, update } from "@utils/updater";
|
||||
import { Channel } from "@vencord/discord-types";
|
||||
import { Alerts, Button, Card, ChannelStore, Forms, GuildMemberStore, Parser, PermissionsBits, PermissionStore, RelationshipStore, showToast, Text, Toasts, UserStore } from "@webpack/common";
|
||||
import { Channel } from "discord-types/general";
|
||||
import { JSX } from "react";
|
||||
|
||||
import gitHash from "~git-hash";
|
||||
|
|
@ -196,7 +196,6 @@ export default definePlugin({
|
|||
}
|
||||
}
|
||||
|
||||
// @ts-ignore outdated type
|
||||
const roles = GuildMemberStore.getSelfMember(VENCORD_GUILD_ID)?.roles;
|
||||
if (!roles || TrustedRolesIds.some(id => roles.includes(id))) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { getCurrentChannel } from "@utils/discord";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { User } from "@vencord/discord-types";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { ContextMenuApi, Menu, useEffect, useRef } from "@webpack/common";
|
||||
import { User } from "discord-types/general";
|
||||
|
||||
interface UserProfileProps {
|
||||
popoutProps: Record<string, any>;
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ import { ScreenshareIcon } from "@components/Icons";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { openImageModal } from "@utils/discord";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Channel, User } from "@vencord/discord-types";
|
||||
import { Menu } from "@webpack/common";
|
||||
import { Channel, User } from "discord-types/general";
|
||||
|
||||
import { ApplicationStreamingStore, ApplicationStreamPreviewStore } from "./webpack/stores";
|
||||
import { ApplicationStream, Stream } from "./webpack/types/stores";
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { FluxStore } from "@webpack/types";
|
||||
import { FluxStore } from "@vencord/discord-types";
|
||||
|
||||
export interface ApplicationStreamPreviewStore extends FluxStore {
|
||||
getIsPreviewLoading: (guildId: string | bigint | null, channelId: string | bigint, ownerId: string | bigint) => boolean;
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ import { LinkIcon } from "@components/Icons";
|
|||
import { copyToClipboard } from "@utils/clipboard";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import type { Channel, User } from "@vencord/discord-types";
|
||||
import { Menu } from "@webpack/common";
|
||||
import type { Channel, User } from "discord-types/general";
|
||||
|
||||
interface UserContextProps {
|
||||
channel: Channel;
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
import { debounce } from "@shared/debounce";
|
||||
import { proxyLazy } from "@utils/lazy";
|
||||
import { User } from "@vencord/discord-types";
|
||||
import { useEffect, useState, zustandCreate } from "@webpack/common";
|
||||
import { User } from "discord-types/general";
|
||||
|
||||
import { AvatarDecoration } from "../../";
|
||||
import { getUsersDecorations } from "../api";
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ import { Margins } from "@utils/margins";
|
|||
import { classes, copyWithToast } from "@utils/misc";
|
||||
import { closeAllModals, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import { Queue } from "@utils/Queue";
|
||||
import { User } from "@vencord/discord-types";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { Alerts, Button, FluxDispatcher, Forms, GuildStore, NavigationRouter, Parser, Text, Tooltip, useEffect, UserStore, UserUtils, useState } from "@webpack/common";
|
||||
import { User } from "discord-types/general";
|
||||
|
||||
import { Decoration, getPresets, Preset } from "../../lib/api";
|
||||
import { GUILD_ID, INVITE_KEY } from "../../lib/constants";
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ import { Logger } from "@utils/Logger";
|
|||
import { Margins } from "@utils/margins";
|
||||
import { ModalContent, ModalHeader, ModalRoot, openModalLazy } from "@utils/modal";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Guild } from "@vencord/discord-types";
|
||||
import { findByCodeLazy, findStoreLazy } from "@webpack";
|
||||
import { Constants, EmojiStore, FluxDispatcher, Forms, GuildStore, IconUtils, Menu, PermissionsBits, PermissionStore, React, RestAPI, Toasts, Tooltip, UserStore } from "@webpack/common";
|
||||
import { Guild } from "discord-types/general";
|
||||
import { Promisable } from "type-fest";
|
||||
|
||||
const StickersStore = findStoreLazy("StickersStore");
|
||||
|
|
|
|||
|
|
@ -23,10 +23,9 @@ import { ApngBlendOp, ApngDisposeOp, importApngJs } from "@utils/dependencies";
|
|||
import { getCurrentGuild, getEmojiURL } from "@utils/discord";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import definePlugin, { OptionType, Patch } from "@utils/types";
|
||||
import type { Emoji, Message } from "@vencord/discord-types";
|
||||
import { findByCodeLazy, findByPropsLazy, findStoreLazy, proxyLazyWebpack } from "@webpack";
|
||||
import { Alerts, ChannelStore, DraftType, EmojiStore, FluxDispatcher, Forms, GuildMemberStore, lodash, Parser, PermissionsBits, PermissionStore, UploadHandler, UserSettingsActionCreators, UserStore } from "@webpack/common";
|
||||
import type { Emoji } from "@webpack/types";
|
||||
import type { Message } from "discord-types/general";
|
||||
import { applyPalette, GIFEncoder, quantize } from "gifenc";
|
||||
import type { ReactElement, ReactNode } from "react";
|
||||
|
||||
|
|
@ -813,7 +812,6 @@ export default definePlugin({
|
|||
|
||||
let isUsableTwitchSubEmote = false;
|
||||
if (e.managed && e.guildId) {
|
||||
// @ts-ignore outdated type
|
||||
const myRoles = GuildMemberStore.getSelfMember(e.guildId)?.roles ?? [];
|
||||
isUsableTwitchSubEmote = e.roles.some(r => myRoles.includes(r));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,16 +25,12 @@ import { Devs } from "@utils/constants";
|
|||
import { Margins } from "@utils/margins";
|
||||
import { classes, copyWithToast } from "@utils/misc";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { User } from "@vencord/discord-types";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { Button, ColorPicker, Flex, Forms, React, Text, UserProfileStore, UserStore, useState } from "@webpack/common";
|
||||
import { User } from "discord-types/general";
|
||||
import { ReactElement } from "react";
|
||||
import virtualMerge from "virtual-merge";
|
||||
|
||||
interface UserProfile extends User {
|
||||
themeColors?: Array<number>;
|
||||
}
|
||||
|
||||
interface Colors {
|
||||
primary: number;
|
||||
accent: number;
|
||||
|
|
@ -220,7 +216,7 @@ export default definePlugin({
|
|||
</Forms.FormSection>);
|
||||
},
|
||||
settings,
|
||||
colorDecodeHook(user: UserProfile) {
|
||||
colorDecodeHook(user: User) {
|
||||
if (user) {
|
||||
// don't replace colors if already set with nitro
|
||||
if (settings.store.nitroFirst && user.themeColors) return user;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Emoji } from "@vencord/discord-types";
|
||||
import { EmojiStore } from "@webpack/common";
|
||||
import { Emoji } from "@webpack/types";
|
||||
|
||||
interface EmojiAutocompleteState {
|
||||
query?: {
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Channel, User } from "@vencord/discord-types";
|
||||
import { GuildStore } from "@webpack/common";
|
||||
import { Channel, User } from "discord-types/general";
|
||||
|
||||
export default definePlugin({
|
||||
name: "ForceOwnerCrown",
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ import { Devs } from "@utils/constants";
|
|||
import { getIntlMessage } from "@utils/discord";
|
||||
import { NoopComponent } from "@utils/react";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { filters, findByCodeLazy, waitFor } from "@webpack";
|
||||
import { ChannelStore, ContextMenuApi, UserStore } from "@webpack/common";
|
||||
import { Message } from "discord-types/general";
|
||||
|
||||
const useMessageMenu = findByCodeLazy(".MESSAGE,commandTargetId:");
|
||||
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Channel, Message } from "@vencord/discord-types";
|
||||
import { findLazy } from "@webpack";
|
||||
import { ContextMenuApi, FluxDispatcher, Menu, MessageActions } from "@webpack/common";
|
||||
import { Channel, Message } from "discord-types/general";
|
||||
|
||||
interface Sticker {
|
||||
id: string;
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ import { ImageInvisible, ImageVisible } from "@components/Icons";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { classes } from "@utils/misc";
|
||||
import definePlugin from "@utils/types";
|
||||
import { MessageSnapshot } from "@vencord/discord-types";
|
||||
import { ChannelStore } from "@webpack/common";
|
||||
import { MessageSnapshot } from "@webpack/types";
|
||||
|
||||
const KEY = "HideAttachments_HiddenIds";
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ export default definePlugin({
|
|||
}],
|
||||
|
||||
renderMessagePopoverButton(msg) {
|
||||
// @ts-ignore - discord-types lags behind discord.
|
||||
// @ts-expect-error - discord-types lags behind discord.
|
||||
const hasAttachmentsInShapshots = msg.messageSnapshots.some(
|
||||
(snapshot: MessageSnapshot) => snapshot?.message.attachments.length
|
||||
);
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@ import { disableStyle, enableStyle } from "@api/Styles";
|
|||
import { Logger } from "@utils/Logger";
|
||||
import { canonicalizeFind, canonicalizeReplacement } from "@utils/patches";
|
||||
import { Patch, Plugin, PluginDef, ReporterTestable, StartAt } from "@utils/types";
|
||||
import { FluxEvents } from "@vencord/discord-types";
|
||||
import { FluxDispatcher } from "@webpack/common";
|
||||
import { patches } from "@webpack/patcher";
|
||||
import { FluxEvents } from "@webpack/types";
|
||||
|
||||
import Plugins from "~plugins";
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { getStegCloak } from "@utils/dependencies";
|
||||
import definePlugin, { OptionType, ReporterTestable } from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { ChannelStore, Constants, RestAPI, Tooltip } from "@webpack/common";
|
||||
import { Message } from "discord-types/general";
|
||||
|
||||
import { buildDecModal } from "./components/DecryptionModal";
|
||||
import { buildEncModal } from "./components/EncryptionModal";
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ import { classNameFactory } from "@api/Styles";
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { FluxStore } from "@vencord/discord-types";
|
||||
import { findStoreLazy } from "@webpack";
|
||||
import { FluxStore } from "@webpack/types";
|
||||
|
||||
import { MemberCount } from "./MemberCount";
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ import { definePluginSettings } from "@api/Settings";
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { User } from "@vencord/discord-types";
|
||||
import { GuildRoleStore, SelectedGuildStore, useState } from "@webpack/common";
|
||||
import { User } from "discord-types/general";
|
||||
|
||||
const settings = definePluginSettings({
|
||||
showAtSymbol: {
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { isNonNullish } from "@utils/guards";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { SnowflakeUtils, Tooltip } from "@webpack/common";
|
||||
import { Message } from "discord-types/general";
|
||||
|
||||
type FillValue = ("status-danger" | "status-warning" | "status-positive" | "text-muted");
|
||||
type Fill = [FillValue, FillValue, FillValue];
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import { Devs } from "@utils/constants.js";
|
|||
import { classes } from "@utils/misc";
|
||||
import { Queue } from "@utils/Queue";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Channel, Message } from "@vencord/discord-types";
|
||||
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
||||
import {
|
||||
Button,
|
||||
|
|
@ -39,7 +40,6 @@ import {
|
|||
Text,
|
||||
UserStore
|
||||
} from "@webpack/common";
|
||||
import { Channel, Message } from "discord-types/general";
|
||||
import { JSX } from "react";
|
||||
|
||||
const messageCache = new Map<string, {
|
||||
|
|
@ -217,7 +217,7 @@ function withEmbeddedBy(message: Message, embeddedBy: string[]) {
|
|||
return new Proxy(message, {
|
||||
get(_, prop) {
|
||||
if (prop === "vencordEmbeddedBy") return embeddedBy;
|
||||
// @ts-ignore ts so bad
|
||||
// @ts-expect-error ts so bad
|
||||
return Reflect.get(...arguments);
|
||||
}
|
||||
});
|
||||
|
|
@ -225,7 +225,7 @@ function withEmbeddedBy(message: Message, embeddedBy: string[]) {
|
|||
|
||||
|
||||
function MessageEmbedAccessory({ message }: { message: Message; }) {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
const embeddedBy: string[] = message.vencordEmbeddedBy ?? [];
|
||||
|
||||
const accessories = [] as (JSX.Element | null)[];
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ import { getIntlMessage } from "@utils/discord";
|
|||
import { Logger } from "@utils/Logger";
|
||||
import { classes } from "@utils/misc";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { ChannelStore, FluxDispatcher, Menu, MessageStore, Parser, SelectedChannelStore, Timestamp, UserStore, useStateFromStores } from "@webpack/common";
|
||||
import { Message } from "discord-types/general";
|
||||
|
||||
import overlayStyle from "./deleteStyleOverlay.css?managed";
|
||||
import textStyle from "./deleteStyleText.css?managed";
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ export default definePlugin({
|
|||
// TODO(OptionType.CUSTOM Related): Remove DataStore tags migration once enough time has passed
|
||||
const oldTags = await DataStore.get<Tag[]>(DATA_KEY);
|
||||
if (oldTags != null) {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
settings.store.tagsList = Object.fromEntries(oldTags.map(oldTag => (delete oldTag.enabled, [oldTag.name, oldTag])));
|
||||
await DataStore.del(DATA_KEY);
|
||||
}
|
||||
|
|
@ -211,7 +211,7 @@ export default definePlugin({
|
|||
description: Object.values(getTags())
|
||||
.map(tag => `\`${tag.name}\`: ${tag.message.slice(0, 72).replaceAll("\\n", " ")}${tag.message.length > 72 ? "..." : ""}`)
|
||||
.join("\n") || `${EMOTE} Woops! There are no tags yet, use \`/tags create\` to create one!`,
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
color: 0xd77f7f,
|
||||
type: "rich",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ import { Devs } from "@utils/constants";
|
|||
import { isNonNullish } from "@utils/guards";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Channel, User } from "@vencord/discord-types";
|
||||
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
||||
import { Avatar, ChannelStore, Clickable, IconUtils, RelationshipStore, ScrollerThin, Text, useMemo, UserStore } from "@webpack/common";
|
||||
import { Channel, User } from "discord-types/general";
|
||||
import { JSX } from "react";
|
||||
|
||||
const SelectedChannelActionCreators = findByPropsLazy("selectPrivateChannel");
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ import { definePluginSettings } from "@api/Settings";
|
|||
import { CogWheel } from "@components/Icons";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Guild } from "@vencord/discord-types";
|
||||
import { findByCodeLazy, findByPropsLazy, mapMangledModuleLazy } from "@webpack";
|
||||
import { Menu } from "@webpack/common";
|
||||
import { Guild } from "discord-types/general";
|
||||
|
||||
const { updateGuildNotificationSettings } = findByPropsLazy("updateGuildNotificationSettings");
|
||||
const { toggleShowAllChannels } = mapMangledModuleLazy(".onboardExistingMember(", {
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ import { Devs } from "@utils/constants";
|
|||
import { runtimeHashMessageKey } from "@utils/intlHash";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { i18n, RelationshipStore } from "@webpack/common";
|
||||
import { Message } from "discord-types/general";
|
||||
|
||||
interface MessageDeleteProps {
|
||||
// Internal intl message for BLOCKED_MESSAGE_COUNT
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import type { Message } from "discord-types/general";
|
||||
import type { Message } from "@vencord/discord-types";
|
||||
|
||||
const settings = definePluginSettings({
|
||||
userList: {
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { MessageJSON } from "@vencord/discord-types";
|
||||
import { ChannelStore, ReadStateStore, UserStore } from "@webpack/common";
|
||||
import { MessageJSON } from "discord-types/general";
|
||||
|
||||
const enum ChannelType {
|
||||
DM = 1,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ function showDisableInvites(guildId: string) {
|
|||
if (!guild) return false;
|
||||
|
||||
return (
|
||||
// @ts-expect-error
|
||||
!hasGuildFeature(guild, "INVITES_DISABLED") &&
|
||||
PermissionStore.getGuildPermissionProps(guild).canManageRoles
|
||||
);
|
||||
|
|
|
|||
|
|
@ -22,10 +22,9 @@ import { InfoIcon, OwnerCrownIcon } from "@components/Icons";
|
|||
import { copyToClipboard } from "@utils/clipboard";
|
||||
import { getIntlMessage, getUniqueUsername } from "@utils/discord";
|
||||
import { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import { Guild, Role, UnicodeEmoji, User } from "@vencord/discord-types";
|
||||
import { findByCodeLazy } from "@webpack";
|
||||
import { ContextMenuApi, FluxDispatcher, GuildMemberStore, GuildRoleStore, i18n, Menu, PermissionsBits, ScrollerThin, Text, Tooltip, useEffect, useMemo, UserStore, useState, useStateFromStores } from "@webpack/common";
|
||||
import { UnicodeEmoji } from "@webpack/types";
|
||||
import type { Guild, Role, User } from "discord-types/general";
|
||||
|
||||
import { settings } from "..";
|
||||
import { cl, getGuildPermissionSpecMap } from "../utils";
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { getIntlMessage } from "@utils/discord";
|
||||
import { classes } from "@utils/misc";
|
||||
import type { Guild, GuildMember } from "@vencord/discord-types";
|
||||
import { filters, findBulk, proxyLazyWebpack } from "@webpack";
|
||||
import { PermissionsBits, Text, Tooltip, useMemo, UserStore } from "@webpack/common";
|
||||
import type { Guild, GuildMember } from "discord-types/general";
|
||||
|
||||
import { PermissionsSortOrder, settings } from "..";
|
||||
import { cl, getGuildPermissionSpecMap, getSortedRoles, sortUserRoles } from "../utils";
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ import { SafetyIcon } from "@components/Icons";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { classes } from "@utils/misc";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import type { Guild, GuildMember } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { Button, ChannelStore, Dialog, GuildMemberStore, GuildRoleStore, GuildStore, match, Menu, PermissionsBits, Popout, TooltipContainer, useRef, UserStore } from "@webpack/common";
|
||||
import type { Guild, GuildMember } from "discord-types/general";
|
||||
|
||||
import openRolesAndUsersPermissionsModal, { PermissionType, RoleOrUserPermission } from "./components/RolesAndUsersPermissions";
|
||||
import UserPermissions from "./components/UserPermissions";
|
||||
|
|
@ -71,7 +71,7 @@ function MenuItem(guildId: string, id?: string, type?: MenuItemParentType) {
|
|||
const { permissions, header } = match(type)
|
||||
.returnType<{ permissions: RoleOrUserPermission[], header: string; }>()
|
||||
.with(MenuItemParentType.User, () => {
|
||||
const member = GuildMemberStore.getMember(guildId, id!);
|
||||
const member = GuildMemberStore.getMember(guildId, id!)!;
|
||||
|
||||
const permissions: RoleOrUserPermission[] = getSortedRoles(guild, member)
|
||||
.map(role => ({
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@
|
|||
*/
|
||||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { Guild, GuildMember, Role } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { GuildRoleStore } from "@webpack/common";
|
||||
import { Guild, GuildMember, Role } from "discord-types/general";
|
||||
|
||||
import { PermissionsSortOrder, settings } from ".";
|
||||
import { PermissionType } from "./components/RolesAndUsersPermissions";
|
||||
|
|
|
|||
|
|
@ -16,10 +16,11 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ApplicationCommandInputType, ApplicationCommandOptionType, Argument, CommandContext, findOption, sendBotMessage } from "@api/Commands";
|
||||
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { makeLazy } from "@utils/lazy";
|
||||
import definePlugin from "@utils/types";
|
||||
import { CommandArgument, CommandContext } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { DraftType, UploadHandler, UploadManager, UserUtils } from "@webpack/common";
|
||||
import { applyPalette, GIFEncoder, quantize } from "gifenc";
|
||||
|
|
@ -54,7 +55,7 @@ function loadImage(source: File | string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function resolveImage(options: Argument[], ctx: CommandContext, noServerPfp: boolean): Promise<File | string | null> {
|
||||
async function resolveImage(options: CommandArgument[], ctx: CommandContext, noServerPfp: boolean): Promise<File | string | null> {
|
||||
for (const opt of options) {
|
||||
switch (opt.name) {
|
||||
case "image":
|
||||
|
|
@ -177,6 +178,8 @@ export default definePlugin({
|
|||
}
|
||||
|
||||
gif.finish();
|
||||
// @ts-ignore This causes a type error on *only some* typescript versions.
|
||||
// usage adheres to mdn https://developer.mozilla.org/en-US/docs/Web/API/File/File#parameters
|
||||
const file = new File([gif.bytesView()], "petpet.gif", { type: "image/gif" });
|
||||
// Immediately after the command finishes, Discord clears all input, including pending attachments.
|
||||
// Thus, setTimeout is needed to make this execute after Discord cleared the input
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { classes } from "@utils/misc";
|
||||
import definePlugin, { OptionType, StartAt } from "@utils/types";
|
||||
import { Channel } from "@vencord/discord-types";
|
||||
import { findByPropsLazy, findStoreLazy } from "@webpack";
|
||||
import { Clickable, ContextMenuApi, FluxDispatcher, Menu, React } from "@webpack/common";
|
||||
import { Channel } from "discord-types/general";
|
||||
|
||||
import { contextMenus } from "./components/contextMenu";
|
||||
import { openCategoryModal, requireSettingsMenu } from "./components/CreateCategoryModal";
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ import { Settings } from "@api/Settings";
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { User } from "@vencord/discord-types";
|
||||
import { filters, findStoreLazy, mapMangledModuleLazy } from "@webpack";
|
||||
import { PresenceStore, Tooltip, UserStore } from "@webpack/common";
|
||||
import { User } from "discord-types/general";
|
||||
|
||||
export interface Session {
|
||||
sessionId: string;
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons";
|
|||
import { generateId, sendBotMessage } from "@api/Commands";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { StartAt } from "@utils/types";
|
||||
import { MessageAttachment } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { DraftStore, DraftType, SelectedChannelStore, UserStore, useStateFromStores } from "@webpack/common";
|
||||
import { MessageAttachment } from "discord-types/general";
|
||||
|
||||
const UploadStore = findByPropsLazy("getUploads");
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { ChannelStore, ComponentDispatch, FluxDispatcher as Dispatcher, MessageActions, MessageStore, PermissionsBits, PermissionStore, SelectedChannelStore, UserStore } from "@webpack/common";
|
||||
import { Message } from "discord-types/general";
|
||||
import NoBlockedMessagesPlugin from "plugins/noBlockedMessages";
|
||||
import NoReplyMentionPlugin from "plugins/noReplyMention";
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ import { addServerListElement, removeServerListElement, ServerListRenderPosition
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Channel } from "@vencord/discord-types";
|
||||
import { findStoreLazy } from "@webpack";
|
||||
import { Button, FluxDispatcher, GuildChannelStore, GuildStore, React, ReadStateStore } from "@webpack/common";
|
||||
import { Channel } from "discord-types/general";
|
||||
|
||||
interface ThreadJoined {
|
||||
channel: Channel;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Channel } from "discord-types/general";
|
||||
import { Channel } from "@vencord/discord-types";
|
||||
|
||||
export interface ChannelDelete {
|
||||
type: "CHANNEL_DELETE";
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
import { DataStore, Notices } from "@api/index";
|
||||
import { showNotification } from "@api/Notifications";
|
||||
import { getUniqueUsername, openUserProfile } from "@utils/discord";
|
||||
import { FluxStore } from "@vencord/discord-types";
|
||||
import { findStoreLazy } from "@webpack";
|
||||
import { ChannelStore, GuildMemberStore, GuildStore, RelationshipStore, UserStore, UserUtils } from "@webpack/common";
|
||||
import { FluxStore } from "@webpack/types";
|
||||
|
||||
import settings from "./settings";
|
||||
import { ChannelType, RelationshipType, SimpleGroupChannel, SimpleGuild } from "./types";
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import "./style.css";
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import type { Message } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { DateUtils, Timestamp } from "@webpack/common";
|
||||
import type { Message } from "discord-types/general";
|
||||
import type { HTMLAttributes } from "react";
|
||||
|
||||
const MessageClasses = findByPropsLazy("separator", "latin24CompactTimeStamp");
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ import { NotesIcon, OpenExternalIcon } from "@components/Icons";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { classes } from "@utils/misc";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Guild, User } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { Alerts, Button, Menu, Parser, TooltipContainer } from "@webpack/common";
|
||||
import { Guild, User } from "discord-types/general";
|
||||
|
||||
import { Auth, initAuth, updateAuth } from "./auth";
|
||||
import { openReviewsModal } from "./components/ReviewModal";
|
||||
|
|
|
|||
|
|
@ -111,7 +111,6 @@ export default definePlugin({
|
|||
// SUMMARIES_ENABLED feature is not in discord-types
|
||||
const guild = GuildStore.getGuild(channel.guild_id);
|
||||
|
||||
// @ts-expect-error
|
||||
return hasGuildFeature(guild, "SUMMARIES_ENABLED_GA");
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ import { getGuildAcronym, openImageModal, openUserProfile } from "@utils/discord
|
|||
import { classes } from "@utils/misc";
|
||||
import { ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import { useAwaiter } from "@utils/react";
|
||||
import { Guild, User } from "@vencord/discord-types";
|
||||
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
||||
import { FluxDispatcher, Forms, GuildChannelStore, GuildMemberStore, GuildRoleStore, IconUtils, Parser, PresenceStore, RelationshipStore, ScrollerThin, SnowflakeUtils, TabBar, Timestamp, useEffect, UserStore, UserUtils, useState, useStateFromStores } from "@webpack/common";
|
||||
import { Guild, User } from "discord-types/general";
|
||||
|
||||
const IconClasses = findByPropsLazy("icon", "acronym", "childWrapper");
|
||||
const FriendRow = findComponentByCodeLazy("discriminatorClass:", ".isMobileOnline", "getAvatarURL");
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Guild } from "@vencord/discord-types";
|
||||
import { Menu } from "@webpack/common";
|
||||
import { Guild } from "discord-types/general";
|
||||
|
||||
import { openGuildInfoModal } from "./GuildInfoModal";
|
||||
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ import { CopyIcon, LinkIcon } from "@components/Icons";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { copyWithToast } from "@utils/misc";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { User } from "@vencord/discord-types";
|
||||
import { findByCodeLazy, findByPropsLazy } from "@webpack";
|
||||
import { Tooltip, UserProfileStore } from "@webpack/common";
|
||||
import { User } from "discord-types/general";
|
||||
|
||||
import { VerifiedIcon } from "./VerifiedIcon";
|
||||
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ import { Settings } from "@api/Settings";
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { classes } from "@utils/misc";
|
||||
import { formatDuration } from "@utils/text";
|
||||
import type { Channel } from "@vencord/discord-types";
|
||||
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
||||
import { EmojiStore, FluxDispatcher, GuildMemberStore, GuildStore, Parser, PermissionsBits, PermissionStore, SnowflakeUtils, Text, Timestamp, Tooltip, useEffect, useState } from "@webpack/common";
|
||||
import type { Channel } from "discord-types/general";
|
||||
|
||||
import openRolesAndUsersPermissionsModal, { PermissionType, RoleOrUserPermission } from "../../permissionsViewer/components/RolesAndUsersPermissions";
|
||||
import { sortPermissionOverwrites } from "../../permissionsViewer/utils";
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ import { Devs } from "@utils/constants";
|
|||
import { classes } from "@utils/misc";
|
||||
import { canonicalizeMatch } from "@utils/patches";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import type { Channel, Role } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { ChannelStore, PermissionsBits, PermissionStore, Tooltip } from "@webpack/common";
|
||||
import type { Channel, Role } from "discord-types/general";
|
||||
|
||||
import HiddenChannelLockScreen from "./components/HiddenChannelLockScreen";
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { definePluginSettings } from "@api/Settings";
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Message, User } from "discord-types/general";
|
||||
import { Message, User } from "@vencord/discord-types";
|
||||
|
||||
interface UsernameProps {
|
||||
author: { nick: string; };
|
||||
|
|
@ -62,7 +62,7 @@ export default definePlugin({
|
|||
const user = userOverride ?? message.author;
|
||||
let { username } = user;
|
||||
if (settings.store.displayNames)
|
||||
username = (user as any).globalName || username;
|
||||
username = user.globalName || username;
|
||||
|
||||
const { nick } = author;
|
||||
const prefix = withMentionPrefix ? "@" : "";
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ import { Devs } from "@utils/constants";
|
|||
import { getIntlMessage } from "@utils/discord";
|
||||
import { canonicalizeMatch } from "@utils/patches";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { findComponentLazy } from "@webpack";
|
||||
import { ChannelStore, GuildMemberStore, Text, Tooltip } from "@webpack/common";
|
||||
import { Message } from "discord-types/general";
|
||||
import { FunctionComponent, ReactNode } from "react";
|
||||
|
||||
const countDownFilter = canonicalizeMatch("#{intl::MAX_AGE_NEVER}");
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ import { classNameFactory } from "@api/Styles";
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { User } from "@vencord/discord-types";
|
||||
import { DateUtils, RelationshipStore, Text, TooltipContainer } from "@webpack/common";
|
||||
import { User } from "discord-types/general";
|
||||
import { PropsWithChildren } from "react";
|
||||
|
||||
const formatter = new Intl.DateTimeFormat(undefined, {
|
||||
|
|
|
|||
|
|
@ -16,10 +16,11 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ApplicationCommandInputType, Command, findOption, OptionalMessageOption, sendBotMessage } from "@api/Commands";
|
||||
import { ApplicationCommandInputType, findOption, OptionalMessageOption, sendBotMessage } from "@api/Commands";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { sendMessage } from "@utils/discord";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Command } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { FluxDispatcher, MessageActions } from "@webpack/common";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { UserStore } from "@webpack/common";
|
||||
import { Message } from "discord-types/general";
|
||||
|
||||
|
||||
export default definePlugin({
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { Parser, useEffect, useState } from "@webpack/common";
|
||||
import { Message } from "discord-types/general";
|
||||
|
||||
import { TranslateIcon } from "./TranslateIcon";
|
||||
import { cl, TranslationValue } from "./utils";
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ function TypingIndicator({ channelId, guildId }: { channelId: string; guildId: s
|
|||
return oldKeys.length === currentKeys.length && currentKeys.every(key => old[key] != null);
|
||||
}
|
||||
);
|
||||
const currentChannelId: string = useStateFromStores([SelectedChannelStore], () => SelectedChannelStore.getChannelId());
|
||||
const currentChannelId = useStateFromStores([SelectedChannelStore], () => SelectedChannelStore.getChannelId());
|
||||
|
||||
if (!settings.store.includeMutedChannels) {
|
||||
const isChannelMuted = UserGuildSettingsStore.isChannelMuted(guildId, channelId);
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { openUserProfile } from "@utils/discord";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { User } from "@vencord/discord-types";
|
||||
import { Avatar, GuildMemberStore, React, RelationshipStore } from "@webpack/common";
|
||||
import { User } from "discord-types/general";
|
||||
import { PropsWithChildren } from "react";
|
||||
|
||||
import managedStyle from "./style.css?managed";
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/Co
|
|||
import { ImageInvisible, ImageVisible } from "@components/Icons";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import { MessageSnapshot } from "@vencord/discord-types";
|
||||
import { Constants, Menu, PermissionsBits, PermissionStore, RestAPI, UserStore } from "@webpack/common";
|
||||
import { MessageSnapshot } from "@webpack/types";
|
||||
|
||||
|
||||
const EMBED_SUPPRESSED = 1 << 2;
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ import { getUserSettingLazy } from "@api/UserSettings";
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { getIntlMessage } from "@utils/discord";
|
||||
import { classes } from "@utils/misc";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { Tooltip, UserStore } from "@webpack/common";
|
||||
import { Message } from "discord-types/general";
|
||||
|
||||
import { settings } from "./settings";
|
||||
import { useFormattedPronouns } from "./utils";
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
import { classNameFactory } from "@api/Styles";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { classes } from "@utils/misc";
|
||||
import { Channel } from "@vencord/discord-types";
|
||||
import { filters, findByCodeLazy, findByPropsLazy, findComponentByCodeLazy, findStoreLazy, mapMangledModuleLazy } from "@webpack";
|
||||
import { ChannelRouter, ChannelStore, GuildStore, IconUtils, match, P, PermissionsBits, PermissionStore, React, showToast, Text, Toasts, Tooltip, useMemo, UserStore, useStateFromStores } from "@webpack/common";
|
||||
import { Channel } from "discord-types/general";
|
||||
|
||||
const cl = classNameFactory("vc-uvs-");
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,9 @@
|
|||
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Channel, Message, User } from "@vencord/discord-types";
|
||||
import { findByCodeLazy } from "@webpack";
|
||||
import { FluxDispatcher, RestAPI } from "@webpack/common";
|
||||
import { Message, User } from "discord-types/general";
|
||||
import { Channel } from "discord-types/general/index.js";
|
||||
|
||||
const enum ReferencedMessageState {
|
||||
Loaded,
|
||||
|
|
|
|||
|
|
@ -144,7 +144,14 @@ function playSample(tempSettings: any, type: string) {
|
|||
const currentUser = UserStore.getCurrentUser();
|
||||
const myGuildId = SelectedGuildStore.getGuildId();
|
||||
|
||||
speak(formatText(s[type + "Message"], currentUser.username, "general", (currentUser as any).globalName ?? currentUser.username, GuildMemberStore.getNick(myGuildId, currentUser.id) ?? currentUser.username), s);
|
||||
speak(formatText(
|
||||
s[type + "Message"],
|
||||
currentUser.username,
|
||||
"general",
|
||||
currentUser.globalName ?? currentUser.username,
|
||||
GuildMemberStore.getNick(myGuildId!, currentUser.id) ?? currentUser.username),
|
||||
s
|
||||
);
|
||||
}
|
||||
|
||||
export default definePlugin({
|
||||
|
|
@ -177,7 +184,7 @@ export default definePlugin({
|
|||
const template = settings.store[type + "Message"];
|
||||
const user = isMe && !settings.store.sayOwnName ? "" : UserStore.getUser(userId).username;
|
||||
const displayName = user && ((UserStore.getUser(userId) as any).globalName ?? user);
|
||||
const nickname = user && (GuildMemberStore.getNick(myGuildId, userId) ?? user);
|
||||
const nickname = user && (GuildMemberStore.getNick(myGuildId!, userId) ?? user);
|
||||
const channel = ChannelStore.getChannel(id).name;
|
||||
|
||||
speak(formatText(template, user, channel, displayName, nickname));
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ import { ImageIcon } from "@components/Icons";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { openImageModal } from "@utils/discord";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import type { Channel, Guild, User } from "@vencord/discord-types";
|
||||
import { GuildMemberStore, IconUtils, Menu } from "@webpack/common";
|
||||
import type { Channel, Guild, User } from "discord-types/general";
|
||||
|
||||
|
||||
interface UserContextProps {
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ import { Margins } from "@utils/margins";
|
|||
import { copyWithToast } from "@utils/misc";
|
||||
import { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { Button, ChannelStore, Forms, GuildRoleStore, Menu, Text } from "@webpack/common";
|
||||
import { Message } from "discord-types/general";
|
||||
|
||||
|
||||
const CopyIcon = () => {
|
||||
|
|
|
|||
|
|
@ -22,10 +22,9 @@ import { sleep } from "@utils/misc";
|
|||
import { Queue } from "@utils/Queue";
|
||||
import { useForceUpdater } from "@utils/react";
|
||||
import definePlugin from "@utils/types";
|
||||
import { CustomEmoji, Message, ReactionEmoji, User } from "@vencord/discord-types";
|
||||
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
||||
import { ChannelStore, Constants, FluxDispatcher, React, RestAPI, Tooltip, useEffect, useLayoutEffect } from "@webpack/common";
|
||||
import { CustomEmoji } from "@webpack/types";
|
||||
import { Message, ReactionEmoji, User } from "discord-types/general";
|
||||
|
||||
const UserSummaryItem = findComponentByCodeLazy("defaultRenderUser", "showDefaultAvatarsForNullUsers");
|
||||
const AvatarStyles = findByPropsLazy("moreUsers", "emptyUser", "avatarContainer", "clickableAvatar");
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import { makeRange } from "@components/PluginSettings/components";
|
|||
import { Devs } from "@utils/constants";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import definePlugin, { OptionType, PluginNative, ReporterTestable } from "@utils/types";
|
||||
import type { Channel, Embed, GuildMember, MessageAttachment, User } from "@vencord/discord-types";
|
||||
import { findByCodeLazy, findLazy } from "@webpack";
|
||||
import { Button, ChannelStore, GuildRoleStore, GuildStore, UserStore } from "@webpack/common";
|
||||
import type { Channel, Embed, GuildMember, MessageAttachment, User } from "discord-types/general";
|
||||
|
||||
const ChannelTypes = findLazy(m => m.ANNOUNCEMENT_THREAD === 10);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue