BuildcordDocs

Pick at random

Pick a random item of a list, or a random row of a collection.

data.random picks one thing at random.

Settings

SettingWhat it does
FromA list, or a collection's rows.
ListFor a list: items separated by commas or lines, such as {var.prizes}.
Collection, WhereFor rows: which rows to pick from.
Read the row asFor rows: its columns are {row.column} unless you name it.
Save asFor a list: the name to keep the item under. The default is pick.

Ways out

Way outTaken when
PickedSomething was picked.
Nothing to pickThe list was empty, or no row matched.

Turn on If it fails for a red way out when picking from rows.

Example

A giveaway: pick a random row of entries where giveaway = {row.id}, then announce <@{row.user}> as the winner.

On this page