aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/consoleShortcuts.ts
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-10-05 14:25:37 +0200
committerVendicated <vendicated@riseup.net>2022-10-05 14:30:21 +0200
commit3e0355cb531c622c18c6bdfc3105572b3446be92 (patch)
treee968bfaefed2f04fe63174638480e1b50857a8e2 /src/plugins/consoleShortcuts.ts
parent7e526e4172412eba720ffd1fa34511046ef47e6b (diff)
downloadVencord-3e0355cb531c622c18c6bdfc3105572b3446be92.tar.gz
Vencord-3e0355cb531c622c18c6bdfc3105572b3446be92.tar.bz2
Vencord-3e0355cb531c622c18c6bdfc3105572b3446be92.zip
Fix consoleShortcuts for web
Diffstat (limited to 'src/plugins/consoleShortcuts.ts')
-rw-r--r--src/plugins/consoleShortcuts.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/consoleShortcuts.ts b/src/plugins/consoleShortcuts.ts
index 4bc39c5..4b33d57 100644
--- a/src/plugins/consoleShortcuts.ts
+++ b/src/plugins/consoleShortcuts.ts
@@ -1,6 +1,10 @@
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
+const WEB_ONLY = (f: string) => () => {
+ throw new Error(`'${f}' is Discord Desktop only.`);
+};
+
export default definePlugin({
name: "ConsoleShortcuts",
description: "Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.",
@@ -8,8 +12,8 @@ export default definePlugin({
getShortcuts() {
return {
- toClip: window.DiscordNative.clipboard.copy,
- fromClip: window.DiscordNative.clipboard.read,
+ toClip: IS_WEB ? WEB_ONLY("toClip") : window.DiscordNative.clipboard.copy,
+ fromClip: IS_WEB ? WEB_ONLY("fromClip") : window.DiscordNative.clipboard.read,
wp: Vencord.Webpack,
wpc: Vencord.Webpack.wreq.c,
wreq: Vencord.Webpack.wreq,
@@ -22,7 +26,7 @@ export default definePlugin({
Settings: Vencord.Settings,
Api: Vencord.Api,
reload: () => location.reload(),
- restart: () => window.DiscordNative.app.relaunch()
+ restart: IS_WEB ? WEB_ONLY("restart") : window.DiscordNative.app.relaunch
};
},