aboutsummaryrefslogtreecommitdiffstats
path: root/vencord-patches/0007-SupportHelper-Disable-running-arbitrary-code-snippet.patch
blob: b08245b272dff78b4e508d1ed497cc7490ac8943 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 7032f3b6764ccf0b616a58f63aebb5208c9ddcfe Mon Sep 17 00:00:00 2001
From: 1024x2 <2pow11@gmail.com>
Date: Sat, 20 Jul 2024 00:21:22 +0100
Subject: [PATCH 7/8] SupportHelper: Disable running arbitrary code snippets

Why is this even a thing?
---
 src/plugins/_core/supportHelper.tsx | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx
index 432896f..60461f3 100644
--- a/src/plugins/_core/supportHelper.tsx
+++ b/src/plugins/_core/supportHelper.tsx
@@ -300,28 +300,6 @@ export default definePlugin({
                         </Button>
                     );
                 }
-
-                if (props.message.author.id === VENBOT_USER_ID) {
-                    const match = CodeBlockRe.exec(props.message.content || props.message.embeds[0]?.rawDescription || "");
-                    if (match) {
-                        buttons.push(
-                            <Button
-                                key="vc-run-snippet"
-                                onClick={async () => {
-                                    try {
-                                        await AsyncFunction(match[1])();
-                                        showToast("Success!", Toasts.Type.SUCCESS);
-                                    } catch (e) {
-                                        new Logger(this.name).error("Error while running snippet:", e);
-                                        showToast("Failed to run snippet :(", Toasts.Type.FAILURE);
-                                    }
-                                }}
-                            >
-                                Run Snippet
-                            </Button>
-                        );
-                    }
-                }
             }
 
             return buttons.length
-- 
2.46.1