Last active
June 6, 2020 16:35
-
-
Save Supinic/ad50d6643ebc27872f9ba3fbbf1826c6 to your computer and use it in GitHub Desktop.
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
Online storage of supibot commands: JSON vs JS | |
JSON | |
(+) respected format | |
(+) safe, no issues with evaluation | |
(+) easy to port around | |
(-) awkward to edit overall | |
(-) terrible to edit code | |
JS | |
(+) easy to understand | |
(+) easy to edit, intuitive | |
(-) looks sketchy at first glance | |
(-) possible to launch attacks by using malicious definition | |
ideas: | |
1) use both? - terrible for upkeep, edit 2 files every time | |
2) use JSON but split the function definition into an array of strings? sounds mega dank | |
3) try some magic with JSON storing/reviving functions | |
4) use JS but enforce some rules for the overall command code and the function code? | |
5) use esprima, and instead of command functions, share the ASTs |
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
({ | |
Name: "pipozdola", | |
Aliases: null, | |
Flags: [ | |
"ping", | |
"pipe", | |
"skip-banphrase", | |
"system" | |
], | |
Description: "PIP OMEGALUL ZD OMEGALUL LA", | |
Cooldown: 10000, | |
Whitelist_Response: null, | |
Static_Data: null, | |
Code: async () => ({ | |
reply: "https://pastebin.com/PzSHPzH0" | |
}), | |
Dynamic_Description: null, | |
Source: "supinic/supibot-sql" | |
}) |
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
{ | |
"Name": "pipozdola", | |
"Aliases": null, | |
"Flags": [ | |
"ping", | |
"pipe", | |
"skip-banphrase", | |
"system" | |
], | |
"Description": "PIP OMEGALUL ZD OMEGALUL LA", | |
"Cooldown": 10000, | |
"Whitelist_Response": null, | |
"Static_Data": null, | |
"Code": "async () => ({\n\treply: \"https://pastebin.com/PzSHPzH0\"\n})", | |
"Dynamic_Description": null, | |
"Source": "supinic/supibot-sql" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment