Default Variables
The following blocks will be present and accessable as defaults when running any tag.
Meta Variables
Meta variables reference meta attributes about the tag invocation.
Args Block
- class TagScriptEngine.StringAdapter(string: str, *, escape: bool = False)[source]
The
{args}
block represents the arguments passed after the tag name when invoking a tag. If no parameter is passed, it returns all the text after the invocation name. If an index is passed, it will split the arguments into a list by the given splitter, and return the word at that index. The default splitter is a ” “.Usage:
{args([index]):[splitter]>}
Payload: splitter
Parameter: index
Examples:
In the following examples, assume the tag’s name is
argstag
and the message content is[p]argstag My dog is cute! Would you like to see a photo?
.{args} # My dog is cute! Would you like to see a photo? {args(1)} # My {args(2):!} # Would you like to see a photo?
Uses Block
Discord Object Variables
These blocks reference Discord objects from the tag invocation context.
Target Block
The
{target}
block follows the same usage and has the same attributes as the Author Block, but it defaults to the mentioned user in the tag invocation message if any users are mentioned, or the tag author.Usage:
{target}
Aliases:
{member}
Channel Block
- class TagScriptEngine.ChannelAdapter(base)[source]
The
{channel}
block with no parameters returns the channel’s full name but passing the attributes listed below to the block payload will return that attribute instead.Usage:
{channel([attribute])
Payload: None
Parameter: attribute, None
- id
The channel’s ID.
- name
The channel’s name.
- created_at
The channel’s creation date.
- timestamp
The channel’s creation date as a UTC timestamp.
- nsfw
Whether the channel is nsfw.
- mention
A formatted text that pings the channel.
- topic
The channel’s topic.
Server Block
- class TagScriptEngine.GuildAdapter(base)[source]
The
{server}
block with no parameters returns the server’s name but passing the attributes listed below to the block payload will return that attribute instead.Aliases:
guild
Usage:
{server([attribute])
Payload: None
Parameter: attribute, None
- id
The server’s ID.
- name
The server’s name.
- icon
A link to the server’s icon, which can be used in embeds.
- created_at
The server’s creation date.
- timestamp
The server’s creation date as a UTC timestamp.
- member_count
The server’s member count.
- bots
The number of bots in the server.
- humans
The number of humans in the server.
- description
The server’s description if one is set, or “No description”.
- random
A random member from the server.