Skip to main content

ordered_list

Function ordered_list 

Source
pub const fn ordered_list<T: ListEntry>(items: &[T]) -> OrderedList<'_, T>
Expand description

Shows items as a numbered list from 1, or from start (D-213); nested lists count from 1.

Each line carries its own number (discord.js writes the first number on every line; Discord shows both the same way).

discord.js counterpart: orderedList.

ยงExamples

use djs_formatters::ordered_list;

assert_eq!(ordered_list(&["wake up", "code"]).to_string(), "1. wake up\n2. code");
assert_eq!(ordered_list(&["third"]).start(3).to_string(), "3. third");