Examples
Real tags you can save and run as-is, from dice and minigames to a full statistics embed.
How these work
Every example in this chapter is the content of a working tag. Paste the code in as a tag's content, either in the dashboard or with f!tags add <name> text ... for single-line tags. Then run it by name. Anything after the tag name arrives as args.
Dice roller
a dice roller
split, int, a for loop, push, join, and sum. Pass a spec like 2d6.
f!tags dice 2d6RPS
Rock, paper, scissors
a dict of winning pairs, choose for the random pick, and an if/elif/else chain.
f!tags rps rockFibonacci
recursive functions
named functions with return, plus a classic counter loop.
f!tags fibonacciPassword generator
a random password
choose, split, a loop, join, and shuffle, wrapped in a code block.
f!tags password 16Caesar cipher
a Caesar cipher
indexOf into the alphabet, charAt back out, and while loops to wrap around.
f!tags caesar "attack at dawn" 3Word count
a frequency counter
nested loops, dict tallying with has, sort with a comparator, and embed fields built in a loop.
f!tags wordcount the quick brown fox jumps over the lazy dog theStatistics embed
min, max, mean, median, mode
sort on a copy, modulo for the median, dict tallying for the mode, and a finished embed.
f!tags stats 4 8 15 16 23 42User info
a profile card
the $user globals, mention and strftime, and guarding against missing fields.
f!tags userinfoRegex
regex helpers
Shows off test, regexReplace, and match against a sample string.
f!tags regexMore to explore
Start somewhere
f!tags add or in the dashboard, run it by name, and start tweaking. The rest of this guide has every piece it uses.