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.

Fluxer
f!tags dice 2d6
rune
15 lines

RPS

Rock, paper, scissors

a dict of winning pairs, choose for the random pick, and an if/elif/else chain.

Fluxer
f!tags rps rock
rune
18 lines

Fibonacci

recursive functions

named functions with return, plus a classic counter loop.

Fluxer
f!tags fibonacci
rune
8 lines

Password generator

a random password

choose, split, a loop, join, and shuffle, wrapped in a code block.

Fluxer
f!tags password 16
rune
23 lines

Caesar cipher

a Caesar cipher

indexOf into the alphabet, charAt back out, and while loops to wrap around.

Fluxer
f!tags caesar "attack at dawn" 3
rune
19 lines

Word count

a frequency counter

nested loops, dict tallying with has, sort with a comparator, and embed fields built in a loop.

Fluxer
f!tags wordcount the quick brown fox jumps over the lazy dog the
rune
26 lines

Statistics embed

min, max, mean, median, mode

sort on a copy, modulo for the median, dict tallying for the mode, and a finished embed.

Fluxer
f!tags stats 4 8 15 16 23 42
rune
41 lines

User info

a profile card

the $user globals, mention and strftime, and guarding against missing fields.

Fluxer
f!tags userinfo
rune
18 lines

Regex

regex helpers

Shows off test, regexReplace, and match against a sample string.

Fluxer
f!tags regex
rune
6 lines

More to explore

Start somewhere

Save any tag with f!tags add or in the dashboard, run it by name, and start tweaking. The rest of this guide has every piece it uses.