Skip to content

Instantly share code, notes, and snippets.

@silentrob
Last active February 25, 2019 00:18
Show Gist options
  • Save silentrob/3914f9544d118c64f138 to your computer and use it in GitHub Desktop.
Save silentrob/3914f9544d118c64f138 to your computer and use it in GitHub Desktop.
SuperScript Syntax
// Basic Syntax match, reply
+ when I see this
- reply with this
// Multiple replies, one choosen at random
+ when I see this
- reply with this
- or reply with this
// Alternates words in match
+ What (day|week) is it
- reply with this
// Same as
+ What day is it
+ What week is it
// Alternates words in reply
- reply with (this|that)
// Optional words
+ i have a [red|green|blue] car
- I don't have a car
// This is the same as matching on one of the following, the words in [] are completly optional.
+ i have a red car
+ i have a geeen car
+ i have a blue car
+ i have a car
// Input is normalized so triggers will match easier.
+ THESE ARE ALL THE SAME ARN'T THEY
+ these are all the same arn't they
+ These are all the same are not they
// We can capture input and re-inject it back into the reply.
+ I like *
- You like <cap>!
// "*" will match any number of words.
// "*n" will match exactly n number of words
// "*~n" will match UPTO n number of words
+ I *~2 you
- You <cap> me?
// Will match "I like you", and "I really like you" but not match "I never really liked you"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment