(documentate)
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:


== Usage and behavior ==
== Usage and behavior ==
<code>&#123;&123;Is Discord ID|''input to test''|ifNo=''output if no (optional)''|ifYes=''output if yes (optional)''}}</code>
<code>&#123;&#123;Is Discord ID|''input to test''|ifNo=''output if no (optional)''|ifYes=''output if yes (optional)''}}</code>


* <code>''input to test''</code> - Required. What will be checked to see if it is a valid Discord ID. A yes condition will be returned if this argument is a string between 6 and 20 characters long that consists only of decimal digits.
* <code>''input to test''</code> - Required. What will be checked to see if it is a valid Discord ID. A yes condition will be returned if this parameter is a string consisting solely of 8-20 decimal digits.
* <code>|ifNo=</code> - Optional. What the template will output if the input is not a valid Discord ID. If not specified, an empty string will be returned.
* <code>|ifNo=</code> - Optional. What the template will output if the input is not a valid Discord ID. If not specified, an empty string will be returned.
* <code>|ifYes=</code> - Optional. What the template will output if the input is a valid Discord ID. If not specified or the value is <code>INPUT</code>, the <code>''input to test''</code> will be returned, stripped of any whitespace.
* <code>|ifYes=</code> - Optional. What the template will output if the input is a valid Discord ID. If not specified or the value is <code>INPUT</code>, the <code>''input to test''</code> will be returned, stripped of any whitespace.

Latest revision as of 02:04, 19 July 2023

This template tests whether a given input is a valid Discord Snowflake (aka ID). This template is intended for use to process arguments in other templates; there isn't really a reason to use it directly in articles.

Usage and behavior Edit

{{Is Discord ID|input to test|ifNo=output if no (optional)|ifYes=output if yes (optional)}}

  • input to test - Required. What will be checked to see if it is a valid Discord ID. A yes condition will be returned if this parameter is a string consisting solely of 8-20 decimal digits.
  • |ifNo= - Optional. What the template will output if the input is not a valid Discord ID. If not specified, an empty string will be returned.
  • |ifYes= - Optional. What the template will output if the input is a valid Discord ID. If not specified or the value is INPUT, the input to test will be returned, stripped of any whitespace.

For example, {{Is Discord ID|501310750074077215}} will return 501310750074077215, while {{Is Discord ID|obama|ifNo=false}} will return false.

TemplateData Edit

This template tests whether a given input is a valid Discord Snowflake (aka ID). This template is intended for use to process arguments in other templates; there isn't really a reason to use it directly in articles.

Template parameters

ParameterDescriptionTypeStatus
Input1

The string to test whether it's a valid ID.

Example
501310750074077215
Stringrequired
ifNoifNo

What the template would output if it's not a valid Discord ID.

Default
(empty string)
Stringoptional
ifYesifYes

What the template would output if it is a valid Discord ID.

Default
(the ID)
Stringoptional