Fix consoleShortcuts for web
This commit is contained in:
parent
7e526e4172
commit
3e0355cb53
|
@ -1,6 +1,10 @@
|
||||||
import { Devs } from "../utils/constants";
|
import { Devs } from "../utils/constants";
|
||||||
import definePlugin from "../utils/types";
|
import definePlugin from "../utils/types";
|
||||||
|
|
||||||
|
const WEB_ONLY = (f: string) => () => {
|
||||||
|
throw new Error(`'${f}' is Discord Desktop only.`);
|
||||||
|
};
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "ConsoleShortcuts",
|
name: "ConsoleShortcuts",
|
||||||
description: "Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.",
|
description: "Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.",
|
||||||
|
@ -8,8 +12,8 @@ export default definePlugin({
|
||||||
|
|
||||||
getShortcuts() {
|
getShortcuts() {
|
||||||
return {
|
return {
|
||||||
toClip: window.DiscordNative.clipboard.copy,
|
toClip: IS_WEB ? WEB_ONLY("toClip") : window.DiscordNative.clipboard.copy,
|
||||||
fromClip: window.DiscordNative.clipboard.read,
|
fromClip: IS_WEB ? WEB_ONLY("fromClip") : window.DiscordNative.clipboard.read,
|
||||||
wp: Vencord.Webpack,
|
wp: Vencord.Webpack,
|
||||||
wpc: Vencord.Webpack.wreq.c,
|
wpc: Vencord.Webpack.wreq.c,
|
||||||
wreq: Vencord.Webpack.wreq,
|
wreq: Vencord.Webpack.wreq,
|
||||||
|
@ -22,7 +26,7 @@ export default definePlugin({
|
||||||
Settings: Vencord.Settings,
|
Settings: Vencord.Settings,
|
||||||
Api: Vencord.Api,
|
Api: Vencord.Api,
|
||||||
reload: () => location.reload(),
|
reload: () => location.reload(),
|
||||||
restart: () => window.DiscordNative.app.relaunch()
|
restart: IS_WEB ? WEB_ONLY("restart") : window.DiscordNative.app.relaunch
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue