Slash Arguments
SlashTags support up to 10 arguments with multiple types, allowing for flexibility and advanced user input handling.
Adding Arguments
Similar to the initial slash tag creation process, adding arguments to slash tags follows an
interactive setup. You can either choose to add arguments while creating a slash tag, or by editing
them later with [p]slashtag edit arguments <slashtag>
.
Argument Types
- class slashtags.SlashOptionType(value)[source]
Type
Description
Example
Adapter
String
Accepts any user inputted text as an argument.
{string}
StringAdapter
Integer
Only allows integer input for the argument.
{integer}
IntAdapter
Boolean
Allows either
True
orFalse
as input.{boolean}
StringAdapter
User
Refers to a member of the server or a member in the DM channel, accepting username or IDs as input.
{user(name)}
MemberAdapter
Channel
Refers to a text, voice, or category channel in this server, accepting channel names or IDs as input.
{channel(topic)}
ChannelAdapter
Role
Refers to a server role, accepting role name or IDs as input.
{role(id)}
SafeObjectAdapter
Number
Accepts any floating point number.
{number}
StringAdapter
Choices
Offers a list of string choices for the user to pick. Each option has a name and underlying value which is returned as string argument when accessed.
{choice}
StringAdapter
Argument Usage
A slash tag’s argument can be accessed in its tagscript through the use of a variable block.
For example, if a slash tag has an argument named member
, it could be accessed with {member}
.
Additionally, slash tag arguments of the channel, role, or user type support attribute
access through the block parameter such as {member(nick)}
.