A flow is a way to get user information without the hastle of recoding every little piece
Each object an action
type, each type has their own requirements and options
Actions: (* = required)
- reaction
- Prompts the user to select a reaction
- Options
- *key: string - key to be used with placeholders (e.g. if key is
desc
you can do "Ticket Description: {desc}")- in addition to this, reaction will also have a key with
-raw
appended to it to get the raw reaction value
- in addition to this, reaction will also have a key with
- *reactions: array - The reactions to be used
- There are some templates that return custom options
- yes_no - returns boolean
- 5_star - returns 1-5 (not implemented)
- opinion - returns "green" "yellow" or "red" (not implemented)
- thumbs - returns "up" or "down" (not implemented)
- You can also set it as an object and the keys will be the emojis and values will set placeholder value to it
- There are some templates that return custom options
- timeout: int - if the user doesnt respond in this many seconds the flow will timeout
- on_timeout: string - Message to be sent if the flow times out
- *key: string - key to be used with placeholders (e.g. if key is
- input
- Asks the user for a message input
- Options
- *key: string - key to be used with placeholders
- type: string - Default is
str
, accepted values areguild
,role
,channel
,member
,user
,int
,float
, andstr
- max_length: int - Max length for the string to be, default 2048
- timeout: int - if the user doesnt respond in this many seconds the flow will timeout
- on_timeout: string - Message to be sent if the flow times out
- set
- Options
- *key: string - key to be used with placeholders
- *value: any - value of the placeholder
- Options
- eval
- Options
- *key: string - key to be used with placeholders
- *eval: string - Code to evaluate output will be set as placeholder. Ask Allen#0001 for more info
- Options
- exec
- Options
- *exec: string - Code to execute. Ask Allen#0001 for more info
- Options
- message
- no action is taken
Each action may have these three additional options:
- then: array, object - Flow items to be executed after the current one
- if the value is an array, it will execute each flow item in order
- if the value is a object then the key will be evaluated as an if statement and the action will only be executed if it is true
- the key may also be
else
to run if no other action has been taken in thethen
- e.g The previous action set a key called
category
to a string, setting the key to be "category == 'Foo'" will check the value to beFoo
- the key may also be
- if: string - The flow action will only be executed if the statement is evaluated to try
- e.g The previous action set a key called
category
to a string, setting the key to be "category == 'Foo'" will check the value to beFoo
- e.g The previous action set a key called
- embed: null, object
- if omitted, nothing happens
- if set to null or false, the flow message will be deleted
- if set to a object then the options may be as listed, nothing is required, but nothing may be empty
- title: string
- description: string
- fields: object, array
- footer: string
- color: int - Cyan is #00FFFF or 0x00FFFF in hex, or 65535 as an int
- author_text: string
- image: string - must be a correctly formatted url
- thumbnail: string - must be a correctly formatted url