From 3097bcf1ca5605f6e998ac88294b9a9f035c9820 Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Mon, 26 Feb 2024 18:20:40 +0530
Subject: [PATCH 01/16] Create permissionsaddarray
---
src/blocks/Monaco/permissionsaddarray | 1 +
1 file changed, 1 insertion(+)
create mode 100644 src/blocks/Monaco/permissionsaddarray
diff --git a/src/blocks/Monaco/permissionsaddarray b/src/blocks/Monaco/permissionsaddarray
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/src/blocks/Monaco/permissionsaddarray
@@ -0,0 +1 @@
+
From d45015947d78c391755e2cc73a421801caeb8e40 Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Mon, 26 Feb 2024 18:24:34 +0530
Subject: [PATCH 02/16] Update permissionsaddarray
---
src/blocks/Monaco/permissionsaddarray | 41 +++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/src/blocks/Monaco/permissionsaddarray b/src/blocks/Monaco/permissionsaddarray
index 8b1378917..60487f04f 100644
--- a/src/blocks/Monaco/permissionsaddarray
+++ b/src/blocks/Monaco/permissionsaddarray
@@ -1 +1,42 @@
+import * as Blockly from "blockly/core";
+const blockName = "monaco_create_server";
+
+
+const blockData = {
+ "message0": "in channel %1 %2 permissions to member/role %3 %4",
+ "args0": [
+ {
+ "type": "input_value",
+ "name": "channel",
+ "check": "String"
+ },
+ {
+ "type": "input_value"
+ {
+ "type": "input_statement",
+ "name": "then"
+ }
+ ],
+ "colour": "#4C97FF",
+"previousStatement": null,
+"nextStatement": null,
+ "tooltip": "Create a discord server. Only available if the bot is in fewer than 10 servers.",
+ "helpUrl": ""
+};
+
+Blockly.Blocks[blockName] = {
+ init: function() {
+ this.jsonInit(blockData);
+ }
+};
+
+Blockly.JavaScript['monaco_create_server'] = function(block) {
+ var value_create = Blockly.JavaScript.valueToCode(block, 'create', Blockly.JavaScript.ORDER_ATOMIC);
+ var statements = Blockly.JavaScript.statementToCode(block, 'then');
+ // TODO: Assemble JavaScript into code variable.
+ var guilder = `s4d.client.guilds.create(String(${value_create})).then(async newServer => {
+ ${statements}
+})`;
+ return guilder;
+};
From b08fed116c29459637f66c8de224d24da030bb81 Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Mon, 26 Feb 2024 18:25:38 +0530
Subject: [PATCH 03/16] Update permissionsaddarray
---
src/blocks/Monaco/permissionsaddarray | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/blocks/Monaco/permissionsaddarray b/src/blocks/Monaco/permissionsaddarray
index 60487f04f..75add7f5d 100644
--- a/src/blocks/Monaco/permissionsaddarray
+++ b/src/blocks/Monaco/permissionsaddarray
@@ -9,10 +9,11 @@ const blockData = {
{
"type": "input_value",
"name": "channel",
- "check": "String"
+ "check": "Channel"
},
{
- "type": "input_value"
+ "type": "field_dropdown"
+
{
"type": "input_statement",
"name": "then"
From b230593f5288aa9842f5d04332cfb29295e1db94 Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Mon, 26 Feb 2024 18:32:26 +0530
Subject: [PATCH 04/16] Update and rename permissionsaddarray to
permissionsaddarray.js
---
...issionsaddarray => permissionsaddarray.js} | 29 +++++++++++++++----
1 file changed, 23 insertions(+), 6 deletions(-)
rename src/blocks/Monaco/{permissionsaddarray => permissionsaddarray.js} (53%)
diff --git a/src/blocks/Monaco/permissionsaddarray b/src/blocks/Monaco/permissionsaddarray.js
similarity index 53%
rename from src/blocks/Monaco/permissionsaddarray
rename to src/blocks/Monaco/permissionsaddarray.js
index 75add7f5d..3073f72a9 100644
--- a/src/blocks/Monaco/permissionsaddarray
+++ b/src/blocks/Monaco/permissionsaddarray.js
@@ -1,6 +1,6 @@
import * as Blockly from "blockly/core";
-const blockName = "monaco_create_server";
+const blockName = "monaco_edit_permissions";
const blockData = {
@@ -12,8 +12,24 @@ const blockData = {
"check": "Channel"
},
{
- "type": "field_dropdown"
-
+ "type": "field_dropdown",
+ "name": "action",
+ "options": [
+ [
+ "allow",
+ "allow"
+ ],
+ [
+ "deny",
+ "deny"
+ ]
+ ]
+ },
+ {
+ "type": "input_value",
+ "name": "member",
+ "check": "Role"
+ },
{
"type": "input_statement",
"name": "then"
@@ -22,7 +38,7 @@ const blockData = {
"colour": "#4C97FF",
"previousStatement": null,
"nextStatement": null,
- "tooltip": "Create a discord server. Only available if the bot is in fewer than 10 servers.",
+ "tooltip": "Edit more than one permission of a role/member.",
"helpUrl": ""
};
@@ -32,8 +48,9 @@ Blockly.Blocks[blockName] = {
}
};
-Blockly.JavaScript['monaco_create_server'] = function(block) {
- var value_create = Blockly.JavaScript.valueToCode(block, 'create', Blockly.JavaScript.ORDER_ATOMIC);
+Blockly.JavaScript['monaco_edit_permissions'] = function(block) {
+ var value_channel = Blockly.JavaScript.valueToCode(block, 'channel', Blockly.JavaScript.ORDER_ATOMIC);
+ var value_action = Blockly.JavaScript.valueToCode(block, 'action', Blockly.JavaScript.ORDER_ATOMIC);
var statements = Blockly.JavaScript.statementToCode(block, 'then');
// TODO: Assemble JavaScript into code variable.
var guilder = `s4d.client.guilds.create(String(${value_create})).then(async newServer => {
From bb0e30717ed0448be203b9f39c9e58b63a4b9aad Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Mon, 26 Feb 2024 18:33:44 +0530
Subject: [PATCH 05/16] Update permissionsaddarray.js
---
src/blocks/Monaco/permissionsaddarray.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/blocks/Monaco/permissionsaddarray.js b/src/blocks/Monaco/permissionsaddarray.js
index 3073f72a9..edd1c4682 100644
--- a/src/blocks/Monaco/permissionsaddarray.js
+++ b/src/blocks/Monaco/permissionsaddarray.js
@@ -51,6 +51,7 @@ Blockly.Blocks[blockName] = {
Blockly.JavaScript['monaco_edit_permissions'] = function(block) {
var value_channel = Blockly.JavaScript.valueToCode(block, 'channel', Blockly.JavaScript.ORDER_ATOMIC);
var value_action = Blockly.JavaScript.valueToCode(block, 'action', Blockly.JavaScript.ORDER_ATOMIC);
+ var value_member = Blockly.JavaScript.valueToCode(block, 'member', Blockly.JavaScript.ORDER_ATOMIC);
var statements = Blockly.JavaScript.statementToCode(block, 'then');
// TODO: Assemble JavaScript into code variable.
var guilder = `s4d.client.guilds.create(String(${value_create})).then(async newServer => {
From 2dbb2c404ecd2630c4a2d393a2097c9ab94d15a1 Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Mon, 26 Feb 2024 19:01:47 +0530
Subject: [PATCH 06/16] Update permissionsaddarray.js
---
src/blocks/Monaco/permissionsaddarray.js | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/blocks/Monaco/permissionsaddarray.js b/src/blocks/Monaco/permissionsaddarray.js
index edd1c4682..fdb131922 100644
--- a/src/blocks/Monaco/permissionsaddarray.js
+++ b/src/blocks/Monaco/permissionsaddarray.js
@@ -4,7 +4,7 @@ const blockName = "monaco_edit_permissions";
const blockData = {
- "message0": "in channel %1 %2 permissions to member/role %3 %4",
+ "message0": "in channel %1 %2 permissions to member/role with id %3 %4",
"args0": [
{
"type": "input_value",
@@ -28,7 +28,7 @@ const blockData = {
{
"type": "input_value",
"name": "member",
- "check": "Role"
+ "check": "String"
},
{
"type": "input_statement",
@@ -54,8 +54,12 @@ Blockly.JavaScript['monaco_edit_permissions'] = function(block) {
var value_member = Blockly.JavaScript.valueToCode(block, 'member', Blockly.JavaScript.ORDER_ATOMIC);
var statements = Blockly.JavaScript.statementToCode(block, 'then');
// TODO: Assemble JavaScript into code variable.
- var guilder = `s4d.client.guilds.create(String(${value_create})).then(async newServer => {
+ var guilder = `s4d.clients.channels.cache.get('${value_channel}').permissionOverwrites [
+ id: ${value_member},
+ ${value_action}: [
${statements}
-})`;
+ ]
+ },
+ ]`;
return guilder;
};
From bbb2bfb255c428b1ebae25c6b1d2edbe56884dd1 Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Tue, 27 Feb 2024 00:06:27 +0530
Subject: [PATCH 07/16] Update set_perms_parent.js
---
.../discord/channels/set_perms_parent.js | 115 ++++++------------
1 file changed, 37 insertions(+), 78 deletions(-)
diff --git a/src/blocks/discord/channels/set_perms_parent.js b/src/blocks/discord/channels/set_perms_parent.js
index c64d97711..266d39475 100644
--- a/src/blocks/discord/channels/set_perms_parent.js
+++ b/src/blocks/discord/channels/set_perms_parent.js
@@ -10,82 +10,41 @@ const blockData = {
"type": "field_dropdown",
"name": "SEARCH",
"options": [
- [
- "View channel",
- "VIEW_CHANNEL"
- ],
- [
- "Manage channel",
- "MANAGE_CHANNEL"
- ],
- [
- "Manage webhooks",
- "MANAGE_WEBHOOKS"
- ],
- [
- "Manage permissions",
- "MANAGE_PERMISSIONS"
- ],
- [
- "Create invite",
- "CREATE_INSTANT_INVITE"
- ],
- [
- "Send messages",
- "SEND_MESSAGES"
- ],
- [
- "Embed links",
- "EMBED_LINKS"
- ],
- [
- "Attach files",
- "ATTACH_FILES"
- ],
- [
- "Add reactions",
- "ADD_REACTIONS"
- ],
- [
- "Send Messages",
- "USE_EXTERNAL_EMOJIS"
- ],
- [
- "Mention everyone",
- "MENTION_EVERYONE"
- ],
- [
- "Manage messages",
- "MANAGE_MESSAGES "
- ],
- [
- "Read message history",
- "READ_MESSAGE_HISTORY"
- ],
- [
- "Atach files",
- "ATTACH_FILES"
- ],
- [
- "Read message history",
- "READ_MESSAGE_HISTORY"
- ],
- [
- "Use external emojis",
- "USE_EXTERNAL_EMOJIS"
- ],
- [
- "View server insights",
- "VIEW_GUILD_INSIGHTS"
- ],
- [
- "Use slash commands",
- "USE_SLASH_COMMANDS"
- ],
- [
- "Send TTS messages",
- "SEND_TTS_MESSAGES"
- ],
+ ["CREATE_INSTANT_INVITE", "CREATE_INSTANT_INVITE"],
+ ["MANAGE_CHANNELS", "MANAGE_CHANNELS"],
+ ["ADD_REACTIONS", "ADD_REACTIONS"],
+ ["PRIORITY_SPEAKER", "PRIORITY_SPEAKER"],
+ ["STREAM", "STREAM"],
+ ["VIEW_CHANNEL", "VIEW_CHANNEL"],
+ ["SEND_MESSAGES", "SEND_MESSAGES"],
+ ["SEND_TTS_MESSAGES","SEND_TTS_MESSAGES"],
+ ["MANAGE_MESSAGES", "MANAGE_MESSAGES"],
+ ["EMBED_LINKS", "EMBED_LINKS"],
+ ["ATTACH_FILES", "ATTACH_FILES"],
+ ["READ_MESSAGE_HISTORY", "READ_MESSAGE_HISTORY"],
+ ["MENTION_EVERYONE", "MENTION_EVERYONE"],
+ ["USE_EXTERNAL_EMOJIS", "USE_EXTERNAL_EMOJIS"],
+ ["CONNECT", "CONNECT"],
+ ["SPEAK", "SPEAK"],
+ ["MUTE_MEMBERS", "MUTE_MEMBERS"],
+ ["DEAFEN_MEMBERS", "DEAFEN_MEMBERS"],
+ ["MOVE_MEMBERS", "MOVE_MEMBERS"],
+ ["USE_VAD", "USE_VAD"],
+ ["MANAGE_ROLES", "MANAGE_ROLES"],
+ ["MANAGE_WEBHOOKS", "MANAGE_WEBHOOKS"],
+ ["USE_APPLICATION_COMMANDS", "USE_APPLICATION_COMMANDS"],
+ ["REQUEST_TO_SPEAK", '"REQUEST_TO_SPEAK"],
+ ["MANAGE_EVENTS", "MANAGE_EVENTS"],
+ ["MANAGE_THREADS", "MANAGE_THREADS"],
+ ["CREATE_PUBLIC_THREADS", "CREATE_PUBLIC_THREADS"],
+ ["CREATE_PRIVATE_THREADS", "CREATE_PRIVATE_THREADS"],
+ ["USE_EXTERNAL_STICKERS", "USE_EXTERNAL_STICKERS"],
+ ["SEND_MESSAGES_IN_THREADS", "SEND_MESSAGES_IN_THREADS"],
+ ["USE_EMBEDDED_ACTIVITIES", "USE_EMBEDDED_ACTIVITIES"],
+ ["USE_SOUNDBOARD", "USE_SOUNDBOARD"],
+ ["CREATE_EVENTS", "CREATE_EVENTS"],
+ ["USE_EXTERNAL_SOUNDS", "USE_EXTERNAL_SOUNDS"],
+ ["SEND_VOICE_MESSAGES", '"SEND_VOICE_MESSAGES"]
]
}
],
@@ -104,7 +63,7 @@ Blockly.Blocks[blockName] = {
Blockly.JavaScript[blockName] = function(block){
const searchType = block.getFieldValue("SEARCH");
- const code = `['${searchType}'],`
+ const code = `Permissions.FLAGS.${searchType},`
return code;
-};
\ No newline at end of file
+};
From 4b93901e1f1ca7b3983bbaa8375ce324a32be29f Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Tue, 27 Feb 2024 00:07:19 +0530
Subject: [PATCH 08/16] Update index.js
---
src/blocks/Monaco/index.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/blocks/Monaco/index.js b/src/blocks/Monaco/index.js
index f6bab63ff..6c55d37e6 100644
--- a/src/blocks/Monaco/index.js
+++ b/src/blocks/Monaco/index.js
@@ -18,4 +18,5 @@ import "./memberswithrole"
import "./robloxbuy"
import "./timeoutuntil"
import "./timeoutuntiltimestamp"
-import "./slowmo"
\ No newline at end of file
+import "./slowmo"
+import "./permissionsaddarray"
From 8093d83f77192ab4d67451a051dc3d120f6d4398 Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Tue, 27 Feb 2024 00:12:49 +0530
Subject: [PATCH 09/16] Update toolbox.js
---
src/toolbox.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/toolbox.js b/src/toolbox.js
index be7b4abac..0217e3676 100644
--- a/src/toolbox.js
+++ b/src/toolbox.js
@@ -1943,6 +1943,7 @@ export default (favorites) => {
+
From eaca138826d6cbc604f1858e3b070a935470ba5f Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Tue, 27 Feb 2024 00:42:51 +0530
Subject: [PATCH 10/16] Update permissionsaddarray.js
---
src/blocks/Monaco/permissionsaddarray.js | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/blocks/Monaco/permissionsaddarray.js b/src/blocks/Monaco/permissionsaddarray.js
index fdb131922..e93274cbf 100644
--- a/src/blocks/Monaco/permissionsaddarray.js
+++ b/src/blocks/Monaco/permissionsaddarray.js
@@ -50,16 +50,17 @@ Blockly.Blocks[blockName] = {
Blockly.JavaScript['monaco_edit_permissions'] = function(block) {
var value_channel = Blockly.JavaScript.valueToCode(block, 'channel', Blockly.JavaScript.ORDER_ATOMIC);
- var value_action = Blockly.JavaScript.valueToCode(block, 'action', Blockly.JavaScript.ORDER_ATOMIC);
+ var value_action = Blockly.JavaScript.getfieldvalue(block, 'action', Blockly.JavaScript.ORDER_ATOMIC);
var value_member = Blockly.JavaScript.valueToCode(block, 'member', Blockly.JavaScript.ORDER_ATOMIC);
var statements = Blockly.JavaScript.statementToCode(block, 'then');
// TODO: Assemble JavaScript into code variable.
- var guilder = `s4d.clients.channels.cache.get('${value_channel}').permissionOverwrites [
- id: ${value_member},
- ${value_action}: [
- ${statements}
- ]
- },
- ]`;
+ var guilder = `s4d.clients.channels.cache.get('${value_channel}').edit(
+ {
+ PermissionOverwrites:
+ id: '${value_member}',
+ ${value_action}: [
+${statements}
+ ]
+ })`;
return guilder;
};
From 38ddca932db0098ebe3f6ed5c949dc8f1a463c49 Mon Sep 17 00:00:00 2001
From: Freslin Yoyo
Date: Tue, 27 Feb 2024 01:04:13 +0530
Subject: [PATCH 11/16] LOLOl
---
.vscode/settings.json | 2 +-
package.json | 2 +-
yarn.lock | 8 ++++----
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 2ad46d58c..dc30511ba 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,6 +1,6 @@
{
"editor.codeActionsOnSave": {
- "source.fixAll.eslint": true
+ "source.fixAll.eslint": "explicit"
},
"eslint.validate": ["javascript"]
}
diff --git a/package.json b/package.json
index 0200f5ace..c8c29fdf2 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"js-beautify": "^1.13.5",
"jszip": "^3.8.0",
"localforage": "^1.10.0",
- "node": "^16.10.0",
+ "node": "20",
"npm": "^8.11.0",
"promises": "^0.2.5",
"sass-loader": "^10",
diff --git a/yarn.lock b/yarn.lock
index 8fda1897c..91525c293 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7147,10 +7147,10 @@ node-releases@^1.1.71:
resolved "https://registry.npmjs.org/node-releases/-/node-releases-1.1.71.tgz"
integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==
-node@^16.10.0:
- version "16.10.0"
- resolved "https://registry.npmjs.org/node/-/node-16.10.0.tgz"
- integrity sha512-SXcqz3j4AOFMPPsd0bXDpQY95Xm8mnJ7PbBhJKEvp+aPYoVH38QAHha59EAuRaiASaSLWt5sP0oDCMzzaSmEAA==
+node@20:
+ version "20.11.1"
+ resolved "https://registry.yarnpkg.com/node/-/node-20.11.1.tgz#41822e4cc4439a525b776ae7619279204ba00610"
+ integrity sha512-Xn8PkfFD6TYj/zqL2iK6ENtpEWvEymEHTycYdZydZNkzdqXwopqQKG+Yz+8xDsAJO15Db7VFNzRPVpYk0cbBJg==
dependencies:
node-bin-setup "^1.0.0"
From 609a540058901eabd470ec54d9e2683e895d4077 Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Tue, 27 Feb 2024 01:08:34 +0530
Subject: [PATCH 12/16] Update set_perms_parent.js
---
src/blocks/discord/channels/set_perms_parent.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/blocks/discord/channels/set_perms_parent.js b/src/blocks/discord/channels/set_perms_parent.js
index 266d39475..de4a4e319 100644
--- a/src/blocks/discord/channels/set_perms_parent.js
+++ b/src/blocks/discord/channels/set_perms_parent.js
@@ -33,7 +33,7 @@ const blockData = {
["MANAGE_ROLES", "MANAGE_ROLES"],
["MANAGE_WEBHOOKS", "MANAGE_WEBHOOKS"],
["USE_APPLICATION_COMMANDS", "USE_APPLICATION_COMMANDS"],
- ["REQUEST_TO_SPEAK", '"REQUEST_TO_SPEAK"],
+ ["REQUEST_TO_SPEAK", "REQUEST_TO_SPEAK"],
["MANAGE_EVENTS", "MANAGE_EVENTS"],
["MANAGE_THREADS", "MANAGE_THREADS"],
["CREATE_PUBLIC_THREADS", "CREATE_PUBLIC_THREADS"],
From c70d706a4eb7640f914d847fe45dccc19032f43c Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Tue, 27 Feb 2024 01:14:09 +0530
Subject: [PATCH 13/16] Update set_perms_parent.js
---
src/blocks/discord/channels/set_perms_parent.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/blocks/discord/channels/set_perms_parent.js b/src/blocks/discord/channels/set_perms_parent.js
index de4a4e319..921e85c0e 100644
--- a/src/blocks/discord/channels/set_perms_parent.js
+++ b/src/blocks/discord/channels/set_perms_parent.js
@@ -44,7 +44,7 @@ const blockData = {
["USE_SOUNDBOARD", "USE_SOUNDBOARD"],
["CREATE_EVENTS", "CREATE_EVENTS"],
["USE_EXTERNAL_SOUNDS", "USE_EXTERNAL_SOUNDS"],
- ["SEND_VOICE_MESSAGES", '"SEND_VOICE_MESSAGES"]
+ ["SEND_VOICE_MESSAGES", "SEND_VOICE_MESSAGES"]
]
}
],
From fef5611d425b665fcb0bc1ad11cb2fa557334f61 Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Tue, 27 Feb 2024 10:11:58 +0530
Subject: [PATCH 14/16] Update permissionsaddarray.js
---
src/blocks/Monaco/permissionsaddarray.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/blocks/Monaco/permissionsaddarray.js b/src/blocks/Monaco/permissionsaddarray.js
index e93274cbf..a6388c0e9 100644
--- a/src/blocks/Monaco/permissionsaddarray.js
+++ b/src/blocks/Monaco/permissionsaddarray.js
@@ -50,7 +50,7 @@ Blockly.Blocks[blockName] = {
Blockly.JavaScript['monaco_edit_permissions'] = function(block) {
var value_channel = Blockly.JavaScript.valueToCode(block, 'channel', Blockly.JavaScript.ORDER_ATOMIC);
- var value_action = Blockly.JavaScript.getfieldvalue(block, 'action', Blockly.JavaScript.ORDER_ATOMIC);
+ var value_action = Blockly.JavaScript.valueToCode(block, 'action', Blockly.JavaScript.ORDER_ATOMIC);
var value_member = Blockly.JavaScript.valueToCode(block, 'member', Blockly.JavaScript.ORDER_ATOMIC);
var statements = Blockly.JavaScript.statementToCode(block, 'then');
// TODO: Assemble JavaScript into code variable.
From 27b8878daacde2b47f3ba5fe6891b70f210eb89a Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Tue, 27 Feb 2024 10:21:04 +0530
Subject: [PATCH 15/16] Update permissionsaddarray.js
---
src/blocks/Monaco/permissionsaddarray.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/blocks/Monaco/permissionsaddarray.js b/src/blocks/Monaco/permissionsaddarray.js
index a6388c0e9..ffc1ca50b 100644
--- a/src/blocks/Monaco/permissionsaddarray.js
+++ b/src/blocks/Monaco/permissionsaddarray.js
@@ -50,13 +50,13 @@ Blockly.Blocks[blockName] = {
Blockly.JavaScript['monaco_edit_permissions'] = function(block) {
var value_channel = Blockly.JavaScript.valueToCode(block, 'channel', Blockly.JavaScript.ORDER_ATOMIC);
- var value_action = Blockly.JavaScript.valueToCode(block, 'action', Blockly.JavaScript.ORDER_ATOMIC);
+ var value_action = block.getFieldValue(block, 'action', Blockly.JavaScript.ORDER_ATOMIC);
var value_member = Blockly.JavaScript.valueToCode(block, 'member', Blockly.JavaScript.ORDER_ATOMIC);
var statements = Blockly.JavaScript.statementToCode(block, 'then');
// TODO: Assemble JavaScript into code variable.
var guilder = `s4d.clients.channels.cache.get('${value_channel}').edit(
{
- PermissionOverwrites:
+ permissionOverwrites:
id: '${value_member}',
${value_action}: [
${statements}
From 138b42f5b077e305adb422f62a22ff2ef12ad736 Mon Sep 17 00:00:00 2001
From: Freslin <160232566+Freslin@users.noreply.github.com>
Date: Tue, 27 Feb 2024 10:26:36 +0530
Subject: [PATCH 16/16] Update permissionsaddarray.js
---
src/blocks/Monaco/permissionsaddarray.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/blocks/Monaco/permissionsaddarray.js b/src/blocks/Monaco/permissionsaddarray.js
index ffc1ca50b..ed74bfe36 100644
--- a/src/blocks/Monaco/permissionsaddarray.js
+++ b/src/blocks/Monaco/permissionsaddarray.js
@@ -50,7 +50,7 @@ Blockly.Blocks[blockName] = {
Blockly.JavaScript['monaco_edit_permissions'] = function(block) {
var value_channel = Blockly.JavaScript.valueToCode(block, 'channel', Blockly.JavaScript.ORDER_ATOMIC);
- var value_action = block.getFieldValue(block, 'action', Blockly.JavaScript.ORDER_ATOMIC);
+ var value_action = block.getFieldValue('action');
var value_member = Blockly.JavaScript.valueToCode(block, 'member', Blockly.JavaScript.ORDER_ATOMIC);
var statements = Blockly.JavaScript.statementToCode(block, 'then');
// TODO: Assemble JavaScript into code variable.