Template:Server invite/doc: Difference between revisions
Jump to navigation
Jump to search
doc |
+category |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
Outputs the invite link for a Discord server. The link is pulled (via [[Special:CargoTables/discord_servers|Cargo]]) from that server's infobox. | Outputs the invite link for a Discord server. The link is pulled (via [[Special:CargoTables/discord_servers|Cargo]]) from that server's infobox. | ||
Usage: <code>{{Server invite|''server name or ID''}}</code> | Usage: <code>{{Server invite|''server name or ID''|text=''link text (optional)''}}</code> | ||
Example: <code><nowiki>{{Server invite|Dogelore}}</nowiki></code> outputs {{Server invite|Dogelore}} | Example: <code><nowiki>{{Server invite|Dogelore}}</nowiki></code> outputs {{Server invite|Dogelore}}. <code><nowiki>{{Server invite|Dogelore|text=Dogelore Invite}}</nowiki></code> outputs {{Server invite|Dogelore|text=Dogelore Invite}}. | ||
The name or Discord ID used must match the one used in that server's infobox. | The name or Discord ID used must match the one used in that server's infobox. | ||
Line 22: | Line 22: | ||
"type": "string", | "type": "string", | ||
"default": "(no invite found)" | "default": "(no invite found)" | ||
}, | |||
"text": { | |||
"label": "Link text", | |||
"description": "The text that will be displayed by the link. If omitted, the full link URL will be displayed.", | |||
"type": "string", | |||
"default": "(the raw link)", | |||
"suggested": true | |||
} | } | ||
}, | }, | ||
"description": "Outputs the invite link for a Discord server. The link is pulled from that server's infobox." | "description": "Outputs the invite link for a Discord server. The link is pulled from that server's infobox.", | ||
"paramOrder": [ | |||
"1", | |||
"text", | |||
"default" | |||
] | |||
} | } | ||
</templatedata> | </templatedata> | ||
<includeonly> | |||
[[Category:Templates that query Cargo]] | |||
</includeonly> |
Latest revision as of 09:23, 19 July 2023
Outputs the invite link for a Discord server. The link is pulled (via Cargo) from that server's infobox.
Usage: {{Server invite|server name or ID|text=link text (optional)}}
Example: {{Server invite|Dogelore}}
outputs https://discord.gg/coal. {{Server invite|Dogelore|text=Dogelore Invite}}
outputs Dogelore Invite.
The name or Discord ID used must match the one used in that server's infobox.
TemplateData[edit source]
Outputs the invite link for a Discord server. The link is pulled from that server's infobox.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Server | 1 | The name or Discord ID of the server.
| String | required |
Link text | text | The text that will be displayed by the link. If omitted, the full link URL will be displayed.
| String | suggested |
default | default | What to output if no invite link could be found.
| String | optional |