Moderation
isTicket
$isTicket
$isTicket returns true when the name of a channel contains the text ticket (case-insensitive, anywhere in the name), false otherwise. There is no persistent ticket marker: the name is the only test.
Syntax
$isTicket[(channelID)]
Parameters
| Parameter | Description |
|---|---|
channelID |
Optional. The channel to test. If omitted or empty, the current channel is used. A value that is not a number raises Invalid channel ID. |
Return value
- Type: String
"true"or"false". falsealso when the channel cannot be found.
Behavior
- Because only the name is checked,
ticket-johnandmy-ticketing-roomboth givetrue, while a ticket channel renamed without the word givesfalse. Do not use it as an authorization guard. - Channels created by
$newTicketare namedticket-....
Examples
Ticket validation
$title[Ticket Verification]
$description[Channel <#$channelID> ticket status: **$isTicket**]
$color[#5865F2]
Only inside tickets
$onlyIf[$isTicket==true;This command only works in ticket channels.]
$sendMessage[Ticket command executed.]
Try it
Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.