diff --git a/packages/discord-types/enums/channel.ts b/packages/discord-types/enums/channel.ts new file mode 100644 index 000000000..7aae546bd --- /dev/null +++ b/packages/discord-types/enums/channel.ts @@ -0,0 +1,15 @@ +export const enum ChannelType { + GUILD_TEXT = 0, + DM = 1, + GUILD_VOICE = 2, + GROUP_DM = 3, + GUILD_CATEGORY = 4, + GUILD_ANNOUNCEMENT = 5, + ANNOUNCEMENT_THREAD = 10, + PUBLIC_THREAD = 11, + PRIVATE_THREAD = 12, + GUILD_STAGE_VOICE = 13, + GUILD_DIRECTORY = 14, + GUILD_FORUM = 15, + GUILD_MEDIA = 16 +} \ No newline at end of file diff --git a/packages/discord-types/enums/index.ts b/packages/discord-types/enums/index.ts index e2227d09f..0ab498877 100644 --- a/packages/discord-types/enums/index.ts +++ b/packages/discord-types/enums/index.ts @@ -1,2 +1,3 @@ export * from "./commands"; export * from "./messages"; +export * from "./channel"; \ No newline at end of file diff --git a/src/plugins/_api/badges/fixDiscordBadgePadding.css b/src/plugins/_api/badges/fixDiscordBadgePadding.css index eb1d60d5c..7e7702a37 100644 --- a/src/plugins/_api/badges/fixDiscordBadgePadding.css +++ b/src/plugins/_api/badges/fixDiscordBadgePadding.css @@ -1,5 +1,5 @@ /* the profile popout badge container(s) */ -[class*="biteSize_"] [class*="tags_"] [class*="container_"] { - /* Discord has padding set to 2px instead of 1px, which causes the 12th badge to wrap to a new line. */ - padding: 0 1px; -} +[class*="profile_"] [class*="tags_"] [class*="container_"] { + /* Discord has gap set to 2px instead of 1px, which causes the 12th badge to wrap to a new line. */ + gap: 1px; +} \ No newline at end of file diff --git a/src/plugins/callTimer/alignedChatInputFix.css b/src/plugins/callTimer/alignedChatInputFix.css new file mode 100644 index 000000000..9bb4a039e --- /dev/null +++ b/src/plugins/callTimer/alignedChatInputFix.css @@ -0,0 +1,4 @@ +.align-chat-input [class*="panels"] [class*="inner_"], +.align-chat-input [class*="rtcConnectionStatus_"] { + height: fit-content; +} \ No newline at end of file diff --git a/src/plugins/callTimer/index.tsx b/src/plugins/callTimer/index.tsx index ea6d7dfbd..b1f274cba 100644 --- a/src/plugins/callTimer/index.tsx +++ b/src/plugins/callTimer/index.tsx @@ -24,10 +24,36 @@ import { formatDurationMs } from "@utils/text"; import definePlugin, { OptionType } from "@utils/types"; import { React } from "@webpack/common"; +import alignedChatInputFix from "./alignedChatInputFix.css?managed"; + +function formatDuration(ms: number) { + // here be dragons (moment fucking sucks) + const human = Settings.plugins.CallTimer.format === "human"; + + const format = (n: number) => human ? n : n.toString().padStart(2, "0"); + const unit = (s: string) => human ? s : ""; + const delim = human ? " " : ":"; + + // thx copilot + const d = Math.floor(ms / 86400000); + const h = Math.floor((ms % 86400000) / 3600000); + const m = Math.floor(((ms % 86400000) % 3600000) / 60000); + const s = Math.floor((((ms % 86400000) % 3600000) % 60000) / 1000); + + let res = ""; + if (d) res += `${d}d `; + if (h || res) res += `${format(h)}${unit("h")}${delim}`; + if (m || res || !human) res += `${format(m)}${unit("m")}${delim}`; + res += `${format(s)}${unit("s")}`; + + return res; +} + export default definePlugin({ name: "CallTimer", description: "Adds a timer to vcs", authors: [Devs.Ven], + managedStyle: alignedChatInputFix, startTime: 0, interval: void 0 as NodeJS.Timeout | undefined, diff --git a/src/plugins/decor/ui/modals/CreateDecorationModal.tsx b/src/plugins/decor/ui/modals/CreateDecorationModal.tsx index 8c0670f49..6feb3b4f8 100644 --- a/src/plugins/decor/ui/modals/CreateDecorationModal.tsx +++ b/src/plugins/decor/ui/modals/CreateDecorationModal.tsx @@ -17,7 +17,7 @@ import { useCurrentUserDecorationsStore } from "../../lib/stores/CurrentUserDeco import { cl, DecorationModalStyles, requireAvatarDecorationModal, requireCreateStickerModal } from "../"; import { AvatarDecorationModalPreview } from "../components"; -const FileUpload = findComponentByCodeLazy("fileUpload),"); +const FileUpload = findComponentByCodeLazy(".fileUpload),"); const { HelpMessage, HelpMessageTypes } = mapMangledModuleLazy('POSITIVE="positive', { HelpMessageTypes: filters.byProps("POSITIVE", "WARNING", "INFO"), diff --git a/src/plugins/noReplyMention/index.tsx b/src/plugins/noReplyMention/index.tsx index b4de573f1..4af78ee29 100644 --- a/src/plugins/noReplyMention/index.tsx +++ b/src/plugins/noReplyMention/index.tsx @@ -53,7 +53,7 @@ const settings = definePluginSettings({ export default definePlugin({ name: "NoReplyMention", description: "Disables reply pings by default", - authors: [Devs.DustyAngel47, Devs.axyie, Devs.pylix, Devs.outfoxxed], + authors: [Devs.DustyAngel47, Devs.rae, Devs.pylix, Devs.outfoxxed], settings, shouldMention(message: Message, isHoldingShift: boolean) { diff --git a/src/plugins/onePingPerDM/index.ts b/src/plugins/onePingPerDM/index.ts index 6b0c31838..8a72533d9 100644 --- a/src/plugins/onePingPerDM/index.ts +++ b/src/plugins/onePingPerDM/index.ts @@ -8,13 +8,9 @@ import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; import { MessageJSON } from "@vencord/discord-types"; +import { ChannelType } from "@vencord/discord-types/enums"; import { ChannelStore, ReadStateStore, UserStore } from "@webpack/common"; -const enum ChannelType { - DM = 1, - GROUP_DM = 3 -} - const settings = definePluginSettings({ channelToAffect: { type: OptionType.SELECT, diff --git a/src/plugins/relationshipNotifier/functions.ts b/src/plugins/relationshipNotifier/functions.ts index 5bff474b6..19f360866 100644 --- a/src/plugins/relationshipNotifier/functions.ts +++ b/src/plugins/relationshipNotifier/functions.ts @@ -17,10 +17,11 @@ */ import { getUniqueUsername, openUserProfile } from "@utils/discord"; +import { ChannelType } from "@vencord/discord-types/enums"; import { UserUtils } from "@webpack/common"; import settings from "./settings"; -import { ChannelDelete, ChannelType, GuildDelete, RelationshipRemove, RelationshipType } from "./types"; +import { ChannelDelete, GuildDelete, RelationshipRemove, RelationshipType } from "./types"; import { deleteGroup, deleteGuild, getGroup, getGuild, GuildAvailabilityStore, notify } from "./utils"; let manuallyRemovedFriend: string | undefined; diff --git a/src/plugins/relationshipNotifier/types.ts b/src/plugins/relationshipNotifier/types.ts index f2e482d67..5d3d12d46 100644 --- a/src/plugins/relationshipNotifier/types.ts +++ b/src/plugins/relationshipNotifier/types.ts @@ -52,10 +52,6 @@ export interface SimpleGuild { iconURL?: string; } -export const enum ChannelType { - GROUP_DM = 3, -} - export const enum RelationshipType { FRIEND = 1, BLOCKED = 2, diff --git a/src/plugins/relationshipNotifier/utils.ts b/src/plugins/relationshipNotifier/utils.ts index aaef783b0..78371f13d 100644 --- a/src/plugins/relationshipNotifier/utils.ts +++ b/src/plugins/relationshipNotifier/utils.ts @@ -20,11 +20,12 @@ import { DataStore, Notices } from "@api/index"; import { showNotification } from "@api/Notifications"; import { getUniqueUsername, openUserProfile } from "@utils/discord"; import { FluxStore } from "@vencord/discord-types"; +import { ChannelType } from "@vencord/discord-types/enums"; import { findStoreLazy } from "@webpack"; import { ChannelStore, GuildMemberStore, GuildStore, RelationshipStore, UserStore, UserUtils } from "@webpack/common"; import settings from "./settings"; -import { ChannelType, RelationshipType, SimpleGroupChannel, SimpleGuild } from "./types"; +import { RelationshipType, SimpleGroupChannel, SimpleGuild } from "./types"; export const GuildAvailabilityStore = findStoreLazy("GuildAvailabilityStore") as FluxStore & { totalGuilds: number; diff --git a/src/plugins/whoReacted/index.tsx b/src/plugins/whoReacted/index.tsx index b6ddcafc2..85f3107c4 100644 --- a/src/plugins/whoReacted/index.tsx +++ b/src/plugins/whoReacted/index.tsx @@ -25,7 +25,7 @@ import { useForceUpdater } from "@utils/react"; import definePlugin, { OptionType } from "@utils/types"; import { CustomEmoji, Message, ReactionEmoji, User } from "@vencord/discord-types"; import { findByPropsLazy } from "@webpack"; -import { ChannelStore, Constants, FluxDispatcher, React, RestAPI, Tooltip, useEffect, useLayoutEffect, UserSummaryItem } from "@webpack/common"; +import { ChannelStore, Constants, FluxDispatcher, React, RestAPI, useEffect, useLayoutEffect, UserSummaryItem } from "@webpack/common"; const AvatarStyles = findByPropsLazy("moreUsers", "emptyUser", "avatarContainer", "clickableAvatar"); let Scroll: any = null; @@ -74,24 +74,6 @@ function getReactionsWithQueue(msg: Message, e: ReactionEmoji, type: number) { return cache.users; } -function makeRenderMoreUsers(users: User[]) { - return function renderMoreUsers(_label: string, _count: number) { - return ( - u.username).join(", ")} > - {({ onMouseEnter, onMouseLeave }) => ( -
- +{users.length - 4} -
- )} -
- ); - }; -} - function handleClickAvatar(event: React.UIEvent) { event.stopPropagation(); } @@ -185,7 +167,6 @@ export default definePlugin({ max={5} showDefaultAvatarsForNullUsers showUserPopout - renderMoreUsers={makeRenderMoreUsers(users)} /> diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 4b111e8d0..17e95b4cb 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -216,9 +216,9 @@ export const Devs = /* #__PURE__*/ Object.freeze({ name: "sunnie", id: 406028027768733696n }, - axyie: { - name: "'ax", - id: 929877747151548487n, + rae: { + name: "rae", + id: 1398136199503282277n }, pointy: { name: "pointy",