-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bbtag update phase2 #67
Merged
Merged
Conversation
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
Fixed some scope issues Added text trimming before execution
Removing all the old tag stuff. Escaping isnt actually needed any more because the whole tag is parsed and markers placed before any execution, meaning theres no way to inject your own code into the bot. The only tags that dont get fully parsed beforehand are {exec}, {execcc} and {inject}, for obvious reasons, however before they execute their contents they too parse before executing, meaning no issues there.
Also made various errors actual errors rather than strings
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Most of this update revolves around the update to the engine. While not perfect or anything, this new one does allow for greater control over scopes and what gets passed around between subtags during execution.
Backend Changes
params.args
=>args
(now 0 indexed rather than 1 indexed)whenArgs(x
=>whenArgs(x-1
beforeExecute(....
=> removed. Subtags which previously had no before execute now haveresolveArgs
which you supply with arg indexes to resolve.params.msg
=>context.msg
params.channel
=>context.channel
params.channel.guild
=>context.guild
params.msg.author
=>context.user
params.msg.member
=>context.member
"Front" end changes - The stuff users gon see
b!cc test <code>
,b!cc test debug <code>
,b!cc debug <CCName> [args...]
,b!t test debug <code>
andb!t debug <tag> [args...]
. Debug statements will cause an attachment to be sent which will contain all the useful information about the tag execution. While not comprehensive, it does have better error tracking and a dump of the final variable values.Bug fixes
Ive done various fixes on my way through this PR, the notable ones I can think of off the top of my head are:
Next phase
This update, because its actually less breaking than the previous one, has been kept rather feature light. This is because I am intending to add a lot of new subtags for the next big PR I do:
{listreact}
{removereact}
{waitreact}
{waitmessage}
{function} (creates a function)
{call} (calls a function)
{getmessage}
{hasperm}
{userexists}
{rolemove} and a few other tweaks and features