forked from Androz2091/scratch-for-discord
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add server owner block (Androz2091#11)
* ⬆️ Bump vue-i18n from 8.17.0 to 8.17.1 (Androz2091#6) Bumps [vue-i18n](https://github.com/kazupon/vue-i18n) from 8.17.0 to 8.17.1. - [Release notes](https://github.com/kazupon/vue-i18n/releases) - [Changelog](https://github.com/kazupon/vue-i18n/blob/v8.x/CHANGELOG.md) - [Commits](kazupon/vue-i18n@v8.17.0...v8.17.1) Signed-off-by: dependabot-preview[bot] <[email protected]> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * 🔖 1.1.1 * 🔖 1.2.0 * Create server_owner.js * Update server_owner.js * Update index.js * Update toolbox.js * Update fr-FR.json * Update en-US.json * Update server_owner.js * Update en-US.json Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Androz2091 <[email protected]>
- Loading branch information
1 parent
57b54c0
commit 123cbc7
Showing
6 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import "./boost_count.js"; | ||
import "./boost_count"; | ||
import "./get_server"; | ||
import "./icon_url"; | ||
import "./member_count"; | ||
import "./server_name"; | ||
import "./server_owner"; | ||
import "./set_server_name"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import * as Blockly from "blockly/core"; | ||
import { registerRestrictions } from "../../../restrictions"; | ||
|
||
const blockName = "s4d_server_owner"; | ||
|
||
const blockData = { | ||
"message0": "%{BKY_SERVER_OWNER}", | ||
"args0": [ | ||
{ | ||
"type": "input_value", | ||
"name": "SERVER", | ||
"check": "Server" | ||
} | ||
], | ||
"colour": "#e07e6c", | ||
"output": "Number", | ||
"tooltip": "", | ||
"helpUrl": "" | ||
}; | ||
|
||
Blockly.Blocks[blockName] = { | ||
init: function() { | ||
this.jsonInit(blockData); | ||
} | ||
}; | ||
|
||
Blockly.JavaScript[blockName] = function(block){ | ||
const server = Blockly.JavaScript.valueToCode(block, "SERVER", Blockly.JavaScript.ORDER_ATOMIC); | ||
return [ `${server}.owner || ${server}.members.fetch(${server}.ownerID})`, Blockly.JavaScript.ORDER_NONE ]; | ||
}; | ||
|
||
registerRestrictions(blockName, [ | ||
{ | ||
type: "notempty", | ||
message: "RES_VALID_SERVER", | ||
types: [ | ||
"SERVER" | ||
] | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters