Compare commits

...

150 commits

Author SHA1 Message Date
byeoon
8324f8a015
Merge 4f6e980dc4 into 8afd79dd50 2024-09-17 22:10:36 -04:00
Vendicated
8afd79dd50
add Icons to webpack commons
Some checks are pending
Sync to Codeberg / codeberg (push) Waiting to run
test / test (push) Waiting to run
2024-09-18 01:36:52 +02:00
Vendicated
65c5897dc3
remove need to depend on CommandsAPI 2024-09-18 01:26:25 +02:00
Nuckyz
6cce8a8bc4
Experiments: Allow clips to be recorded without streaming
Some checks failed
Sync to Codeberg / codeberg (push) Has been cancelled
test / test (push) Has been cancelled
2024-09-17 14:30:23 -03:00
Nuckyz
1848b16536
ReviewDB: Fix in panel profile 2024-09-17 14:30:23 -03:00
Kyuuhachi
c572116b97
BetterSettings: Add submenu for plugins (#2858)
Co-authored-by: Vendicated <vendicated@riseup.net>
2024-09-17 15:40:11 +00:00
Lumap
e26986f66a
AppleMusicRichPresence: fix formatting when listening to radio (#2869)
Co-authored-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
Co-authored-by: v <vendicated@riseup.net>
2024-09-17 17:29:46 +02:00
byeoon
4f6e980dc4
Merge branch 'dev' into main 2024-08-29 18:53:26 -04:00
byeoon
e7faf3321e
Merge branch 'dev' into main 2024-08-17 12:30:20 -04:00
byeoon
187ca435b5
Merge branch 'dev' into main 2024-07-13 10:00:46 -04:00
byeoon
a3d4c1963f
Merge branch 'dev' into main 2024-07-10 10:12:39 -04:00
byron
cb4be3d77b wtf lint 2024-07-04 01:18:43 -04:00
byeoon
ae6290a605
Merge branch 'dev' into main 2024-07-04 01:12:59 -04:00
byron
0561b3890a fix thing no work 2024-06-21 21:16:05 -04:00
byron
ec4e97b187 might fully work now!! 2024-06-21 21:12:59 -04:00
byeoon
3b20759c60
Merge branch 'dev' into main 2024-06-21 20:31:17 -04:00
byron
5e52a34205 hewlp vinneie vnecord no work 2024-06-21 20:31:05 -04:00
byron
2cd661f7b6 YAY this should work!! 2024-06-21 20:11:30 -04:00
byeoon
e88e3b3e13
Merge branch 'dev' into main 2024-06-15 19:00:08 -04:00
byron
db4c0d1446 test 2024-06-12 17:32:49 -04:00
byeoon
1de442a84b
Merge branch 'dev' into main 2024-06-12 09:47:56 -04:00
byeoon
c93f694faf
found switch / checkbox element 2024-06-11 09:08:15 -04:00
byron
f045554bfe yay its undefined for some reason 2024-06-10 16:51:25 -04:00
byron
5180df743b todo: add finishing touches and fix bugs because webhooks arent sending rn 2024-06-10 16:46:10 -04:00
byron
f84220eada feat: modal!! (still wip) 2024-06-10 16:35:08 -04:00
byeoon
588a40c43f
fuck lint. 2024-06-10 13:53:58 -04:00
byeoon
56be5eb247
i swear to god if this doesnt fix it 2024-06-10 13:53:06 -04:00
byeoon
9ad6e1b3a2
??????? 2024-06-10 13:51:19 -04:00
byeoon
c0842cb84c
forgot imports! 2024-06-10 13:49:57 -04:00
byeoon
fc3618628f
fix: lint and code error with modal template 2024-06-10 13:48:41 -04:00
byeoon
2721cd3d47
fix lint breaking 2024-06-10 09:49:48 -04:00
byeoon
1da50eb8f4
todo: add modal 2024-06-10 09:47:50 -04:00
byeoon
8696ca0706
fix: small bug with webhook execution & added vee to devs because they helped a lot (tysm) 2024-06-10 09:37:37 -04:00
byeoon
070b25e813
Merge branch 'dev' into main 2024-06-10 09:32:33 -04:00
byron
90c9dd20bb change name in constants 2024-06-07 22:27:39 -04:00
byron
dcb9402f1c Merge branch 'main' of https://github.com/byeoon/Vencord 2024-06-07 22:25:56 -04:00
byron
bc3093a41e removed tts thing because i think most people have tts muted anyways and also too much to add also small fixes 2024-06-07 22:25:55 -04:00
byeoon
6c19f52f26
Merge branch 'dev' into main 2024-06-07 22:21:32 -04:00
byeoon
b63becffb6
Merge branch 'dev' into main 2024-06-07 22:21:25 -04:00
byeoon
7a1a9d20e8
Merge branch 'dev' into main 2024-06-07 22:20:24 -04:00
Vendicated
ae10deaee4
fix 2024-06-08 03:41:45 +02:00
Vendicated
61eacb2106
fix folder name part 2 2024-06-08 03:38:31 +02:00
Vendicated
b3a9d33411
clean up 2024-06-08 03:38:09 +02:00
byeoon
e764018621
Merge branch 'dev' into main 2024-06-07 21:30:49 -04:00
Vendicated
cafe4b19a2
fix folder name 2024-06-08 03:29:39 +02:00
byeoon
422c18c37c
Merge branch 'dev' into main 2024-06-07 16:04:41 -04:00
byeoon
d7036c5886
shorter lines
Co-authored-by: vee <vendicated@riseup.net>
2024-06-07 16:02:24 -04:00
byeoon
9ee1b5ba6e
Update src/plugins/WebhookManager/index.tsx
Co-authored-by: vee <vendicated@riseup.net>
2024-06-07 16:01:46 -04:00
byeoon
0d4ec94203
Merge branch 'dev' into main 2024-06-06 08:33:29 -04:00
byeoon
0df09f2aab
blep small fix
Co-authored-by: vee <vendicated@riseup.net>
2024-06-06 08:33:15 -04:00
byeoon
2728102fbc
Merge branch 'dev' into main 2024-06-05 23:15:31 -04:00
byeoon
249ea30995
holy shit since when coild READMEs look this good
Co-authored-by: vee <vendicated@riseup.net>
2024-06-05 23:10:29 -04:00
byeoon
8d2fa0e45f
Merge branch 'dev' into main 2024-05-31 09:13:30 -04:00
byeoon
adc60648a5
Merge branch 'dev' into main 2024-05-30 09:34:31 -04:00
Nuckyz
9a9c1b0487
Reporter: Properly implement reporter build of Vencord; Test more plugins; Fix running in wrong pages 2024-05-30 04:44:13 -03:00
Nuckyz
892de53603
Fix extractAndLoadChunks issue with 2 match groups; Improve testing of lazy extractAndLoadChunks 2024-05-30 00:51:23 -03:00
Nuckyz
c8602ef52b
Fix reporter breaking because of ConsoleShortcuts 2024-05-29 06:45:44 -03:00
byeoon
c88ac8d5ca
Merge branch 'dev' into main 2024-05-28 23:36:24 -04:00
byeoon
de2598a87a
Merge branch 'dev' into main 2024-05-24 12:32:42 -04:00
byeoon
c3af902ace
Merge branch 'dev' into main 2024-05-21 09:27:10 -04:00
byron
e04225df1a Merge branch 'main' of https://github.com/byeoon/Vencord 2024-05-20 17:36:50 -04:00
byeoon
dec282bf50
Merge branch 'dev' into main 2024-05-20 15:57:31 -04:00
byron
d29d5e9476 revert error change 2024-05-20 15:53:56 -04:00
byeoon
46e4fc664a
oopsie 2024-05-15 09:49:32 -04:00
byeoon
e9cb2eccec
Merge branch 'dev' into main 2024-05-15 09:47:42 -04:00
byeoon
f0483f9c24
why cant i remove the stores.ts conflict 2024-05-15 09:46:10 -04:00
byeoon
13119c0b29
extra error handling - will add more later 2024-05-15 09:43:30 -04:00
byeoon
720aaf6f3e
Merge branch 'dev' into main 2024-05-07 07:53:47 -04:00
Nuckyz
f04bd8a7ad
useStateFromStores: Document 3rd param and fix JSDoc 2024-05-07 06:13:38 -03:00
byeoon
acf77127c8
Merge branch 'dev' into main 2024-05-03 20:26:51 -04:00
byeoon
530e19e266
Merge branch 'dev' into main 2024-05-02 10:39:41 -04:00
byron
7f36d8569f fixed lint 2024-05-01 18:07:11 -04:00
byron
28f70e2942 fix embed color not being blue, fix webhook profile picture not appearing, fix deleting webhooks not working, general code and QoL improvements 2024-05-01 18:02:14 -04:00
byeoon
6d704d603e
Merge branch 'dev' into main 2024-05-01 16:52:23 -04:00
byeoon
65787848c4
Merge branch 'dev' into main 2024-04-22 13:03:05 -04:00
byeoon
73ca8dc776
Merge branch 'Vendicated:main' into main 2024-04-17 14:39:24 -04:00
byron
209c64afc4
Merge branch 'dev' into main 2024-04-09 18:47:50 -04:00
byron
b4366bdab6
small code refactors and changes to text 2024-04-09 12:32:53 -04:00
byron
70ae9eabf4
Merge branch 'dev' into main 2024-04-09 12:24:51 -04:00
byron
d739675413
Merge branch 'dev' into main 2024-04-08 22:01:57 -04:00
byron
2462544d61
Merge branch 'dev' into main 2024-04-08 21:20:29 -04:00
byron
6022317d5e
Merge pull request #1 from byeoon/fixEmoteCloneQuality 2024-04-08 21:16:35 -04:00
byron
8f0204b4ca
Discard changes to src/utils/constants.ts 2024-04-08 21:13:57 -04:00
byron
f801ab3cb9
Discard changes to src/plugins/emoteCloner/index.tsx 2024-04-08 21:13:50 -04:00
byron
8c48731026 this shit is confusing me 2024-04-08 21:06:20 -04:00
byron
31993c0053 oops readme was broken fixed it again 2024-04-08 21:05:26 -04:00
byron
1dc98721ee Instead of logging to console when there's an error, log it to the webhook message, also fixes to the README 2024-04-08 20:52:50 -04:00
V
6266d037e7
Merge branch 'dev' into fixEmoteCloneQuality 2024-04-09 02:30:29 +02:00
V
4c466e9c04
Update index.tsx 2024-04-09 02:29:58 +02:00
V
522d2fd35c
lossless 2024-04-09 02:29:20 +02:00
byron
e24d5d3f93
Update src/plugins/emoteCloner/index.tsx
Co-authored-by: ryan-0324 <77452312+ryan-0324@users.noreply.github.com>
2024-04-03 18:39:46 -04:00
byron
521647b4e1 merged into above statement 2024-04-03 17:32:17 -04:00
byron
23992bd213 fixed an issue where external emotes would count towards the max emote limit 2024-04-03 17:20:37 -04:00
byron
bc64dd400a fixed a bug where external emotes counted towards the limit (twitch) 2024-04-03 17:19:00 -04:00
byron
38647087e0
update to actual highest quality
Co-authored-by: Nam Anh <phamnamanh25@gmail.com>
2024-04-02 07:28:15 -04:00
byron
c5d03bab3b oopsie idk why i added words there 2024-03-31 23:20:51 -04:00
byron
abf48db04d (fix)Fixed a bug where EmoteCloner would clone stickers at the lowest resolution (now defaults to 2048) 2024-03-31 23:15:28 -04:00
byron
2c11a7ad84 Set the default sticker size to 2048 to prevent downscaling, also, time to put this into a second branch 2024-03-31 23:04:32 -04:00
byron
570e41b95c bruh moment i should probably change forks 2024-03-31 22:43:46 -04:00
byron
b722513662 add debug to check sticker output 2024-03-31 22:40:16 -04:00
byron
e608170820
Merge branch 'main' into main 2024-03-29 21:24:58 -04:00
byron
082227301e
Merge branch 'main' into main 2024-03-28 23:45:23 -04:00
byron
f87c73685e
Merge branch 'main' into main 2024-03-28 02:03:13 -04:00
byron
04c4c85ea7
Merge branch 'main' into main 2024-03-28 01:27:36 -04:00
byron
82cc75ecc8
Merge branch 'main' into main 2024-03-27 23:14:12 -04:00
byron
39b3e747f9
also updating dev label to be on proper account 2024-03-27 00:17:31 -04:00
byron
83fedd4df1
remove empty lines 2024-03-27 00:16:41 -04:00
byron
9edb4c01f2
test 2024-03-22 10:06:57 -04:00
Nuckyz
c542a81986
Merge branch 'main' into main 2024-03-22 10:47:34 -03:00
byron
1d93a03654
revert 2024-03-22 09:40:42 -04:00
byron
1a106e755b
TEMP DOING THIS JUST TO FIX BRANCH ISSUE 2024-03-22 09:39:01 -04:00
byron
c2a8671f31 linting and testing all over the place 2024-03-21 18:35:04 -04:00
byron
3ec9f7cf89 test push that hopefully fixes something 2024-03-21 18:32:35 -04:00
byron
7c71d9f52d added url validation 2024-03-21 17:27:57 -04:00
byron
2ac335c3f4
handle if there is no profile pic option, also making it string only because compatibility issues 2024-03-18 11:28:08 -04:00
byron
1947cedd55 oops forgot to add back the if statement 2024-03-15 21:31:05 -04:00
byron
610c48fe92 hope this adds attachment support, if not i may need help 2024-03-15 21:25:15 -04:00
byron
736fef879e removed unneeded / unreachable code, changed 'rawjson' to just 'raw', working on attachment sending as well 2024-03-15 21:18:53 -04:00
byron
8a09cb533b Could simplify this to one variable instead 2024-03-15 21:00:40 -04:00
byron
9c7c3d0c5d fixed that god-awful annoying bug where you couldnt use the default webhook name 2024-03-15 18:44:30 -04:00
byron
f43f404123
put the pingable text into 'content' and not the embed, also added the ability to get the userID for simplicity 2024-03-14 11:03:54 -04:00
byron
73a2f5548a now* it's ready 2024-03-13 18:03:31 -04:00
byron
2da6a64748 Ready for reviews / feedback 2024-03-13 18:02:42 -04:00
byron
9fab41449a Added extra information for 'Type 2' Webhooks (Server Following / Announcements), more small tweaks to the embed 2024-03-13 17:46:28 -04:00
byron
1225861843 Fixed bug that was caused when doing /webhook info, also updated the embed style and looks better 2024-03-13 17:28:58 -04:00
byron
9b600b9dad
*quickly changed some grammar* 2024-03-13 13:57:14 -04:00
byron
6df510d9f5
Added title to embed, fixed accidental leftover symbols 2024-03-13 13:20:48 -04:00
byron
a6c7cb9517
Also added the ability to send webhooks with TTS (For the sillies and goofs) 2024-03-13 13:07:51 -04:00
byron
4cb2661ae9
Also fixed the commands to be better 2024-03-13 12:52:25 -04:00
byron
0fd7a59d8a
literal string for webhookinfo, also inside of an embed, better way to format the icon instead of clicking now. 2024-03-13 12:47:22 -04:00
byron
f2b22bc349
Removed notes, fully moved logging to Logger, fixed everything back to const (thank you) 2024-03-13 12:15:39 -04:00
byron
2f1c10de3e
me when im at school and bored and decide to keep on making improvements :trolley: 2024-03-13 11:03:52 -04:00
byron
1c3e33dbbd
Logger for error handling instead of console.log 2024-03-13 09:18:16 -04:00
byron
9060352977
re-discarded changes to .gitignore (sorry) 2024-03-12 22:36:55 -04:00
byron
4ea2d1ca5c
Fixed a ton of things, thank you suggestions and code reviews 2024-03-12 22:34:10 -04:00
V
284a951353
Discard changes to .gitignore 2024-03-13 03:23:51 +01:00
byron
d02a241ff9 (also fixed small bug where creator username would be undefined) 2024-03-12 21:49:36 -04:00
byron
cedf10bdd2 removed personal plugin i use before pull request (its in .gitignore i think) also added logging to console on getinfo 2024-03-12 21:47:15 -04:00
byron
4f68631080 Finally did it, fixed the sending bug 2024-03-12 21:45:52 -04:00
byron
278c4f0d60 Plugin now crashes, but im pushing to see if i accidnetally messed with another file 2024-03-12 19:38:34 -04:00
byron
ba0a9d0696 Fixed issues with plugin not loading, and fixed bugs 2024-03-12 14:56:40 -04:00
byron
f41c6f4762
Learned that I'm supposed to actually put the plugins in /plugins and not /userplugins, moved plugin into correct directory and fixed the .gitignore 2024-03-12 13:53:41 -04:00
byron
87e86271fe
Forgot to add error to console, removed dumb note I added in badge thing 2024-03-12 13:29:41 -04:00
byron
3dd65d520e
/webhookinfo has the ability to get a pingable version of the creator, webhook deletion now can determine if the URL is valid 2024-03-12 11:52:55 -04:00
byron
369f66e810
Added 'Creator Username' section for webhookinfo and adding text to speech on sending webhook message 2024-03-12 10:24:23 -04:00
byron
0207b9fa12
[style]fix missing line 2024-03-12 08:55:10 -04:00
byron
2c20a85871 Webhook info works, deleting also works, sending is still a WIP. 2024-03-11 21:51:24 -04:00
byron
ff6f24b8c9 Fixed bugs with plugin, on pc now & i use other plugins so i put it in gitignore 2024-03-11 16:15:58 -04:00
byron
bde85e073a
added second command, also added to devs for simplicity not sure if i should YET tho 2024-03-11 12:55:39 -04:00
byron
ccce4952cc
create plugin, haven't tested yet but will soon 2024-03-11 12:43:10 -04:00
25 changed files with 377 additions and 39 deletions

View file

@ -292,10 +292,10 @@ export default function PluginSettings() {
if (!pluginFilter(p)) continue;
const isRequired = p.required || depMap[p.name]?.some(d => settings.plugins[d].enabled);
const isRequired = p.required || p.isDependency || depMap[p.name]?.some(d => settings.plugins[d].enabled);
if (isRequired) {
const tooltipText = p.required
const tooltipText = p.required || !depMap[p.name]
? "This plugin is required for Vencord to function."
: makeDependencyList(depMap[p.name]?.filter(d => settings.plugins[d].enabled));

View file

@ -142,7 +142,7 @@ export default definePlugin({
required: true,
description: "Helps us provide support to you",
authors: [Devs.Ven],
dependencies: ["CommandsAPI", "UserSettingsAPI", "MessageAccessoriesAPI"],
dependencies: ["UserSettingsAPI", "MessageAccessoriesAPI"],
settings,

View file

@ -24,7 +24,7 @@ interface ActivityButton {
}
interface Activity {
state: string;
state?: string;
details?: string;
timestamps?: {
start?: number;
@ -52,8 +52,8 @@ const enum ActivityFlag {
export interface TrackData {
name: string;
album: string;
artist: string;
album?: string;
artist?: string;
appleMusicLink?: string;
songLink?: string;
@ -61,8 +61,8 @@ export interface TrackData {
albumArtwork?: string;
artistArtwork?: string;
playerPosition: number;
duration: number;
playerPosition?: number;
duration?: number;
}
const enum AssetImageType {
@ -155,8 +155,8 @@ const settings = definePluginSettings({
function customFormat(formatStr: string, data: TrackData) {
return formatStr
.replaceAll("{name}", data.name)
.replaceAll("{album}", data.album)
.replaceAll("{artist}", data.artist);
.replaceAll("{album}", data.album ?? "")
.replaceAll("{artist}", data.artist ?? "");
}
function getImageAsset(type: AssetImageType, data: TrackData) {
@ -212,14 +212,16 @@ export default definePlugin({
const assets: ActivityAssets = {};
const isRadio = Number.isNaN(trackData.duration) && (trackData.playerPosition === 0);
if (settings.store.largeImageType !== AssetImageType.Disabled) {
assets.large_image = largeImageAsset;
assets.large_text = customFormat(settings.store.largeTextString, trackData);
if (!isRadio) assets.large_text = customFormat(settings.store.largeTextString, trackData);
}
if (settings.store.smallImageType !== AssetImageType.Disabled) {
assets.small_image = smallImageAsset;
assets.small_text = customFormat(settings.store.smallTextString, trackData);
if (!isRadio) assets.small_text = customFormat(settings.store.smallTextString, trackData);
}
const buttons: ActivityButton[] = [];
@ -243,17 +245,17 @@ export default definePlugin({
name: customFormat(settings.store.nameString, trackData),
details: customFormat(settings.store.detailsString, trackData),
state: customFormat(settings.store.stateString, trackData),
state: isRadio ? undefined : customFormat(settings.store.stateString, trackData),
timestamps: (settings.store.enableTimestamps ? {
timestamps: (trackData.playerPosition && trackData.duration && settings.store.enableTimestamps) ? {
start: Date.now() - (trackData.playerPosition * 1000),
end: Date.now() - (trackData.playerPosition * 1000) + (trackData.duration * 1000),
} : undefined),
} : undefined,
assets,
buttons: buttons.length ? buttons.map(v => v.label) : undefined,
metadata: { button_urls: buttons.map(v => v.url) || undefined, },
buttons: !isRadio && buttons.length ? buttons.map(v => v.label) : undefined,
metadata: !isRadio && buttons.length ? { button_urls: buttons.map(v => v.url) } : undefined,
type: settings.store.activityType,
flags: ActivityFlag.INSTANCE,

View file

@ -0,0 +1,68 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { openPluginModal } from "@components/PluginSettings/PluginModal";
import { isObjectEmpty } from "@utils/misc";
import { Alerts, i18n, Menu, useMemo, useState } from "@webpack/common";
import Plugins from "~plugins";
function onRestartNeeded() {
Alerts.show({
title: "Restart required",
body: <p>You have changed settings that require a restart.</p>,
confirmText: "Restart now",
cancelText: "Later!",
onConfirm: () => location.reload()
});
}
export default function PluginsSubmenu() {
const sortedPlugins = useMemo(() => Object.values(Plugins)
.sort((a, b) => a.name.localeCompare(b.name)), []);
const [query, setQuery] = useState("");
const search = query.toLowerCase();
const include = (p: typeof Plugins[keyof typeof Plugins]) => (
Vencord.Plugins.isPluginEnabled(p.name)
&& p.options && !isObjectEmpty(p.options)
&& (
p.name.toLowerCase().includes(search)
|| p.description.toLowerCase().includes(search)
|| p.tags?.some(t => t.toLowerCase().includes(search))
)
);
const plugins = sortedPlugins.filter(include);
return (
<>
<Menu.MenuControlItem
id="vc-plugins-search"
control={(props, ref) => (
<Menu.MenuSearchControl
{...props}
query={query}
onChange={setQuery}
ref={ref}
placeholder={i18n.Messages.SEARCH}
/>
)}
/>
{!!plugins.length && <Menu.MenuSeparator />}
{plugins.map(p => (
<Menu.MenuItem
key={p.name}
id={p.name}
label={p.name}
action={() => openPluginModal(p, onRestartNeeded)}
/>
))}
</>
);
}

View file

@ -13,6 +13,8 @@ import { waitFor } from "@webpack";
import { ComponentDispatch, FocusLock, i18n, Menu, useEffect, useRef } from "@webpack/common";
import type { HTMLAttributes, ReactElement } from "react";
import PluginsSubmenu from "./PluginsSubmenu";
type SettingsEntry = { section: string, label: string; };
const cl = classNameFactory("");
@ -118,13 +120,21 @@ export default definePlugin({
},
{ // Settings cog context menu
find: "Messages.USER_SETTINGS_ACTIONS_MENU_LABEL",
replacement: {
match: /(EXPERIMENTS:.+?)(\(0,\i.\i\)\(\))(?=\.filter\(\i=>\{let\{section:\i\}=)/,
replace: "$1$self.wrapMenu($2)"
}
}
replacement: [
{
match: /(EXPERIMENTS:.+?)(\(0,\i.\i\)\(\))(?=\.filter\(\i=>\{let\{section:\i\}=)/,
replace: "$1$self.wrapMenu($2)"
},
{
match: /case \i\.\i\.DEVELOPER_OPTIONS:return \i;/,
replace: "$&case 'VencordPlugins':return $self.PluginsSubmenu();"
}
]
},
],
PluginsSubmenu,
// This is the very outer layer of the entire ui, so we can't wrap this in an ErrorBoundary
// without possibly also catching unrelated errors of children.
//

View file

@ -126,7 +126,7 @@ export default definePlugin({
}
},
{
find: '"Handling ping: "',
find: '"_handleLocalVideoDisabled: ',
predicate: () => settings.store.disableNoisyLoggers,
replacement: {
match: /new \i\.\i\("RTCConnection\("\.concat.+?\)\)(?=,)/,

View file

@ -23,12 +23,13 @@ import { ErrorCard } from "@components/ErrorCard";
import { Devs } from "@utils/constants";
import { Margins } from "@utils/margins";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack";
import { findByPropsLazy, findLazy } from "@webpack";
import { Forms, React } from "@webpack/common";
import hideBugReport from "./hideBugReport.css?managed";
const KbdStyles = findByPropsLazy("key", "combo");
const BugReporterExperiment = findLazy(m => m?.definition?.id === "2024-09_bug_reporter");
const settings = definePluginSettings({
toolbarDevMenu: {
@ -78,8 +79,8 @@ export default definePlugin({
{
find: "toolbar:function",
replacement: {
match: /\i\.isStaff\(\)/,
replace: "true"
match: /hasBugReporterAccess:(\i)/,
replace: "_hasBugReporterAccess:$1=true"
},
predicate: () => settings.store.toolbarDevMenu
},
@ -91,10 +92,18 @@ export default definePlugin({
match: /\i\.isDM\(\)\|\|\i\.isThread\(\)/,
replace: "false",
}
},
// enable option to always record clips even if you are not streaming
{
find: "isDecoupledGameClippingEnabled(){",
replacement: {
match: /\i\.isStaff\(\)/,
replace: "true"
}
}
],
start: () => enableStyle(hideBugReport),
start: () => !BugReporterExperiment.getCurrentConfig().hasBugReporterAccess && enableStyle(hideBugReport),
stop: () => disableStyle(hideBugReport),
settingsAboutComponent: () => {

View file

@ -27,7 +27,6 @@ export default definePlugin({
name: "FriendInvites",
description: "Create and manage friend invite links via slash commands (/create friend invite, /view friend invites, /revoke friend invites).",
authors: [Devs.afn, Devs.Dziurwa],
dependencies: ["CommandsAPI"],
commands: [
{
name: "create friend invite",

View file

@ -105,6 +105,11 @@ for (const p of pluginsValues) if (isPluginEnabled(p.name)) {
settings[d].enabled = true;
dep.isDependency = true;
});
if (p.commands?.length) {
Plugins.CommandsAPI.isDependency = true;
settings.CommandsAPI.enabled = true;
}
}
for (const p of pluginsValues) {

View file

@ -82,7 +82,6 @@ export default definePlugin({
default: true
}
},
dependencies: ["CommandsAPI"],
async start() {
for (const tag of await getTags()) createTagCommand(tag);

View file

@ -33,7 +33,6 @@ export default definePlugin({
name: "MoreCommands",
description: "echo, lenny, mock",
authors: [Devs.Arjix, Devs.echo, Devs.Samu],
dependencies: ["CommandsAPI"],
commands: [
{
name: "echo",

View file

@ -24,7 +24,6 @@ export default definePlugin({
name: "MoreKaomoji",
description: "Adds more Kaomoji to discord. ヽ(´▽`)/",
authors: [Devs.JacobTm],
dependencies: ["CommandsAPI"],
commands: [
{ name: "dissatisfaction", description: " " },
{ name: "smug", description: "ಠ_ಠ" },

View file

@ -88,7 +88,6 @@ export default definePlugin({
name: "petpet",
description: "Adds a /petpet slash command to create headpet gifs from any image",
authors: [Devs.Ven],
dependencies: ["CommandsAPI"],
commands: [
{
inputType: ApplicationCommandInputType.BUILT_IN,

View file

@ -91,7 +91,7 @@ export default definePlugin({
}
},
{
find: ".PANEL,isInteractionSource:",
find: ".PANEL,interactionType:",
replacement: {
match: /{profileType:\i\.\i\.PANEL,children:\[/,
replace: "$&$self.BiteSizeReviewsButton({user:arguments[0].user}),"

View file

@ -88,7 +88,7 @@ export default definePlugin({
name: "SilentTyping",
authors: [Devs.Ven, Devs.Rini, Devs.ImBanana],
description: "Hide that you are typing",
dependencies: ["CommandsAPI", "ChatInputButtonAPI"],
dependencies: ["ChatInputButtonAPI"],
settings,
contextMenus: {
"textarea-context": ChatBarContextCheckbox

View file

@ -76,7 +76,6 @@ export default definePlugin({
name: "SpotifyShareCommands",
description: "Share your current Spotify track, album or artist via slash command (/track, /album, /artist)",
authors: [Devs.katlyn],
dependencies: ["CommandsAPI"],
commands: [
{
name: "track",

View file

@ -0,0 +1,21 @@
# WebhookManager
Manage your webhooks easily; delete, send messages, get detailed info and more.
## Commands
- /webhook send - *Sends a message through a webhook.*
- /webhook delete - *Deletes any webhook that is specified.*
- /webhook info - *Gets advanced details on the webhook such as the name, profile pic, server and channel ID, and additionally, information on person who created it*
<details>
<summary>Full /webhookinfo Output</summary>
- Webhook Username
- Webhook ID
- Webhook Token
- Channel ID
- Server ID
- Webhook Profile Picture
- Webhook Type
- Creator Profile
</details>

View file

@ -0,0 +1,176 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands";
import { Devs } from "@utils/constants";
import { Margins } from "@utils/margins";
import { ModalContent, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
import definePlugin, { PluginNative } from "@utils/types";
import { Button, Forms, React, Switch, TextInput, useState } from "@webpack/common";
const Native = VencordNative.pluginHelpers.WebhookManager as PluginNative<typeof import("./native")>;
let url, content, username, avatarUrl = "";
let jsonMode = false;
// TODO: add sending as raw
function WebhookMessageModal(props: ModalProps) {
const [params, setParams] = useState({ content: "", username: "", avatarUrl: "", url: "", jsonMode: false });
const onURL = (url: string) => setParams(prev => ({ ...prev, url }));
const onContent = (content: string) => setParams(prev => ({ ...prev, content }));
const onUsername = (username: string) => setParams(prev => ({ ...prev, username }));
const onAvatar = (avatarUrl: string) => setParams(prev => ({ ...prev, avatarUrl }));
const onSwitch = (jsonMode: boolean) => setParams(prev => ({ ...prev, jsonMode }));
return <ModalRoot {...props} size={ModalSize.MEDIUM} className={"wm-send-webhook"} >
<ModalContent className="wm-send-webhook-content">
<Forms.FormTitle className={Margins.top20}>Webhook URL</Forms.FormTitle>
<TextInput
placeholder={"Webhook URL"}
value={params.url}
onChange={onURL}
/>
<Forms.FormTitle className={Margins.top20}>Webhook Message</Forms.FormTitle>
<TextInput
placeholder={"Content"}
value={params.content}
onChange={onContent}
/>
<Forms.FormTitle className={Margins.top20}>Webhook Username</Forms.FormTitle>
<TextInput
placeholder={"Username"}
value={params.username}
onChange={onUsername}
/>
<Forms.FormTitle className={Margins.top20}>Webhook Avatar URL</Forms.FormTitle>
<TextInput
placeholder={"Image URL"}
value={params.avatarUrl}
onChange={onAvatar}
/>
<Switch
key="wm-raw"
value={jsonMode}
onChange={onSwitch}
>Send as Raw JSON</Switch>
<Button
onClick={() => {
if (jsonMode !== true) {
Native.executeWebhook(params.url, {
content: params.content,
username: params.username,
avatar_url: params.avatarUrl
});
}
else {
Native.executeWebhook(params.url, {
webhookMessage: params.content,
username: params.username,
avatar_url: params.avatarUrl
});
}
}}
>Send Webhook</Button>
</ModalContent>
</ModalRoot >;
}
export default definePlugin({
name: "WebhookManager",
description: "Manage your webhooks easily; delete, send messages, get detailed info and more.",
authors: [Devs.Byeoon, Devs.Ven],
dependencies: ["CommandsAPI"],
commands: [
{
name: "webhook delete",
description: "Delete a webhook.",
inputType: ApplicationCommandInputType.BUILT_IN,
options: [
{
name: "url",
description: "The URL of the webhook",
type: ApplicationCommandOptionType.STRING,
required: true
}
],
execute: async (option, ctx) => {
try {
await fetch(findOption(option, "url", ""), {
method: "DELETE"
});
sendBotMessage(ctx.channel.id, {
content: "The webhook has deleted successfully."
});
}
catch (error) {
sendBotMessage(ctx.channel.id, {
content: "There was an error deleting the webhook. Did you input a valid webhook URL? Error: " + error
});
}
}
},
{
name: "webhook info",
description: "Retrieve information about a webhook.",
inputType: ApplicationCommandInputType.BUILT_IN,
options: [
{
name: "url",
description: "The URL of the webhook",
type: ApplicationCommandOptionType.STRING,
required: true
}
],
execute: async (option, ctx) => {
const webhookUrl = findOption(option, "url", "");
const { user, avatar, name, id, token, type, channel_id, guild_id }
= await fetch(webhookUrl).then(res => res.json());
sendBotMessage(ctx.channel.id, {
content: `This webhook was created by ${user?.name}.`,
embeds: [
{
title: "Webhook Information",
color: "1323",
// @ts-ignore
author: {
name,
url: ""
},
thumbnail: {
url: `https://cdn.discordapp.com/avatars/${id}/${avatar}.png`,
proxyURL: `https://cdn.discordapp.com/avatars/${id}/${avatar}.png`,
height: 128,
width: 128
},
description: `
Webhook ID: ${id}
Webhook Token: ${token}
Webhook Type: ${type}
Channel ID: ${channel_id}
Server ID: ${guild_id}
`
}
]
});
}
},
{
name: "webhook send",
description: "Send a message through a webhook.",
inputType: ApplicationCommandInputType.BUILT_IN,
async execute(_, ctx) {
openModal(props => <WebhookMessageModal {...props} />);
sendBotMessage(ctx.channel.id, {
content: "Your webhook message has been executed."
});
}
}
]
});

View file

@ -0,0 +1,22 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { IpcMainInvokeEvent } from "electron";
import https from "https";
const DiscordHosts = new Set(["discord.com", "ptb.discord.com", "canary.discord.com"]);
export function executeWebhook(_event: IpcMainInvokeEvent, url: string, body: object) {
const { hostname, pathname } = new URL(url);
if (!DiscordHosts.has(hostname) || !pathname.startsWith("/api/webhooks/")) {
throw new Error("This URL is not a valid webhook.");
}
const req = https.request(url, { method: "POST", headers: { "Content-Type": "application/json", } });
req.write(JSON.stringify(body));
req.end();
}

View file

@ -475,7 +475,7 @@ export const Devs = /* #__PURE__*/ Object.freeze({
name: "Sqaaakoi",
id: 259558259491340288n
},
Byron: {
Byeoon: {
name: "byeoon",
id: 1167275288036655133n
},

View file

@ -72,13 +72,13 @@ export interface PluginDef {
stop?(): void;
patches?: Omit<Patch, "plugin">[];
/**
* List of commands. If you specify these, you must add CommandsAPI to dependencies
* List of commands that your plugin wants to register
*/
commands?: Command[];
/**
* A list of other plugins that your plugin depends on.
* These will automatically be enabled and loaded before your plugin
* Common examples are CommandsAPI, MessageEventsAPI...
* Generally these will be API plugins
*/
dependencies?: string[],
/**

View file

@ -28,6 +28,8 @@ export let Forms = {} as {
FormText: t.FormText,
};
export let Icons = {} as t.Icons;
export let Card: t.Card;
export let Button: t.Button;
export let Switch: t.Switch;
@ -85,4 +87,5 @@ waitFor(["FormItem", "Button"], m => {
Heading
} = m);
Forms = m;
Icons = m;
});

View file

@ -18,6 +18,8 @@
import type { ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from "react";
import { IconNames } from "./iconNames";
export type TextVariant = "heading-sm/normal" | "heading-sm/medium" | "heading-sm/semibold" | "heading-sm/bold" | "heading-md/normal" | "heading-md/medium" | "heading-md/semibold" | "heading-md/bold" | "heading-lg/normal" | "heading-lg/medium" | "heading-lg/semibold" | "heading-lg/bold" | "heading-xl/normal" | "heading-xl/medium" | "heading-xl/bold" | "heading-xxl/normal" | "heading-xxl/medium" | "heading-xxl/bold" | "eyebrow" | "heading-deprecated-14/normal" | "heading-deprecated-14/medium" | "heading-deprecated-14/bold" | "text-xxs/normal" | "text-xxs/medium" | "text-xxs/semibold" | "text-xxs/bold" | "text-xs/normal" | "text-xs/medium" | "text-xs/semibold" | "text-xs/bold" | "text-sm/normal" | "text-sm/medium" | "text-sm/semibold" | "text-sm/bold" | "text-md/normal" | "text-md/medium" | "text-md/semibold" | "text-md/bold" | "text-lg/normal" | "text-lg/medium" | "text-lg/semibold" | "text-lg/bold" | "display-sm" | "display-md" | "display-lg" | "code";
export type FormTextTypes = Record<"DEFAULT" | "INPUT_PLACEHOLDER" | "DESCRIPTION" | "LABEL_BOLD" | "LABEL_SELECTED" | "LABEL_DESCRIPTOR" | "ERROR" | "SUCCESS", string>;
export type HeadingTag = `h${1 | 2 | 3 | 4 | 5 | 6}`;
@ -69,7 +71,7 @@ export type FormText = ComponentType<PropsWithChildren<{
}> & TextProps> & { Types: FormTextTypes; };
export type Tooltip = ComponentType<{
text: ReactNode;
text: ReactNode | ComponentType;
children: FunctionComponent<{
onClick(): void;
onMouseEnter(): void;
@ -502,3 +504,10 @@ export type Avatar = ComponentType<PropsWithChildren<{
type FocusLock = ComponentType<PropsWithChildren<{
containerRef: RefObject<HTMLElement>;
}>>;
export type Icon = ComponentType<JSX.IntrinsicElements["svg"] & {
size?: string;
colorClass?: string;
} & Record<string, any>>;
export type Icons = Record<IconNames, Icon>;

14
src/webpack/common/types/iconNames.d.ts vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -72,6 +72,11 @@ export interface Menu {
onChange(value: number): void,
renderValue?(value: number): string,
}>;
MenuSearchControl: RC<{
query: string
onChange(query: string): void;
placeholder?: string;
}>;
}
export interface ContextMenuApi {