ℹ️ {argsArray}
{argsArray}
Gets user input as an array.
Example Code
Your input was {argsArray}
Example Output
Your input was ["Hello","world!"]
Not sure how to use BBTag? Check out the documentation:
{argsArray}
Gets user input as an array.
Your input was {argsArray}
Your input was ["Hello","world!"]
{argsLength}
Return the number of arguments the user provided.
You said {argsLength} words.
You said 4 words.
{isCustomCommand}
Checks if the tag is being run from within a cc. Returns a boolean (true
or false
)
{if;{isCustomCommand};{dm;{userId};You have mail!};Boo, this only works in cc's}
Boo, this only works in cc's
Will be replaced by {
on execution.
{lb}
Returns {
This is a bracket! {lb}
This is a bracket! {
{rb}
Returns }
This is a bracket! {rb}
This is a bracket! }
{semi}
Returns ;
This is a semicolon! {semi}
This is a semicolon! ;
{tagAuthor}
Returns the user id of the tag/cc author
This tag was created by {username;{tagAuthor}}
This tag was created by stupid cat
{tagAuthorizer}
Returns the user id of the tag/cc authorizer
{username;{tagAuthorizer}} authorized this tag!
stupid cat authorized this tag!
{zws}
Returns a single zero width space (unicode 200B)
{zws}
{base64Decode;<text>}
Converts the provided base64 to a UTF-8 string.
{base64decode;RmFuY3kh}
Fancy!
{base64Encode;<text>}
Converts the provided text to base64.
{base64decode;Fancy!}
RmFuY3kh!
{bool;<arg1>;<evaluator>;<arg2>}
Evaluates arg1
and arg2
using the evaluator
and returns true
or false
. Valid evaluators are ==
, !=
, >=
, >
, <=
, <
, startswith
, endswith
, includes
and contains
The positions of evaluator
and arg1
can be swapped.
{bool;5;<=;10}
true
{brainfuck;<code>;[input]}
Interprets code
as brainfuck, using input
as the text for ,
.
{brainfuck;-[------->+<]>-.-[->+++++<]>++.+++++++..+++.[--->+<]>-----.---[->+++<]>.-[--->+<]>---.+++.------.--------.-[--->+<]>.}
Hello World!
{capitalize;<text>}
Capitalizes the first letter of text
, leaves the rest of the text untouched.
{capitalize;hello world!}
{capitalize;hELLO world}
Hello world!
HELLO world
{capitalize;<text>;<lower>}
Capitalizes the first letter of text
, and converts the rest to lowercase.
{capitalize;hELLO WORLD;true}
{capitalize;hello WORLD;anything goes here}
{capitalize;foo BAR;}
Hello world
Hello world
Foo bar
{choose;<choice>;<options>...}
Chooses from the given options
, where choice
is the index of the option to select.
I feel like eating {choose;1;cake;pie;pudding} today.
I feel like eating pie today.
{clean;<text>}
Removes all duplicated whitespace from text
, meaning a cleaner output.
{clean;Hello!
Im here to help}
Hello!
Im here to help
If inputFormat
is omitted or left empty, the format of color
is automatically calculated, but might be inaccurate. For accuracy and known color
formats use inputFormat
. It converts all ways between rgb
, hsl
, hsv
, hwb
, cmyk
, ansi16
, hex
strings, and CSS keyword
s (will round to closest).
{color;<color>;[outputFormat]}
outputFormat
defaults to hex
if omitted or left blank.
Converts a color to outputFormat
.
{color;#4286f4;RGB}
[66,134,244]
{color;<color>;<outputFormat>;<inputFormat>}
outputFormat
defaults to hex
if left blank.
Converts a color of inputFormat
to outputFormat
. If inputFormat
is left empty, it will be automatically calculated.
{color;[66,134,244];hex;RGB}
#4286f4
{comment;<anything>...}
Does nothing. Your code is simply ignored.
This is a sentence. {//;This is a comment.}
This is a sentence.
{decancer;<text>}
Returns the decancered version of text
.
{decancer;ḩ̸̪̓̍a̶̗̤̎́h̵͉͓͗̀ā̷̜̼̄ ̷̧̓í̴̯̎m̵͚̜̽ ̸̛̝ͅs̴͚̜̈o̴̦̗̊ ̷͎͋ȩ̵͐d̶͎̂̇g̴̲͓̀͝y̶̠̓̿}
haha im so edgy
{escapeBBTag;<input>...}
Returns input
without resolving any BBTagThis effectively returns the characters {
, }
and ;
as is, without the use of {rb}
, {lb}
and {semi}
.
NOTE: Brackets inside code must come in pairs. A {
has to be followed by a }
somewhere and a } has to have a {
before it
{escapeBBTag;{set;~index;1}}
{set;~index;1}
{hash;<text>}
Returns the numeric hash of text
, based on the unicode value of each individual character. This results in seemingly randomly generated numbers that are constant for each specific query.
NOTE: This hash isn’t a particularly robust one, it is a quick implementation that was thrown together. To use a proper hash function, specify the algorithm
The hash of brown is {hash;brown}.
The hash of brown is 94011702.
{hash;<algorithm>;<text>}
Performs a hash on the given text
. If the text
starts with buffer:
then it will first be decoded as a base64 string. If it starts with text:
then it will be treated as plaintext. The hash result will be returned as a hex number.
Supported algorithm
s are: md5
, sha1
, sha256
, sha512
, whirlpool
{hash;sha256;brown}
The hash of brown is 5eb67f9f8409b9c3f739735633cbdf92121393d0e13bd0f464b1b2a6a15ad2dc
{htmlDecode;<text>...}
Decodes html entities from text
.
{htmlDecode;<hello, world>}
<hello, world>
{htmlEncode;<text>}
Encodes text
with escaped html entities.
{htmlEncode;<hello, world>}
<hello, world>
If evaluator
and value2
are provided, value1
is evaluated against value2
using evaluator
. If they are not provided, value1
is read as true
or false
. If the resulting value is true
then the tag returns then
, otherwise it returns else
.
Valid evaluators are ==
, !=
, >=
, >
, <=
, <
, startswith
, endswith
, includes
and contains
.
{if;<boolean>;<then>}
If boolean
is true
, return then
, else do nothing.
{if;{isCustomCommand};This is a custom command!}
This is a custom command!
{if;<boolean>;<then>;<else>}
If boolean
is true
, return then
, else execute else
{if;{isCustomCommand};This is a custom command!;This isn't a custom command!}
This isn't a custom command!
{if;<value1>;<evaluator>;<value2>;<then>}
Value1
is evaluated against value2
using evaluator
, if the resulting value is true
then the tag returns then
.
{if;{userId};==;103347843934212096;Hi stupid cat!}
Hi stupid cat!
{if;<value1>;<evaluator>;<value2>;<then>;<else>}
Value1
is evaluated against value2
using evaluator
, if the resulting value is true
then the tag returns then
, otherwise it returns else
{if;{userId};==;103347843934212096;Hi stupid cat!;Who are you stranger?}
Who are you stranger?
{indexOf;<text|array>;<searchfor>;[start]}
start
defaults to 0
if omitted or left blank.
Finds the index of searchFor
in text|array
, after start
. text|array
can either be plain text or an array. If it’s not found, returns -1.
The index of "o" in "hello world" is {indexof;hello world;o}
The index of "o" in "hello world" is 4
{length;<value>}
Gives the amount of characters in value
, or the number of elements if it is an array.
What you said is {length;{args}} chars long.
What you said is 5 chars long.
{logic;<operator>;<values>...}
Accepts 1 or more boolean values
(true
or false
) and returns the result of operator
on them. Valid logic operators are &&
, ||
, xor
, !
and ^
.See {operators}
for a shorter way of performing logic operations.
{logic;&&;true;false}
false
{lower;<text>}
Returns text
as lowercase.
{lower;THIS WILL BECOME LOWERCASE}
this will become lowercase
{md5;<text>}
Converts the provided text to md5.
{md5;Woosh whap phew!}
71d97a11f770a34d7f8cf1f1d8749d85
{newline;[count]}
count
defaults to 1
if omitted or left blank.
Will be replaced by count
newline characters (\n).
Hello,{newline}world!
Hello,
world!
{==;<values>...}
Returns true
if all value
s are equal, otherwise false
{==;a;b;c} {==;a;b;a} {==;a;a;b} {==;a;a;a;a;a}
false false false true
{!=;<values>...}
Returns true
if all pairs of value
s are not equal
{!=;a;b;c} {!=;a;b;a} {!=;a;a;b}
true true false
{>=;<values>...}
Returns true
if each value
is greater than or equal to the value after it, otherwise false
{>=;a} {>=;c;c;b;a} {>=;2;4;3;2;1} {>=;d;c;b;a}
false true false true
{>;<values>...}
Returns true
if each value
is greater than the value after it, otherwise false
{>;a} {>;c;c;b;a} {>;2;4;3;2;1} {>;d;c;b;a}
false false false true
{<=;<values>...}
Returns true
if each value
is less than or equal to the value after it, otherwise false
{<=;a} {<=;a;b;c;c} {<;1;2;3;4;2} {<=;a;b;c;d}
false true false true
{<;<values>...}
Returns true
if each value
is less than the value after it, otherwise false
{<;a} {<;a;b;c;c} {<;1;2;3;4;2} {<;a;b;c;d}
false false false true
{startswith;<values>...}
Returns true
if the first value
starts with all the rest. If the first value
is an array then the first element must equal all the remaining values.
{startswith;abcdefghi;a;abcd;abc} {startswith;["abc","def","ghi"];["}
true false
{endswith;<values>...}
Returns true
if the first value
ends with all the rest. If the first value
is an array then the last element must equal all the remaining values.
{endswith;abcdefghi;ghi;hi} {endswith;["abc","def","ghi"];"]}
true false
{includes;<values>...}
Returns true
if the first value
contains all the rest. If the first value
is an array then the array must contain all the remaining values.
{includes;abcdefghi;abc} {includes;["abc","def","ghi"];","}
true false
{contains;<values>...}
Returns true
if the first value
contains all the rest. If the first value
is an array then the array must contain all the remaining values.
{contains;abcdefghi;abc} {contains;["abc","def","ghi"];","}
true false
{&&;<values>...}
Returns true
if all of the value
s are true
, otherwise false
{&&;true;true} {&&;true;false;true}
true false
{||;<values>...}
Returns true
if any of the value
s are true
, otherwise false
{||;false;false} {||;true;false;true}
false true
{xor;<values>...}
Returns true
if exactly 1 of the value
s are true
, otherwise false
{^;false;false} {^;true;false;true} {^;false;true;false}
false false true
{!;<values>...}
Inverts a boolean value
. All values after the first one are ignored.
{!;true} {!;false}
false true
{+;<values>...}
Returns the result from summing all the values
s together
{+;1;2;3;4}
10
{-;<values>...}
Returns the result from subtracting all the value
s from the first
{-;4;3;2;1}
-2
{*;<values>...}
Returns the result from multiplying all the value
s together
{*;1;2;3;4}
24
{/;<values>...}
Returns the result from dividing the first value
by all the rest
{/;5} {/;120;5;4;3}
5 2
{%;<values>...}
Returns the remainder after dividing each pair of value
s.
{%;24;5} {%;24;5;3} {%;19;5;4}
4 1 0
{^;<values>...}
Returns the result of raising the first value
to the power of all the rest
{^;2;3} {^;2;2;2;2}
8 256
{??;<values>...}
Returns the first non-empty value given.
{??;abc;;123} {??;;;;
;def;aaaa}
abc def
{pad;<direction>;<back>;<text>}
Places text
on top of back
with it being aligned to the opposite of direction
. If text
is longer than back
then it will simply overlap
{pad;left;000000;ABC}
000ABC
{randomChoose;<choiceArray>}
Picks one random entry from choiceArray
.
I feel like eating {randomChoose;["pie", "cake", "pudding"]} today
I feel like eating pie today
{randomChoose;<choices>...}
Picks one random entry from choices
I feel like eating {randomChoose;cake;pie;pudding} today
I feel like eating pudding today.
{randomString;<chars>;<length>}
Creates a random string with characters from chars
that is length
characters long.
{randomString;abcdefghijklmnopqrstuvwxyz;9}
kgzyqcvda
{realPad;<text>;<length>}
Pads text
using space until it has length
characters. Spaces are added on the right side.
{realPad;Hello;10} world!
Hello world!
{realPad;<text>;<length>;<filler>;[direction]}
filler
defaults to
if left blank.direction
defaults to right
if omitted or left blank.
Pads text
using filler
until it has length
characters. filler
is applied to the direction
of text
.
{realPad;ABC;6;0;left}
000ABC
Any bbtag in regex
will not be resolved. Please consider using {apply}
for a dynamic regex. regex
will only succeed to compile if it is deemed a safe regular expression (safe regexes do not run in exponential time for any input)
{regexReplace;<regex>;<replaceWith>}
regex
can at most be 50000 characters long
Replaces the regex
phrase with replaceWith
. This is executed on the output of the containing tag.
I like to eat cheese. {regexReplace;/cheese/;pie}
I like to eat pie.
{regexReplace;<text>;<regex>;<replaceWith>}
regex
can at most be 50000 characters long
Replace the regex
phrase with replaceWith
. This is executed on text
.
I like {regexReplace;to consume;/o/gi;a} cheese. {regexReplace;/e/gi;n}
I likn ta cansumn chnnsn.
{regexSplit;<text>;<regex>}
regex
can at most be 50000 characters long
Splits the given text using the given regex
as the split rule. Any bbtag in regex
will not be resolved. Please consider using {apply}
for a dynamic regex. regex
will only succeed to compile if it is deemed a safe regular expression (safe regexes do not run in exponential time for any input)
{regexSplit;Hello there, I am hungry;/[\s,]+/}
["Hello","there","I","am","hungry"]
{regexTest;<text>;<regex>}
regex
can at most be 50000 characters long
Tests if the regex
phrase matches the text
, and returns a boolean (true/false). Any bbtag in regex
will not be resolved. Please consider using {apply}
for a dynamic regex. regex
will only succeed to compile if it is deemed a safe regular expression (safe regexes do not run in exponential time for any input)
{regexTest;apple;/p+/i} {regexTest;banana;/p+/i}
true false
{replace;<phrase>;<replaceWith>}
Replaces the first occurrence of phrase
with replaceWith
. This is executed on the output from the containing tag.
Hello world! {replace;Hello;Bye}
Bye world!
{replace;<text>;<phrase>;<replaceWith>}
Replaces the first occurrence of phrase
in text
with replaceWith
.
I like {replace;to eat;eat;nom} cheese. {replace;cheese;ham}
I like to nom ham. ham
{reverse;<text>}
Reverses the order of text
. If text
is an array, the array will be reversed. If {get}
is used with an array, this will modify the original array.
{reverse;palindrome}
emordnilap
{space;[count]}
count
defaults to 1
if omitted or left blank.
Will be replaced by count
spaces. If count
is less than 0
, no spaces will be returned.
Hello,{space;4}world!
Hello, world!
{substring;<text>;<start>;[end]}
Returns all text from text
between the start
and end
. end
defaults to the length of text.
Hello {substring;world;2;3}!
Hello r!
{switch;<value>;(<case>;<then>)...;[default]}
Compares value
against each case
and executes the first then
that matches. If no matches are found, default
is executed. Each case
can optionally be an array to allow matching against multiple values.
{switch;{args;0};
hi;Hello!;
["punch","bop","hit"];Got it, i'll hit {args;1} for you!;
I don't know how to do that!
}
Got it, i'll hit Danny for you!
If you provide time
, you should also provide parseFormat
to ensure it is being interpreted correctly.
See the moment documentation for more format information.
See here for parsing documentation. See here for a list of timezone codes.
{time;[format];[time];[parseFormat];[fromTimezone];[toTimezone]}
format
defaults to YYYY-MM-DDTHH:mm:ssZ
if omitted or left blank.time
defaults to now
if omitted or left blank.fromTimezone
defaults to Etc/UTC
if omitted or left blank.toTimezone
defaults to Etc/UTC
if omitted or left blank.
time
is in fromTimezone
and converted to toTimezone
using format
.
Berlin (as toTimezone): {time;HH:mm;;;;Europe/Berlin}
Berlin from UTC 12:00: {time;HH:mm;12:00;HH:mm;;Europe/Berlin}
Berlin (as fromTimezone): {time;HH:mm;;;Europe/Berlin}
Berlin (as fromTimezone and empty toTimezone): {time;HH:mm;;;Europe/Berlin;}
New York from Berlin (12:00 in Berlin): {time;HH:mm;12:00;HH:mm;Europe/Berlin;America/New_York}
Time Berlin (as toTimezone): 23:33
Berlin from UTC 12:00: 13:00
Berlin (as fromTimezone): 23:33
Berlin (as fromTimezone and empty toTimezone): 21:33
New York from Berlin (12:00 in Berlin): 06:00
{trim;<text>}
Trims whitespace and newlines before and after text
.
Hello {trim;{space;10}beautiful{space;10}} World
Hello beautiful World
{unindent;<text>;[level]}
Unindents text (or code!). If no level is provided, attempts to guess the indentation level past the first line.
```
{unindent;
hello
world
}
```
```
hello
world
```
{upper;<text>}
Returns text
as uppercase.
{upper;this will become uppercase}
THIS WILL BECOME UPPERCASE
{uriDecode;<text>}
Decodes text
from URI format.
{uriDecode;Hello%20world}
Hello world!
{uriEncode;<text>}
Encodes text
in URI format. Useful for constructing links.
{uriEncode;Hello world!}
Hello%20world!
{void;<code>...}
Executes code
but does not return the output from it. Useful for silent functionality
{void;This won't be output!}
{concat;<values>...}
Takes values
and joins them together to form a single array. If values
is an array, it’s flattened into the resulting array.
Two arrays: {concat;["this", "is"];["an", "array"]}
Strings and an array: {concat;a;b;c;[1, 2, 3]}
Two arrays: ["this","is","an","array"]
Strings and an array: ["a","b","c", 1, 2, 3]
{isArray;<text>}
Determines whether text
is a valid array.
{isarray;["array?"]} {isarray;array?}
true false
{join;<array>;<text>}
Joins the elements of array
together with text
as the separator.
{join;["this", "is", "an", "array"];!}
this!is!an!array
{map;<variable>;<array>;<code>}
array
can at most be 10000000 characters long
Provides a way to populate an array by executing a function on each of its elements, more info here
For every element in array
, a variable called variable
will be set to the current element. The output of function
will be the new value of the element. This will return the new array, and will not modify the original.
{map;~item;["apples","oranges","pears"];{upper;{get;~item}}}
["APPLES","ORANGES","PEARS"]
{pop;<array>}
Returns the last element in array
. If provided a variable, this will remove the last element from array
as well.
{pop;["this", "is", "an", "array"]}
array
{push;<array>;<values>...}
Pushes values
onto the end of array
. If provided a variable, this will update the original variable. Otherwise, it will simply output the new array.
{push;["this", "is", "an"];array}
["this","is","an","array"]
{shift;<array>}
Returns the first element in array
. If used with a variable this will remove the first element from array
as well.
{shift;["this", "is", "an", "array"]}
this
{shuffle}
Shuffles the {args}
the user provided.
{shuffle} {args;0} {args;1} {args;2}
three one two
{shuffle;<array>}
Shuffles the {args}
the user provided, or the elements of array
. If used with a variable this will modify the original array
{shuffle;[1,2,3,4,5,6]}
[5,3,2,6,1,4]
{slice;<array>;<start>;[end]}
end
defaults to 999999999999
if omitted or left blank.
Grabs elements between the zero-indexed start
and end
points (inclusive) from array
.
{slice;["this", "is", "an", "array"];1}
["is","an","array"]
{sort;<array>;[descending]}
descending
defaults to false
if omitted or left blank.
Sorts the array
in ascending order. If descending
is provided, sorts in descending order. If provided a variable, will modify the original array
.
{sort;[3, 2, 5, 1, 4]}
[1,2,3,4,5]
If used with a variable this will modify the original array.
Returns an array of removed items.
{splice;<array>;<start>;[deleteCount]}
deleteCount
defaults to 0
if omitted or left blank.
Removes deleteCount
elements from array
starting at start
.
{splice;["this", "is", "an", "array"];1;1}
["is"]
{splice;<array>;<start>;<deleteCount>;<items>...}
deleteCount
defaults to 0
if left blank.
Removes deleteCount
elements from array
starting at start
. Then, adds each item
at that position in array
. Returns the removed items.
{set;~array;["this", "is", "an", "array"]} {splice;{get;~array};1;1;was} {get;~array}
["is"] {"v":["this","was","an","array"],"n":"~array"}
{split;<text>;[splitter]}
Splits text
using splitter
, and the returns an array.
{split;Hello! This is a sentence.;{space}}
["Hello!","This","is","a","sentence."]
{apply;<subtag>;<args>...}
Executes subtag
, using the args
as parameters. If args
is an array, it will get deconstructed to it’s individual elements.
{apply;randomInt;[1,4]}
3
{regexMatch;<text>;<regex>}
regex
can at most be 50000 characters long
Returns an array of everything in text
that matches regex
. Any bbtag in regex
will not be resolved. Please consider using {apply}
for a dynamic regex. regex
will only succeed to compile if it is deemed a safe regular expression (safe regexes do not run in exponential time for any input)
{regexMatch;I have $1 and 25 cents;/\d+/g}
["1", "25"]
{json;[input]}
input
defaults to {}
if omitted or left blank.
Defines a raw JSON object. Usage of subtags is disabled in input
, inside input
all brackets are required to match.
{json;{
"key": "value"
}}
{
"key": "value"
}
{jsonClean;<input>}
input
defaults to {}
if left blank.
Using the input
as a base, cleans up the JSON file structure, parsing stringified nested objects/arrays. Will not mutate the original object.
{jsonClean;{j;{"test":"[]"}}}
{"test":[]}
{jsonGet;<input>}
input
can at most be 10000000 characters long, and defaults to {}
if left blank.
Gets a json value. Works with arrays too!input
can be a JSON object, array, or string. If a string is provided, a variable with the same name will be used.
{jsonGet;{j;{
"array": [
"zero",
{ "value": "one" },
"two"
]
}};array.1.value}
one
{jsonGet;<input>;<path>}
input
can at most be 10000000 characters long, and defaults to {}
if left blank.
Navigates the path of a JSON object. Works with arrays too!input
can be a JSON object, array, or string. If a string is provided, a variable with the same name will be used.path
is a dot-noted series of properties.
{jsonGet;{j;{
"array": [
"zero",
{ "value": "one" },
"two"
]
}};array.1.value}
one
{jsonKeys;<object>;[path]}
object
can at most be 10000000 characters long, and defaults to {}
if left blank.
Retrieves all keys from provided the JSON object. object
can be a JSON object, array, or string. If a string is provided, a variable with the same name will be used.path
is a dot-noted series of properties.
{set;~json;{json;{"key": "value", "key2" : "value2"}}
{jsonKeys;~json}
["key","key2"]
{jsonSet;<input>;<path>}
input
defaults to {}
if left blank.
Deletes the value at path
. input
can be a JSON object or array
{set;~json;{json;{"key" : "value"}}}
{jsonSet;~json;key}
{get;~json}
{}
{jsonSet;<input>;<path>;<value>}
input
defaults to {}
if left blank.
Using the input
as a base, navigates the provided dot-notated path
and assigns the value
. input
can be a JSON object, array, or string. If a string is provided, a variable with the same name will be used.If create
is not empty, will create/convert any missing keys.
{jsonSet;;path.to.key;value;create}
{"path":{"to":{"key":"value"}}}
{jsonSet;<input>;<path>;<value>;<create>}
input
defaults to {}
if left blank.
Using the input
as a base, navigates the provided dot-notated path
and assigns the value
. input
can be a JSON object, array, or string. If a string is provided, a variable with the same name will be used.If create
is not empty, will create/convert any missing keys.
{jsonSet;;path.to.key;value;create}
{"path":{"to":{"key":"value"}}}
{jsonSort;<array>;<path>;[descending]}
Sorts an array of objects based on the provided path
.path
is a dot-noted series of properties.
If descending
is provided, sorts in descending order.
If provided a variable, will modify the original array
.
{set;~array;{json;[
{"points" : 10, "name" : "Blargbot"},
{"points" : 3, "name" : "UNO"},
{"points" : 6, "name" : "Stupid cat"},
{"points" : 12, "name" : "Winner"}
]}}
{jsonStringify;{jsonSort;{slice;{get;~array};0};points};2}
[
"{\"points\":3,\"name\":\"UNO\"}",
"{\"points\":6,\"name\":\"Stupid cat\"}",
"{\"points\":10,\"name\":\"Blargbot\"}",
"{\"points\":12,\"name\":\"Winner\"}"
]
{jsonStringify;<input>;[indent]}
input
defaults to {}
if left blank.indent
defaults to 4
if omitted or left blank.
Pretty-prints the provided JSON input
with the provided indent
.
{jsonStringify;["one","two","three"]}
[
"one",
"two",
"three"
]
{jsonValues;<object>;[path]}
object
can at most be 10000000 characters long, and defaults to {}
if left blank.
Retrieves all values from provided the JSON object. object
can be a JSON object, array, or string. If a string is provided, a variable with the same name will be used.path
is a dot-noted series of properties.
{set;~json;{json;{"key": "value", "key2" : "value2"}}
{jsonValues;~json}
["value","value2"]
{absolute;<number>}
Gets the absolute value of number
{absolute;-535}
535
{absolute;<numbers>...}
Gets the absolute value of each numbers
and returns an array containing the results
{absolute;-535;123;-42}
[535, 123, 42]
{base;<integer>;[origin];<radix>}
origin
defaults to 10
if omitted or left blank.
Converts integer
from a base origin
number into a base radix
number. radix
and origin
must be between 2 and 36.
{base;FF;16;10}
255
{decrement;<varName>}
Decreases varName
‘s value by 1
.
{set;~counter;0} {repeat;{decrement;~counter},;10}
-1,-2,-3,-4,-5,-6,-7,-8,-9,-10
{decrement;<varName>;<amount>;[floor]}
amount
defaults to 1
if left blank.floor
defaults to true
if omitted or left blank.
Decreases varName
‘s value by amount
. floor
is a boolean, and if it is true
then the value will be rounded down.
{set;~counter;0} {repeat;{decrement;~counter;-2},;10}
-2,-4,-6,-8,-10,-12,-14,-16,-18,-20
{increment;<varName>}
Increases varName
‘s value by 1
.
{set;~counter;0} {repeat;{increment;~counter},;10}
1,2,3,4,5,6,7,8,9,10
{increment;<varName>;<amount>;[floor]}
amount
defaults to 1
if left blank.floor
defaults to true
if omitted or left blank.
Increases varName
‘s value by amount
. floor
is a boolean, and if it is true
then the value will be rounded down.
{set;~counter;0} {repeat;{increment;~counter;-2},;10}
2,4,6,8,10,12,14,16,18,20
{math;<operator>;<numbers>...}
Accepts multiple values
and returns the result of operator
on them. Valid operators are +
, -
, *
, /
, %
and ^
See {operators}
for a shorter way of performing numeric operations.
2 + 3 + 6 - 2 = {math;-;{math;+;2;3;6};2}
2 + 3 + 6 - 2 = 9
{max;<numbers>...}
Returns the largest entry out of numbers
. If an array is provided, it will be expanded to its individual values.
{max;50;2;65}
65
{min;<numbers>...}
Returns the smallest entry out of numbers
. If an array is provided, it will be expanded to its individual values.
{min;50;2;65}
2
If roundTo
is not provided, but the number does have decimals, rounds to 3
by default. Any precision for decimals will be lost e.g: 100.000000000
becomes 100
and 100.3100000000
becomes 100.31
{numberFormat;<number>;<roundTo>}
Rounds number
to roundTo
digits. roundTo
can be left empty.
{numberFormat;123456.789;2}
{numberFormat;123456.789;-3}
{numberFormat;100.10000;}
123456.79
123000
100.1
{numberFormat;<number>;<roundTo>;<decimal>;[thousands]}
decimal
defaults to .
if left blank.
Rounds number
to roundTo
digits. Uses decimal
as the decimal separator and thousands
for the thousands separator. To skip roundTo
or decimal
leave them empty.
{numberFormat;3.1415;4;,}
{numberFormat;100000;;;.}
3,1415
100.000
{parseFloat;<number>}
Returns an floating point number from text
. If it wasn’t a number, returns NaN
.
{parseFloat;abcd} {parseFloat;12.34} {parseFloat;1.2cd}
NaN 12.34 1.2
{parseInt;<number>}
Returns an integer from text
. If it wasn’t a number, returns NaN
.
{parseInt;abcd} {parseInt;1234} {parseInt;12cd}
NaN 1234 12
{randomInt;[min];<max>}
min
defaults to 0
if omitted or left blank.
Chooses a random whole number between min
and max
(inclusive).
You rolled a {randomInt;1;6}.
You rolled a 5.
{round;<number>}
Rounds number
to the nearest whole number.
{round;1.23}
1
{roundDown;<number>}
Rounds number
down.
{roundDown;1.23}
1
{roundUp;<number>}
Rounds number
up.
{roundUp;1.23}
2
{filter;<variable>;<array>;<code>}
array
can at most be 10000000 characters long
For every element in array
, a variable called variable
will be set and code
will be executed. Returns a new array containing all the elements that returned the value true
.
While inside the code
parameter, none of the following subtags may be used: {dm}
, {send}
, {edit}
, {delete}
, {kick}
, {ban}
, {reactadd}
, {reactremove}
, {roleadd}
, {rolecreate}
, {roledelete}
, {roleremove}
, {rolesetmentionable}
, {webhook}
, {warn}
, {modlog}
, {pardon}
, {embed}
, {waitmessage}
, {waitreact}
, {sleep}
{set;~array;apples;apple juice;grapefruit}
{filter;~element;~array;{bool;{get;~element};startswith;apple}}
["apples","apple juice"]
{for;<variable>;<initial>;<comparison>;<limit>;[increment];<code>}
increment
defaults to 1
if omitted or left blank.
To start, variable
is set to initial
. Then, the tag will loop, first checking variable
against limit
using comparison
. If the check succeeds, code
will be run before variable
being incremented by increment
and the cycle repeating.
This is very useful for repeating an action (or similar action) a set number of times. Edits to variable
inside code
will be ignored
{for;~index;0;<;10;{get;~index},}
0,1,2,3,4,5,6,7,8,9,
{forEach;<variable>;<array>;<code>}
array
can at most be 10000000 characters long
For every element in array
, a variable called variable
will be set and then code
will be run.
If element
is not an array, it will iterate over each character instead.
{set;~array;apples;oranges;c#}
{forEach;~element;~array;I like {get;~element}{newline}}
I like apples
I like oranges
I like c#
{repeat;<code>;<amount>}
Repeatedly executes code
amount
times.
{repeat;e;10}
eeeeeeeeee
{while;<boolean>;<code>}
This will continuously execute code
for as long as boolean
returns true
.
{set;~x;0}
{set;~end;false}
{while;{get;~end};
{if;{increment;~x};==;10;
{set;~end;true}
}
}
{get;~end}
10
{while;<value1>;<evaluator>;<value2>;<code>}
This will continuously execute code
for as long as the condition returns true
. The condition is as follows:
If evaluator
and value2
are provided, value1
is evaluated against value2
using evaluator
. Valid evaluators are ==
, !=
, >=
, >
, <=
, <
, startswith
, endswith
, includes
and contains
.
{set;~x;0}
{while;{get;~x};<=;10;{increment;~x},}
1,2,3,4,5,6,7,8,9,10,11,
{args}
Gets the whole user input
You said {args}
You said Hello world! BBtag is so cool
{args;<index>}
Gets a word from the user input at the index
position
{args;1}
world!
{args;<start>;<end>}
Gets all the words in the user input from start
up to end
. If end
is n
then all words after start
will be returned
{args;2;4}
BBtag is
{commandName}
Gets the name of the current tag or custom command.
This command is {commandName}
This command is test
For optimization reasons, variables are not stored in the database immediately when you use {set}
. Instead they are cached, and will be saved to the database when the tag finishes. If you have some variables
that you need to be saved to the database immediately, use this to force an update right now.
This comes at a slight performance cost, so use only when needed.variables
defaults to all values accessed up to this point.{rollback}
is the counterpart to this.
{commit}
Commit all variables
{set;var;Hello!}
{commit}
{set;var;GoodBye!}
{rollback}
{get;var}
Hello!
{commit;<variables>...}
Commit provided variables
{set;var;Hello!}
{commit;var}
{set;var;GoodBye!}
{rollback;var}
{get;var}
Hello!
{debug;<text>...}
Adds the specified text to the debug output. This output is only shown via tag debug
, ccommand debug
, tag test debug
and ccommand test debug
.The line number is also included in the debug entry
{debug;current value;{get;~i}}
(in debug output)[10]current value 1
{dump;<text>}
Dumps the provided text to a blargbot output page. These expire after 7 days.
{dump;Hello, world!}
https://blargbot.xyz/output/1111111111111111
{execTag;<name>;<args>...}
Executes the name
tag, giving it args
as the input. Useful for modules.{execTag}
executes the tag as if its code was in the root command.
Let me do a tag for you. {execTag;f}
Let me do a tag for you. User#1111 has paid their respects. Total respects given: 5
{execCustomCommand;<name>;<args>...}
Executes the name
custom command, giving it args
as the input. Useful for modules.{execCustomCommand}
executes the command as if its code was in the root command.
Let me do a command for you. {execCustomCommand;f}
Let me do a command for you. User#1111 has paid their respects. Total respects given: 5
{fallback;<message>}
Should any tag fail to parse, it will be replaced with message
instead of an error.
{fallback;This tag failed} {abc}
This tag failed
{fallback}
Clears the current fallback text.
{fallback;This tag failed} {abc} {fallback} {xyz}
This tag failed `Unknown subtag xyz`
{flag;<flagName>}
Returns the value of the specified case-sensitive flag code. Use _
to get the values without a flag.
{flag;a} {flag;_}
world! Hello,
{flagsArray}
Returns an array of all flags provided.
{flagsArray}
["_","d","c"]
{flagSet;<flagName>}
Returns true
or false
, depending on whether the specified case-sensitive flag code has been set or not.
{flagSet;a} {flagSet;_}
true false
{function;<name>;<code>}
Defines a function called name
. Functions are called in the same way as subtags, however they are prefixed with func.
. While inside the code
block of a function, you may use the params
, paramsArray
and paramsLength
subtags to access the values passed to the function. These function identically to their args
counterparts.
Please note that there is a recursion limit of 200 which is also shared by {execTag}
, {execCustomCommand}
and {inject}
.
{function;test;{paramsArray}} {func.test;1;2;3;4}
["1","2","3","4"]
{get;<name>}
Returns the stored variable varName
.
You can use a character prefix to determine the scope of your variable.
Valid scopes are: _
(Server variables), @
(Author variables), *
(Global variables), ~
(Temporary variables) and no prefix (Local variables). For more information, use b!t docs variable
or b!cc docs variable
{set;var1;This is local var1}
{set;~var2;This is temporary var2}
{get;var1}
{get;~var2}
This is local var1
This is temporary var2
{get;<name>;<index>}
When variable name
is an array this will return the element at index index
. If index
is empty the entire array will be returned. If variable is not an array it will return the whole variable.
{set;myArray;["abc","def","ghi"]}{get;myArray;1}
def
{inject;<code>}
Executes any arbitrary BBTag that is within code
and returns the result. Useful for making dynamic code, or as a testing tool ({inject;{args}}
)
Random Number: {inject;{lb}randomInt{semi}1{semi}4{rb}}
Random Number: 3
{lock;<mode>;<key>;<code>}
Provides read/write locking functionality for bbtag. This is a very advanced feature, so it is recommended that you first read about the concept of locks.
In simple terms, a lock allows commands running at the same time to cooperate and wait for each other to finish what they are doing before “releasing the lock” and letting other commands use that lock. This can be used to secure against data being edited by 2 things at the same time, which can cause inconsistencies.
There can be multiple read
locks held at once or a single write
lock. This means that if all your command is doing is reading some data then as long as nothing is writing to it, it will be allowed, otherwise the command will wait until it can acquire a lock.
mode
must be either read
or write
.key
can be anything. This follows the same scoping rules as variables do.code
will be run once the lock is acquired
{//;in 2 command run in quick succession}
{lock;write;key;
{void;
{send;{channelId};Start}
{send;{channelId};Middle}
{send;{channelId};End}
}
}
This order is guaranteed always. Without a lock it isn't
Start
Middle
End
Start
Middle
End
This order is guaranteed always. Without a lock it isn't
If moderator
is not provided or left empty, it will default to blargbot.
{modLog;<action>;<user>;[moderator];[reason];[color]}
Creates a custom modLog entry with the given action
and user
with reason
. color
can be a HTML color, hex, (r,g,b) or a valid color number. .
You did a bad! {modLog;Bad;{userId};;They did a bad;#ffffff}
You did a bad! (modLog entry with white embed colour and reason 'They did a bad!')
{nsfw;[message]}
message
defaults to ❌ This contains NSFW content! Go to a NSFW channel. ❌
if omitted or left blank.
Marks the output as being NSFW, and only to be sent in NSFW channels. A requirement for any tag with NSFW content. message
is the error to show
This command is not safe! {nsfw}
This command is not safe!
{params}
Gets the whole input given to the current function call
{func;test;You gave the parameters `{params}`}
{func.test;Hello world!;BBtag is so cool}
You gave the parameters `Hello world! BBtag is so cool`
{params;<index>}
Gets a parameter passed to the current function call
{func;test;The first parameter is `{params;0}`}
{func.test;Hello world!;BBtag is so cool}
The first parameter is `Hello world!`
{params;<start>;<end>}
Gets all the parameters given from start
up to end
. If end
is n
then all parameters after start
will be returned
{func;test;The first parameter is `{params;2;4}`}
{func.test;A;B;C;D;E;F}
C D
{paramsArray}
Gets the parameters passed to the current function as an array
{func.test;{paramsArray}}
{func.test;a;b;c;d}
["a","b","c","d"]
{paramsLength}
Gets the number of parameters passed to the current function
{func.test;{paramsLength}}
{func.test;a;b;c;d}
["a","b","c","d"]
{prefix}
Gets the command prefix used to call this bbtag.
Your prefix is {prefix}
Your prefix is b!
{quiet;[isQuiet]}
isQuiet
defaults to true
if omitted or left blank.
Tells any subtags that rely on a quiet
field to be/not be quiet based on isQuiet.
isQuiet` must be a boolean
{quiet} {userMention;cat}
cat
{reason;[reason]}
Sets the reason for the next API call (ex. roleAdd, roleRemove, ban, etc.). If reason
is empty the reason will be empty
{reason;This will show up in the audit logs!}{roleAdd;111111111111}
("This will show up in the audit logs" showed up)
Only certain whitelisted domains can be used for url
. See here for the list.The output is a JSON object with the following structure. It is recommended to use {jsonGet} to navigate it.
{
"body": {}, // the body of the request
"status": 200, // the HTTP status code
"statusText": "OK", // the human readable translation of the status code
"date": "Thu, 1 Jan 1970 00:00:00 GMT", // the date sent in the headers
"contentType": "application/json", // the content type of the response
"url": "https://fancy.url/here" // the url that was requested
}
{request;<url>;[options];[data]}
Performs a HTTP request to url
, with provided options
and data
.options
is a JSON object with the following structure. It is recommended to use {jsonSet} to create it.
json { "method": "GET|POST|PUT|PATCH|DELETE", // defaults to GET "headers": { "key": "value" } }
If the method is GET and a JSON object is provided for data
, it will be formatted as query strings.
{jGet;{request;https://example.com/update/user;{jset;;method;POST};{jset;;user;Stupid cat}};body}
Stupid cat updated!
{return;[force]}
force
defaults to true
if omitted or left blank.
Stops execution of the tag and returns what has been parsed. If force
is true
then it will also return from any tags calling this tag.
This will display. {return} This will not.
This will display.
For optimization reasons, variables are not stored in the database immediately when you use {set}
. Instead they are cached, and will be saved to the database when the tag finishes. If you have some variables
that you don’t want to be changed, you can use this to revert them back to their value at the start of the tag, or the most recent {commit}
.variables
defaults to all values accessed up to this point.{commit}
is the counterpart to this.
{rollback}
Rollback all variables
{set;var;Hello!}
{commit}
{set;var;GoodBye!}
{rollback}
{get;var}
Hello!
{rollback;<variables>...}
Rollback provided variables
{set;var;Hello!}
{commit;var}
{set;var;GoodBye!}
{rollback;var}
{get;var}
Hello!
{set;<name>}
Sets the name
variable to nothing.
{set;~var;something}
{set;~var}
{get;~var}
(returns nothing)
{set;<name>;<value>}
Stores value
under name
. These variables are saved between sessions. You can use a character prefix to determine the scope of your variable.
Valid scopes are: _
(Server variables), @
(Author variables), *
(Global variables), ~
(Temporary variables) and no prefix (Local variables).
For performance reasons, variables are not immediately stored to the database. See {commit}
and {rollback}
for more information, or use b!t docs variable
or b!cc docs variable
{set;var1;This is local var1}
{set;~var2;This is temporary var2}
{get;var1}
{get;~var2}
This is local var1
This is temporary var2
{set;<name>;<values>...}
Stores an array under name
.
When getting the array, you’ll notice it retrieved an object, In this object v
is the array itself, and n
is the name
of the variable. If the array itself needs to be returned instead of object, in for example {jSet;;array;{get;~array}}
, you can use {slice;<arrayName>;0}
. In array subtags {get} will work as intended.
{set;var3;this;is;an;array}
{get;var3}
{"v":["this","is","an","array"],"n":"var3"}
{sleep;<duration>}
Pauses the current tag for the specified amount of time. Maximum is 5 minutes
{sleep;10s}{send;{channelId};Hi!}
(After 10s) Hi!
{subtagExists;<subtag>}
Checks to see if subtag
exists.
{subtagExists;ban} {subtagExists;AllenKey}
true false
{suppressLookup;[value]}
value
defaults to true
if omitted or left blank.
Sets whether error messages in the lookup system (query canceled, nothing found) should be suppressed. value
must be a boolean
{suppressLookup}
{throw;[error]}
error
defaults to A custom error occurred
if omitted or left blank.
Throws error
.
{throw;Custom Error}
`Custom Error`
{timer;<code>;<duration>}
Executes code
after duration
. Three timers are allowed per custom command, with no recursive timers.
{timer;Hello!;20s}
(after 20 seconds:) Hello!
Only custom commands can delete other messages.
{delete}
Deletes the message that invoked the command
{//;The message that triggered this will be deleted} {delete}
(the message got deleted idk how to do examples for this)
{delete;<messageId>}
Deletes the specified messageId
from the current channel.
{//;The message with id `111111111111111111` will be deleted}
{delete;111111111111111111}
(the message `111111111111111111` got deleted idk how to do examples for this)
{delete;<channel>;<messageId>}
Deletes the specified messageId
from channel channel
.
{//;The message with id `2222222222222222` from channel `1111111111111111` will be deleted}
{delete;111111111111111111;2222222222222222}
(the message `2222222222222222` from channel `1111111111111111` got deleted)
text
and embed
can both be set to _delete
to remove either the message content or embed.Please note that embed
is the JSON for an embed object or an array of embed objects, don’t put {embed}
there, as nothing will show. Only messages created by the bot may be edited.
{edit;<messageId>;<text>}
Edits messageId
in the current channel to say text
{edit;111111111111111111;{embedBuild;title:Hello world}}
{edit;<messageId>;<embed>}
Edits messageId
in the current channel to say embed
{edit;111111111111111111;{embedBuild;title:Hello world}}
{edit;<messageId>;<text>;<embed>}
Edits messageId
in the current channel to say text
and embed
{edit;111111111111111111;Hello world;{embedBuild;title:Foo bar}}
{edit;<channel>;<messageId>;<text>}
Edits messageId
in channelId
to say text
{edit;111111111111111111;222222222222222222;Hello world}
{edit;<channel>;<messageId>;<embed>}
Edits messageId
in channelId
to say embed
{edit;111111111111111111;222222222222222222;Hello world}
{edit;<channel>;<messageID>;<text>;<embed>}
Edits messageId
in channelId
to say text
and embed
{edit;111111111111111111;222222222222222222;Hello world;{embedBuild;title:Foo bar}}
{embed;<embed>...}
Takes whatever input you pass to embed
and attempts to form an embed from it. embed
must be a valid json embed object. Multiple embeds can be provided.
This subtag works well with {embedBuild}
. If attempting to use inside of a {send}
, {edit}
or {dm}
, you should not include {embed}
, and instead just pass the content direct to {send}
/{edit}
/{dm}
You can find information about embeds here (embed structure) and here (embed limits) as well as a useful tool for testing embeds here
{embed;{lb}"title":"Hello!"{rb}}
(an embed with "Hello!" as the title)
This tag is designed to allow you to generate embed code for {webhook}
and {embed}
with much less effort.
This tag uses a key/value system, with each entry in values
looking like key:value
.
Valid keys are:title
, description
, url
, color
, timestamp
, footer.icon_url
, footer.text
, thumbnail.url
, image.url
, author.name
, author.url
, author.icon_url
, fields.name
, fields.value
, fields.inline
You can find information about embeds here (embed structure) and here (embed limits) as well as a useful tool for testing embeds here
{embedBuild;<values>...}
Builds the embed json
{embedBuild;
title:hello!;
description:I am an example embed;
fields.name:Field 1;
fields.value:This is the first field!;
fields.name:Field 2;
fields.value:This is the next field and is inline!;
fields.inline:true
}
{"title":"hello!","description":"I am an example embed","fields":[{"name":"Field 1","value":"This is the first field!"},{"name":"Field 2","value":"This is the next field and is inline!","inline":true}]}
{everyoneMention;[mention]}
Returns the mention of @everyone
.
This requires the disableeveryone
setting to be false. If mention
is set to true
, @everyone
will ping, else it will be silent.
{everyoneMention}
@everyone
{file;<file>;<filename>}
Sets the output attachment to the provided file
and filename
. If file
starts with buffer:
, the following text will be parsed as base64 to a raw buffer - useful for uploading images.
{file;Hello, world!;readme.txt}
(a file labeled readme.txt containing "Hello, world!")
{hereMention;[mention]}
Returns the mention of @here
.
This requires the disableeveryone
setting to be false. If mention
is set to true
, @here
will ping, else it will be silent.
{hereMention}
@here
{messageAttachments}
Returns an array of attachments of the invoking message.
You sent the attachments "{messageAttachments}"
You sent the attachments "["https://cdn.discordapp.com/attachments/1111111111111/111111111111111/thisisntreal.png"]"
{messageAttachments;<messageid>}
Returns an array of attachments of messageId
in the current channel
Someone sent a message with attachments: "{messageAttachments;1111111111111}"
Someone sent a message with attachments: "["https://cdn.discordapp.com/attachments/1111111111111/111111111111111/thisisntreal.png"]"
{messageAttachments;<channel>;<messageid>;[quiet]}
Returns an array of attachments of messageId
from channel
. If quiet
is provided and channel
cannot be found, this will return an empty array.
Someone sent a message in #support with attachments: "{messageAttachments;support;1111111111111}"
Someone sent a message in #support with attachments: "["https://cdn.discordapp.com/attachments/1111111111111/111111111111111/thisisntreal.png"]"
If the message is not edited, this will return the current time instead.
Note: there are plans to change this behaviour, but due to backwards-compatibility this remains unchanged.
{messageEditTime;[format]}
format
defaults to x
if omitted or left blank.
Returns the edit time of the executing message in format
The edit timestamp of your message is "{messageEditTime}"
The edit timestamp of your message is "1628782144703"
{messageEditTime;<messageid>;[format]}
format
defaults to x
if omitted or left blank.
Returns the edit time of messageId
in format
The edit timestamp of message 11111111111111 is "{messageEditTime;11111111111111}
The edit timestamp of message 11111111111111 is "1628782144703"
{messageEditTime;<channel>;<messageid>;[format]}
format
defaults to x
if omitted or left blank.
Returns the edit time of messageId
from channel
in format
.
Message 11111111111111 in #support was edited at {messageEditTime;support;11111111111111;HH:mm}
Message 11111111111111 in #support was edited at 18:09
{messageEmbeds}
Returns an array of embeds of the invoking message.
You sent an embed: "{messageEmbeds}"
You sent an embed: "[{"title":"Hello!"}]"
{messageEmbeds;<messageid>}
Returns an array of embeds of messageId
in the current channel
Someone sent a message with embeds: "{messageEmbeds;1111111111111}"
Someone sent a message with attachments: "[{"title":"Hello!"}]"
{messageEmbeds;<channel>;<messageid>;[quiet]}
Returns an array of embeds of messageId
from channel
. If quiet
is provided and channel
cannot be found, this will return an empty array.
Someone sent a message in #support with embeds: "{messageEmbeds;support;1111111111111}"
Someone sent a message in #support with embeds: "[{"title":"Hello!"}]"
{messageId}
Returns the id of the invoking message.
The message id was {messageId}
The message id was 111111111111111111
{messageReply}
Returns the id of the invoking message’s parent message.
You replied to the message {messageReply}
You replied to the message 1111111111111
{messageReply;<messageid>}
Returns the id of the parent message of the provided message
.
Someone replied to the message {messageReply;2222222222222}
Someone replied to the message 1111111111111
{messageReply;<channel>;<messageid>;[quiet]}
Returns the id of the parent message of the provided message
.
Someone replied to the message {messageReply;general;2222222222222}
Someone replied to the message 1111111111111
{messageSender}
Returns the id of the author of the executing message.
That was sent by "{messageSender}"
That was sent by "1111111111111"
{messageSender;<messageid>}
Returns the id of the author of messageId
in the current channel.
Message 1111111111111 was sent by {messageSender;1111111111111}
Message 1111111111111 was sent by 2222222222222
{messageSender;<channel>;<messageid>;[quiet]}
Returns the id of the author of messageId
in channel
. If quiet
is provided and channel
cannot be found, this will return nothing.
Message 1111111111111 in #support was sent by {messageSender;support;1111111111111}
Message 1111111111111 in #support was sent by 2222222222222
{messageText}
Returns the text of the executing message.
You sent "b!t test You sent "{messageText}""`
You sent "text"
{messageText;<messageid>}
Returns the text of messageId
in the current channel.
Message 1111111111111 contained: "{messageText;1111111111111}"
Message 1111111111111 contained: "Hello world!"
{messageText;<channel>;<messageid>;[quiet]}
Returns the text of messageId
in channel
. If quiet
is provided and channel
cannot be found, this will return nothing.
Message 1111111111111 in #support contained: "{messageText;support;1111111111111}"
Message 1111111111111 in #support contained: "Spooky Stuff"
{messageTime;[format]}
format
defaults to x
if omitted or left blank.
Returns the send time of the executing message in format
The send timestamp of your message is "{messageTime}"
The send timestamp of your message is "1628782144703"
{messageTime;<messageid>;[format]}
format
defaults to x
if omitted or left blank.
Returns the send time of messageId
in format
The send timestamp of message 11111111111111 is "{messageTime;11111111111111}
The send timestamp of message 11111111111111 is "1628782144703"
{messageTime;<channel>;<messageid>;[format]}
format
defaults to x
if omitted or left blank.
Returns the send time of messageId
from channel
in format
.
Message 11111111111111 in #support was sent at {messageTime;support;11111111111111;HH:mm}
Message 11111111111111 in #support was sent at 18:09
For more info about message types, visit the discord docs.
{messageType}
Returns the message type of the executing message.
{messageType}
0
{messageType;[channel];<messageID>}
channel
defaults to the current channel.
Returns the message type of messageId
in channel
{messageType;12345678912345;123465145791}
{messageType;1234567891234}
19
0
{output;[text]}
Forces an early send of the default output message, using text
as the text to show. If this is used then there will be no output sent once the tag finishes. Only 1 {output}
may be used per tag/cc. If a second {output}
is used then the result of the first {output}
will be returned instead.
The message id of the output that was sent will be returned.
{output;Hello!}
Hello!
Please note that to be able to add a reaction, I must be on the server that you got that reaction from. If I am not, then I will return an error if you are trying to apply the reaction to another message.
{reactionAdd;<reactions>...}
Adds reactions
to the output message of this tag.
This will have reactions! {reactionAdd;🤔;👀}
This will have reactions! (reacted with 🤔 and 👀)
{reactionAdd;<messageid>;<reactions>...}
Adds reactions
to messageId
in the current channel.
{reactionAdd;11111111111111111;🤔;👀}
(11111111111111111 now has reactions 🤔 and 👀)
{reactionAdd;<channel>;<messageid>;<reactions>...}
Adds reactions
to messageId
in channelId
. channelId
must be an id, use of {channelId} is advised
.
{reactionAdd;11111111111111111;22222222222222222;🤔;👀}
(22222222222222222 in 11111111111111111 now has reactions 🤔 and 👀)
{reaction}
Gets the reaction that triggered {waitReaction}
{waitReaction;11111111111111111;{bool;{reaction};==;✅}}
["111111111111111","12345678912345","3333333333333","✅"]
{reactionUser}
Gets the user whose reaction that triggered {waitReaction}
{waitReaction;11111111111111111;{bool;{reactionUser};==;3333333333333}}
["111111111111111","12345678912345","3333333333333","✅"]
{reactionList;[channel];<messageId>}
Returns an array of reactions on messageId
in channelId
.
{reactionList;111111111111111111}
["🤔", "👀"]
{reactionList;[channel];<messageId>;<reactions>...}
Returns an array of users who reacted reactions
on messageId
in channelId
. A user only needs to react to one reaction to be included in the resulting array.
{reactionList;111111111111111111;🤔;👀}
{reactionList;222222222222222222;111111111111111111;👀}
["278237925009784832", "134133271750639616"]
["134133271750639616"]
{reactionRemove;[channel];<messageId>}
Removes all reactions of the executing user from messageId
in channel
.
{reactionRemove;12345678901234}
(removed all reactions on 12345678901234)
{reactionRemove;[channel];<messageId>;<reactions>...}
Removes reactions
user
reacted on messageId
in channel
.
{reactionRemove;12345678901234;111111111111111111;🤔}
(removed the 🤔 reaction on 12345678901234 from user 111111111111111111)
{reactionRemoveAll;[channel];<messageId>}
Removes all reactions from messageId
.channelId
defaults to the current channel.
{reactionRemoveAll;12345678901234;:thinking:}
(removed all the reactions)
If embed
is an array, multiple embeds will be added to the message payload.
{send;<channel>;<message>;<embed>;<fileContent>;[fileName]}
fileName
defaults to file.txt
if omitted or left blank.
Sends message
and embed
to channel
with an attachment, and returns the message id. channel
is either an id or channel mention. If fileContent
starts with buffer:
then the following text will be parsed as base64 to a raw buffer.
Note: embed
is the JSON for an embed, don’t put the {embed}
subtag there, as nothing will show
{send;{channelId};Hello there!;{embedBuild;title:This is a cool embed};Wow, look at this text file!;test.txt}
23946728937462847243
{send;<channel>;<message>;<embed>}
Sends message
and embed
to channel
, and returns the message id. channel
is either an id or channel mention.
Note: embed
is the JSON for an embed, don’t put the {embed}
subtag there, as nothing will show
{send;{channelId};Hello there!;{embedBuild;title:This is a cool embed}}
349587638464585678545
{send;<channel>;<content>}
Sends content
to channel
, and returns the message id. channel
is either an id or channel mention.
Note: content
is the text to send or the JSON for an embed, don’t put the {embed}
subtag there, as nothing will show
{send;{channelId};{embedBuild;title:This is a cool embed}
9458678957457694324
Pauses the command until one of the given users sends a message in any of the given channels. When a message is sent, condition
will be run to determine if the message can be accepted. If no message has been accepted within timeout
then the subtag returns Wait timed out
, otherwise it returns an array containing the channel id, then the message id.
channels
defaults to the current channel.users
defaults to the current user.condition
must return true
or false
timeout
is a number of seconds. This is limited to 300
While inside the condition
parameter, none of the following subtags may be used: dm
, send
, edit
, delete
, kick
, ban
, reactadd
, reactremove
, roleadd
, rolecreate
, roledelete
, roleremove
, rolesetmentionable
, webhook
, warn
, modlog
, pardon
, embed
, waitmessage
, waitreact
, sleep
Also, the current message becomes the users message that is to be checked. This means that {channelId}
, {messageId}
, {userId}
and all related subtags will change their values.
{waitMessage}
Pauses the command until the executing user sends a message in the current channel.
{waitMessage}
["111111111111111","2222222222222"]
{waitMessage;<channelIDs>;[userIDs];[condition];[timeout]}
condition
defaults to true
if omitted or left blank.timeout
defaults to 60
if omitted or left blank.
Pauses the command until condition
returns true when one of userIds
sends a message in one of channelIds
.
{waitMessage;111111111111111;{userId;stupid cat};{bool;{username};startswith;stupid};50}
["111111111111111", "103347843934212096"]
Pauses the command until one of the given users
adds any given reaction
on any of the given messages
. When a reaction
is added, condition
will be run to determine if the reaction can be accepted. If no reaction has been accepted within timeout
then the subtag returns Wait timed out
, otherwise it returns an array containing the channel id, the message id, the user id and the reaction, in that order.
userIds
defaults to the current user if left blank or omitted.reactions
defaults to any reaction if left blank or omitted.condition
must return true
or false
timeout
is a number of seconds. This is limited to 300
While inside the condition
parameter, none of the following subtags may be used: dm
, send
, edit
, delete
, kick
, ban
, reactadd
, reactremove
, roleadd
, rolecreate
, roledelete
, roleremove
, rolesetmentionable
, webhook
, warn
, modlog
, pardon
, embed
, waitmessage
, waitreact
, sleep
Also, the current message becomes the message the reaction was added to, and the user becomes the person who sent the message. This means that {channelId}
, {messageId}
, {userId}
and all related subtags will change their values.
Finally, while inside the condition
parameter, you can use the temporary subtag {reaction}
to get the current reaction and the {reactionUser}
temporary subtag to get the user who reacted.messages
, users
and reactions
can either be single values eg: {waitReaction;1234567891234;stupid cat;🤔}
, or they can be arrays eg: `{waitReaction;[“1234567891234”,”98765432219876”];stupid cat;[“🤔”]}
{waitReaction;<messages>;[userIDs]}
Waits for any reaction on messages
from the executing user or userIds
if provided.
{waitReaction;12345678912345;stupid cat}
["111111111111111","12345678912345","3333333333333","🤔"]
{waitReaction;<messages>;<userIDs>;<reactions>;[condition];[timeout]}
condition
defaults to true
if omitted or left blank.timeout
defaults to 60
if omitted or left blank.
Waits for any of reactions
on messages
from userIds
, if condition
returns true
this will return the response array. If no reaction was matched within timeout
, Wait timed out
will be returned.
{waitReaction;12345678912345;["{userId;stupid cat}","{userId;blargbot}"];["🤔", "👀"];;120}
["111111111111111","12345678912345","134133271750639616","🤔"]
Please assign your webhook credentials to private variables! Do not leave them in your code.embed
can be an array of embed objects.
{webhook;<id>;<token>}
Executes a webhook.
{webhook;1111111111111111;t.OK-en}
Error executing webhook: Cannot send an empty message
{webhook;<id>;<token>;<content>;[embed]}
Executes a webhook. If embed
is provided it must be provided in a raw JSON format, properly escaped for BBTag. Using {json}
is advised.
{webhook;1111111111111111;t.OK-en;This is the webhook content!;{json;{"title":"This is the embed title!"}}}
(in the webhook channel) This is the webhook content! (and with an embed with the title "This is the embed title" idk how to make this example)
{webhook;<id>;<token>;<content>;<embed>;<username>;[avatarURL]}
Executes a webhook. avatarURL
must be a valid URL.
{webhook;1111111111111111;t.OK-en;Some content!;;Not blargbot;{userAvatar;blargbot}}
(in the webhook channel) Some content! (sent by "Not blargbot" with blargbot's pfp
{webhook;<id>;<token>;<content>;<embed>;<username>;<avatarURL>;<file>;[filename]}
filename
defaults to file.txt
if omitted or left blank.
Executes a webhook. If file starts with buffer:, the following text will be parsed as base64 to a raw buffer.
{webhook;1111111111111111;t.OK-en;;;;;Hello, world!;readme.txt}
(in the webhook channel a file labeled readme.txt containing "Hello, world!")
{channelCategories}
Returns an array of category ids on the current guild.
This guild has {length;{categories}} categories.
This guild has 7 categories.
{channelCategory}
Returns the category id of the current channel.
{channelCategory}
111111111111111
{channelCategory;<channel>;[quiet]}
Returns the category id of the provided channel
. If the provided channel
is a category this returns nothing. If it cannot be found returns No channel found
, or nothing if quiet
is true
.
{channelCategory;cool channel}
{channelCategory;cool category}
111111111111111
(nothing is returned here)
type
is either text
, voice
, category
, news
or store
.
{channelCreate;<name>;[type];[options]}
type
defaults to text
if omitted or left blank.options
defaults to {}
if omitted or left blank.
Creates a channel with the specified options
of type type``options
is a JSON object, containing any or all of the following properties:
topic
nsfw
parentId
reason
(displayed in audit log) rateLimitPerUser
bitrate
(voice) userLimit
(voice){channelCreate;super-channel;;{json;{"parentId":"11111111111111111"}}}
22222222222222222
{channelDelete;<id>}
Deletes the provided channel
.
{channelDelete;11111111111111111}
{channelEdit;<channel>;[options]}
options
defaults to {}
if omitted or left blank.
Edits a channel with the given information.options
is a JSON object, containing any or all of the following properties:
name
topic
nsfw
parentId
reason
(displayed in audit log) rateLimitPerUser
bitrate
(voice) userLimit
(voice){channelEdit;11111111111111111;{j;{"name": "super-cool-channel"}}}
11111111111111111
{channelId}
Returns the id of the current channel.
{channelId}
111111111111111
{channelId;<channel>;[quiet]}
Returns the id of the given channel. If it cannot be found returns No channel found
, or nothing if quiet
is true
.
{channelId;cool channel}
{channelId;some channel that doesn't exist;true}
111111111111111
(nothing is returned here)
{channelIsCategory;<channel>;[quiet]}
Checks if channel
is a category. If it cannot be found returns No channel found
, or false
if quiet
is true
.
{channelIsCategory;cool category}
{channelIsCategory;category that doesn't exist}
true
(nothing is returned here)
{channelIsNsfw}
Checks if the current channel is a NSFW channel.
{if;{channelIsNsfw};Spooky nsfw stuff;fluffy bunnies}
fluffy bunnies
{channelIsNsfw;<channel>;[quiet]}
Checks if channel
is a NSFW channel. If it cannot be found returns No channel found
, or false
if quiet
is true
.
{channelIsNsfw;SFW Cat pics}
true
{channelIsText}
Checks if the current channel is a text channel.
{if;{channelIsText};Yeah you can write stuff here;How did you even call the command?}
Yeah you can write stuff here
{channelIsText;<channel>;[quiet]}
Checks if channel
is a text channel. If it cannot be found returns No channel found
, or false
if quiet
is true
.
{channelIsText;feature discussions}
true
{channelIsThread}
Checks if the current channel is a thread channel.
{if;{channelIsThread};Cool, this is a thread channel!;Boo, this is a regular text channel}
Cool, this is a thread channel!
{channelIsThread;<channel>;[quiet]}
Checks if channel
is a thread channel. If it cannot be found returns No channel found
, or false
if quiet
is true
.
{channelIsThread;blargbot podcast}
true
{channelIsVoice}
Checks if the current channel is a voice channel.
{if;{channelIsVoice};How did you even call the command?;Yeah you can write stuff here}
Yeah you can write stuff here
{channelIsVoice;<channel>;[quiet]}
Checks if channel
is a voice channel. If it cannot be found returns No channel found
, or false
if quiet
is true
.
{channelIsVoice;blargbot podcast}
true
{channelName}
Returns the name of the current channel.
This channel's name is {channelName}
This channel's name is test-channel
{channelName;<channel>;[quiet]}
Returns the name of the given channel
. If it cannot be found returns No channel found
, or nothing if quiet
is true
.
{channelName;111111111111111}
cooler-test-channel
The position is the index per channel type (text, voice or category) in the channel list.
{channelPosition}
Returns the position of the current channel.
This channel is in position {channelPosition}
This channel is in position 1
{channelPosition;<channel>;[quiet]}
Returns the position of the given channel
. If it cannot be found returns No channel found
, or nothing if quiet
is true
.
The position of test-channel is {channelPosition;test-channel}
The position of test-channel is 0
{channels}
Returns an array of channel ids in the current guild
This guild has {length;{channels}} channels.
This guild has {length;{channels}} channels.
{channels;<category>;[quiet]}
Returns an array of channel ids in within the given category
. If category
is not a category, returns an empty array. If category
cannot be found returns No channel found
, or nothing if quiet
is true
.
Category cat-channels has {length;{channels;cat-channels}} channels.
Category cat-channels has 6 channels.
{channelSetPermissions;<channel>;<type>;<memberid|roleid>}
Deletes the permission overwrites of memberId|roleId
in channel
.
Returns the channel’s id.
{channelSetPermissions;11111111111111111;member;222222222222222222}
11111111111111111
{channelSetPermissions;<channel>;<type>;<memberid|roleid>;<allow>;[deny]}
Sets the permissions of a member
or role
in channel
type
is either member
or role
, and memberId|roleId
corresponds to the id of the member or role.
Provide allow
and deny
as numbers, which can be calculated here. Returns the channel’s id.
{channelSetPermissions;11111111111111111;member;222222222222222222;1024;2048}
11111111111111111
{channelSetPosition;<channel>;<position>}
Moves a channel to the provided position.
{channelSetPosition;11111111111111111;5}
Possible results: text
, dm
, voice
, group-dm
, category
, news
, store
, news-thread
, public-thread
, private-thread
, stage-voice
{channelType}
Returns the type the current channel.
{channelType}
text
{channelType;<channel>;[quiet]}
Returns the type the given channel
. If it cannot be found returns No channel found
, or nothing if quiet
is true
.
{channelType;cool channel}
{channelType;some channel that doesn't exist;true}
voice
(nothing is returned here)
Returns nothing if the channel doesn’t have any messages.
{lastMessageId}
Returns the messageId of the last message in the current channel.
{lastMessageId}
1111111111111111
{lastMessageId;<channel>}
Returns the messageId of the last message in channel
.
{lastMessageId;1111111111111111}
2222222222222222
{slowMode}
Removes slow mode for the current channel.
{slowMode}
(slow mode is now disabled)
{slowMode;<channel>}
Removes slow mode for the given channel
{slowMode;testing-grounds}
(disabled slow mode in testing-grounds)
{slowMode;<time>}
Enables slow mode in the current channel and set the cooldown to time
.
{slowMode;10}
(set slow mode to 10 seconds)
{slowMode;<channel>;<time>}
time
defaults to 0
if left blank.
Enables slow mode in channel
and set the cooldown to time
.
{slowMode;testing-grounds;10}
{slowMode;50;doesn't matter}
(set slow mode cooldown to 10 seconds in testing-grounds)
(set slow mode to 50s in the current channel)
daysToDelete
is the number of days to delete messages for. duration
{ban;<user>;[daysToDelete]}
daysToDelete
defaults to 1
if omitted or left blank.
Bans user
. If the ban is successful true
will be returned, else it will return an error.
{ban;Stupid cat;4}
true
{ban;<user>;<daysToDelete>;<reason>;[timeToUnban]}
daysToDelete
defaults to 1
if left blank.
Bans user
for duration timeToUnban
with reason
.
{ban;Stupid cat;;Not clicking enough kittens;30d}
true (stupid cat will be unbanned after 30d)
{ban;<user>;<daysToDelete>;<reason>;<timeToUnban>;<noPerms>}
daysToDelete
defaults to 1
if left blank.
Bans user
for duration timeToUnban
with reason
. If noPerms
is provided and not an empty string, do not check if the command executor is actually able to ban people.Only provide this if you know what you’re doing.
{ban;Stupid cat;;For being stupid;;anythingcangohere}
true (anyone can use this cc regardless of perms)
{dm;<user>;<message>}
DMs user
the given message
. You may only send one DM per execution. Requires author to be staff, and the user to be on the current guild.
{dm;stupid cat;Hello;{embedBuild;title:You're cool}}
DM: Hello
Embed: You're cool
{dm;<user>;<embed>}
DMs user
the given embed
. You may only send one DM per execution. Requires author to be staff, and the user to be on the current guild.
Please note that embed
is the JSON for an embed object, don’t put the {embed}
subtag there, as nothing will show.
{dm;stupid cat;Hello;{embedBuild;title:You're cool}}
DM: Hello
Embed: You're cool
{dm;<user>;<message>;<embed>}
DMs user
the given message
and embed
. You may only send one DM per execution. Requires author to be staff, and the user to be on the current guild.
Please note that embed
is the JSON for an embed object, don’t put the {embed}
subtag there, as nothing will show.
{dm;stupid cat;Hello;{embedBuild;title:You're cool}}
DM: Hello
Embed: You're cool
{isStaff}
Checks if the tag author is staff
{if;{isStaff};The author is a staff member!;The author is not a staff member :(}
The author is a staff member!
{isStaff;<user>;[quiet]}
Checks if user
is a member of staff. If the user
cannot be found false
will be returned.
{if;{isStaff;{userId}};You are a staff member!;You are not a staff member :(}
You are not a staff member :(
{isUserBoosting}
Returns true
if the executing user is boosting the guild and false
if not.
{if;{isUserBoosting};Yes you are boosting;You should consider boosting}
You should consider boosting
{isUserBoosting;<user>;[quiet]}
Returns true
if the user
is boosting the guild and false
if not. If quiet
is specified, if user
can’t be found it will simply return nothing.
{if;{isUserBoosting;stupid cat};stupid cat is boosting!; no boosting here :(}
stupid cat is boosting!
If the kick is successful, Success
will be returned, otherwise the error will be given.
{kick;<user>}
Kicks user
.
{kick;stupid cat} @stupid cat was kicked!
Success @stupid cat was kicked!
{kick;<user>;<reason>;[noPerms]}
Kicks user
. If noPerms
is provided and not an empty string, do not check if the command executor is actually able to kick people. Only provide this if you know what you’re doing.
{kick;stupid cat;because I can} @stupid cat was kicked!
Success @stupid cat was kicked, because I can!
user
defaults to the executing user. Returns the new warning count
{pardon;[user]}
Gives user
one pardon.
Be pardoned! {pardon}
Be pardoned! 0
{pardon;<user>;<count>;[reason]}
count
defaults to 1
if left blank.
Gives user
count
pardons with reason
.
Be pardoned 9001 times, Stupid cat! {pardon;Stupid cat;9001}
Be pardoned 9001 times, Stupid cat! 0
{randomUser}
Returns the id of a random user on the current guild.
{username;{randomUser}} is a lovely person! {username;{randomUser}} isn't as good.
abalabahaha is a lovely person! stupid cat isn't as good.
If the timeout is successful, Success
will be returned, otherwise the error will be given.
{timeout;<user>;<duration>}
Times out user
for the specified amount of time. Maximum is 28 days.
{timeout;stupid cat;1d} @stupid cat was timed out for 1 day!
Success @stupid cat was timed out for 1 day!
{timeout;<user>;<duration>;<reason>;[noPerms]}
Times out user
for the specified amount of time. Maximum is 28 days.If noPerms
is provided and not an empty string, do not check if the command executor is actually able to time out people. Only provide this if you know what you’re doing.
{timeout;stupid cat;1d;because I can} @stupid cat was timed out for 1 day!
Success @stupid cat was timed out for 1 day, because I can!
{unban;<user>}
Unbans user
.
{unban;@user} @user was unbanned!
@user was unbanned!
{unban;<user>;<reason>;[noPerms]}
Unbans user
with the given reason
.If noPerms
is provided and not an empty string, do not check if the command executor is actually able to ban people. Only provide this if you know what you’re doing.
{unban;@stupid cat;I made a mistake} @stupid cat has been unbanned
true @stupid cat has been unbanned
If no game is being played, this will return ‘nothing’
{userActivity}
Returns the name of the activity the executing user is currently doing.
You are listening to {userActivity}
You are listening to bad music
{userActivity;<user>;[quiet]}
Returns the name of the activity user
is currently doing. If user
can’t be found it will simply return nothing.
Stupid cat is playing {userActivity;Stupid cat}
Stupid cat is playing nothing
Activity types can be any of playing
, streaming
, listening
, watching
, custom
, competing
or ``
{userActivityType}
Returns the type of activity the executing user is currently doing (playing, streaming).
You are {userActivityType} right now!
You are streaming right now!
{userActivityType;<user>;[quiet]}
Returns the activity type user
is currently doing. If quiet
is specified, if user
can’t be found it will simply return nothing.
Stupid cat is {userActivityType;Stupid cat} cats
Stupid cat is streaming cats
If no game is being played, this will return ‘nothing’
{userAvatar}
Returns the avatar of the executing user.
Your avatar is {userAvatar}
Your avatar is (avatar url)
{userAvatar;<user>;[quiet]}
Returns the avatar of user
. If user
can’t be found it will simply return nothing.
Stupid cat's avatar is {userAvatar;Stupid cat}
Stupid cat's avatar is (avatar url)
See the moment documentation for more information about formats. If user is not boosting the guild, returns User not boosting
{userBoostDate;[format]}
format
defaults to YYYY-MM-DDTHH:mm:ssZ
if omitted or left blank.
Returns the date that the executing user started boosting the guild using format
for the output, in UTC+0.
Your account started boosting this guild on {userBoostDate;YYYY/MM/DD HH:mm:ss}
Your account started boosting this guild on 2020/02/27 00:00:00
{userBoostDate;<format>;<user>;[quiet]}
format
defaults to YYYY-MM-DDTHH:mm:ssZ
if left blank.
Returns the date that user
started boosting the current guild using format
for the output, in UTC+0. If quiet
is specified, if user
can’t be found it will simply return nothing.
Stupid cat started boosting this guild on {userBoostDate;YYYY/MM/DD HH:mm:ss;stupid cat}
Stupid cat started boosting this guild on 2020/02/27 00:00:00
{userCreatedAt;[format]}
format
defaults to YYYY-MM-DDTHH:mm:ssZ
if omitted or left blank.
Returns the account creation date of the executing user in format
.
Your account was created on {userCreatedAt}
Your account was created on 2017-02-06T18:58:10+00:00
{userCreatedAt;<format>;<user>;[quiet]}
format
defaults to YYYY-MM-DDTHH:mm:ssZ
if left blank.
Returns the account creation date of user
in format
. If quiet
is specified, if user
can’t be found it will simply return nothing.
Stupid cat's account was created on {userCreatedAt;;Stupid cat}
Stupid cat's account was created on 2015-10-13T04:27:26Z
If no game is being played, this will return ‘nothing’
{userDiscriminator}
Returns the discriminator of the executing user.
Your discriminator is {userDiscriminator}
Your discriminator is 1234
{userDiscriminator;<user>;[quiet]}
Returns user
‘s discriminator. If user
can’t be found it will simply return nothing.
Stupid cat's discriminator is {userDiscriminator;Stupid cat}
Stupid cat's discriminator is 8160
This subtag checks if a user has any of the provided roleIds
. Use {userHasRoles}
to check if a user has all of the provided roleIds
. roleIds
can be an array of role ids, or a single role id. For a list of roles and their corresponding ids, use b!roles
Returns a boolean.
{userHasRole;<roleids>}
Checks if the executing user has any of the provided roleIds
.
{if;{userHasRole;{roleId;moderator}};You are a moderator; You are not a moderator}
You are a moderator
{userHasRole;<roleids>;<user>;[quiet]}
Checks if user
has any of the provided roleIds
. If quiet
is specified, if user
or any roleId
can’t be found it will simply return false
.
{if;{userHasRole;{userId;moderator};Stupid cat};Stupid cat is a moderator;Stupid cat is not a moderator}
Stupid cat is a moderator
This subtag checks if a user has all of the provided roleIds
. Use {userHasRole}
to check if a user has any of the provided roleIds
. roleIds
can be an array of role ids, or a single role id. For a list of roles and their corresponding ids, use b!roles
Returns a boolean.
{userHasRoles;<roleIds>}
Checks if the executing user has all of the provided roleIds
.
{if;{userHasRoles;["{roleId;moderator}","{roleId;admin}"];You are a moderator and admin; You are not a moderator and admin}
You are not a moderator and admin
{userHasRoles;<roleIds>;<user>;[quiet]}
Checks if user
has all of the provided roleIds
. If quiet
is specified, if user
or any roleId
can’t be found it will simply return false
.
{if;{userHasRoles;["{roleId;moderator}","{roleId;admin}"];Stupid cat};Stupid cat is a moderator and admin;Stupid cat is not a moderator and admin}
Stupid cat is a moderator and admin
{userId}
Returns the user id of the executing user.
Your id is {userId}
Your id is 123456789123456
{userId;<user>;[quiet]}
Returns user
‘s id. If quiet
is specified, if user
can’t be found it will simply return nothing.
This is Stupid cat's user id {userId;Stupid cat}
This is Stupid cat's user id 103347843934212096
{userIsBot}
Returns whether the executing user is a bot.
Are you a bot? {userIsBot}
Are you a bot? false
{userIsBot;<user>;[quiet]}
Returns whether a user
is a bot. If quiet
is specified, if user
can’t be found it will simply return nothing.
Is Stupid cat a bot? {userIsBot;Stupid cat}
Is Stupid cat a bot? false
For a list of formats see the moment documentation for more information.
{userJoinedAt;[format]}
format
defaults to YYYY-MM-DDTHH:mm:ssZ
if omitted or left blank.
Returns the date that the executing user joined the guild, using format
for the output, in UTC+0.
Your account joined this guild on {userJoinedAt;YYYY/MM/DD HH:mm:ss}
Your account joined this guild on 2016/01/01 01:00:00.
{userJoinedAt;<format>;<user>;[quiet]}
format
defaults to YYYY-MM-DDTHH:mm:ssZ
if left blank.
Returns the date that user
joined the current guild using format
for the output, in UTC+0. if user
can’t be found it will simply return nothing.
Stupid cat joined this guild on {userJoinedAt;YYYY/MM/DD HH:mm:ss;Stupid cat}
Stupid cat joined this guild on 2016/06/19 23:30:30
{userMention}
Mentions the executing user.
Hello, {userMention}!
Hello, @user!
{userMention;<user>;[quiet];[noPing]}
noPing
defaults to false
if omitted or left blank.
Mentions user
. If quiet
is specified, if user
can’t be found it will simply return nothing.
Hello, {userMention;stupid cat}!
Hello, @Stupid cat!
{userName}
Returns the username of the executing user.
Your username is {userName}!
Your username is Cool Dude 1337!
{userName;<user>;[quiet]}
Returns user
‘s username. If quiet
is specified, if user
can’t be found it will simply return nothing.
Stupid cat's username is {userName;Stupid cat}!
Stupid cat's username is Stupid cat!
{userNickname}
Returns the nickname of the executing user.
Your nick is {userNickname}!
Your nick is Cool Dude 1337!
{userNickname;<user>;[quiet]}
Returns user
‘s nickname. If quiet
is specified, if user
can’t be found it will simply return nothing.
Stupid cat's nickname is {userNickname;Stupid cat}!
Stupid cat's nickname is Secretly Awoken
{userRoles}
Returns the roles of the executing user.
Your roles are {userRoles}!
Your roles are ["1111111111111111","2222222222222222"]!
{userRoles;<user>;[quiet]}
Returns user
‘s roles as an array. If quiet
is specified, if user
can’t be found it will simply return nothing.
Stupid cat's roles are {userRoles;stupid cat}
Stupid cat's roles are ["1111111111111111","2222222222222222", "3333333333333333"]
{userSetNickname;<nick>;[user]}
Sets user
‘s nickname to nick
. Leave nick
blank to reset their nickname.
{userSetNickname;super cool nickname}
{//;Reset the the nickname}
{userSetNickname;}
roleArray
must be an array formatted like ["role1", "role2"]
{userSetRoles;[roleArray]}
Sets the roles of the current user to roleArray
.
{userSetRoles;["1111111111111"]}
true
{userSetRoles;<roleArray>;<user>;[quiet]}
Sets the roles of user
to roleArray
. If quiet is provided, all errors will return false
.
{userSetRoles;["1111111111111"];stupid cat}
true
Returned status can be one of online
, idle
, dnd
or offline
{userStatus}
Returns the status of the user.
You are currently {userStatus}
You are currently online
{userStatus;<user>;[quiet]}
Returns the status of user
. If quiet
is specified, if user
can’t be found it will simply return nothing.
Stupid cat is currently {userStatus;stupid cat}
Stupid cat is currently online
See the moment documentation for more information about formats. If user has never been timed out in the guild, returns User not timed out
{userTimeout;[format]}
format
defaults to YYYY-MM-DDTHH:mm:ssZ
if omitted or left blank.
Returns the executing user’s timeout date using format
for the output, in UTC+0.
You have been timed out until {userTimeout;YYYY/MM/DD HH:mm:ss}
You have been timed out until 2021/01/01 00:00:00
{userTimeout;[format];<user>;[quiet]}
format
defaults to YYYY-MM-DDTHH:mm:ssZ
if omitted or left blank.
Returns a user
‘s timeout date using format
for the output, in UTC+0. If quiet
is specified, if user
can’t be found it will simply return nothing.
stupid cat is timed out until {userTimeout;YYYY/MM/DD HH:mm:ss;stupid cat}
stupid cat is timed out until 2021/01/01 00:00:00
{userTimeZone}
Returns the set timezone of the user executing the containing tag.
{userTimeZone}
UTC
{userTimeZone;<user>;[quiet]}
Returns the set timezone code of the specified user
. If quiet
is specified, if user
can’t be found it will simply return nothing.If the user has no set timezone, the output will be UTC.
Discord official's timezone is {userTimeZone;Discord official}
Discord official's timezone is Europe/Berlin
user
defaults to the executing user.
{warn;[user]}
Gives user
one warning. This will return the amount of warnings user
has after executing.
Be warned! {warn}
Be warned! 1
{warn;<user>;<count>;[reason]}
count
defaults to 1
if left blank.
Gives user
count
warnings.
Be warned Stupid cat! {warn;Stupid cat;9001;For being too cool}
Be warned Stupid cat! 9001
{warnings;[user];[quiet]}
Gets the number of warnings user
has. user
defaults to the user who executed the containing tag.
You have {warnings} warning(s)!
You have 0 warning(s)!
role
can be either a roleId or role mention.
{roleAdd;<role>}
Gives the executing user role
. Returns true
if role was given, else an error will be shown.
Have a role! {roleAdd;11111111111111111}
Have a role! true
{roleAdd;<role>;<user>;[quiet]}
Gives user
the chosen role
. Returns true
if role was given, else an error will be shown. If quiet
is specified, if a user can’t be found it will simply return false
Stupid cat have a role! {roleAdd;Bot;Stupid cat}
Stupid cat have a role! true
{roleColor;<role>;[quiet]}
Returns role
‘s hex color code. If quiet
is specified, if role
can’t be found it will simply return nothing.
The admin role color is: #{roleColor;admin}.
The admin role id is: #1b1b1b.
{roleCreate;<name>;[color];[permissions];[mentionable];[hoisted]}
color
defaults to 000000
if omitted or left blank.permissions
defaults to 0
if omitted or left blank.mentionable
defaults to false
if omitted or left blank.hoisted
defaults to false
if omitted or left blank.
color
can be a HTML color, hex, (r,g,b) or a valid color number. Provide permissions
as a number, which can be calculated here hoisted
is if the role should be displayed separately from other roles.
Returns the new role’s id.
{roleCreate;myNewRole;red}
1298731238361728931
{roleDelete;<role>;[quiet]}
Deletes role
. If quiet
is specified, if role
can’t be found it will return nothing.
Warning: this subtag is able to delete roles managed by integrations.
{roleDelete;Super Cool Role!}
(rip no more super cool roles for anyone)
{roleId;<role>;[quiet]}
Returns role
‘s id. If quiet
is specified, if role
can’t be found it will simply return nothing.
The admin role id is: {roleId;admin}.
The admin role id is: 123456789123456.
{roleMembers;<role>;[quiet]}
Returns an array of members in role
. If quiet
is specified, if role
can’t be found it will simply return nothing.
The admins are: {roleMembers;Admin}.
The admins are: ["11111111111111111","22222222222222222"].
{roleMention;<role>;[quiet];[noPing]}
noPing
defaults to false
if omitted or left blank.
Returns a mention of role
. If quiet
is specified, if role
can’t be found it will simply return nothing.
The admin role will be mentioned: {roleMention;Admin}
The admin role will be mentioned: @Administrator
{roleName;<role>;[quiet]}
Returns role
‘s name. If quiet
is specified, if role
can’t be found it will simply return nothing.
The admin role name is: {roleName;admin}.
The admin role name is: Administrator.
{rolePermissions;<role>;[quiet]}
Returns role
‘s permission number. If quiet
is specified, if role
can’t be found it will simply return nothing.
The admin role's permissions are: {rolePermissions;admin}.
The admin role's permissions are: 8.
{rolePosition;<role>;[quiet]}
Returns the position of role
. If quiet
is specified, if role
can’t be found it will simply return nothing.
Note: the highest role will have the highest position, and the lowest role will have the lowest position and therefore return 0
(@everyone
).
The position of Mayor is {rolePosition;Mayor}
The position of Mayor is 10
role
can be either a roleId or role mention.
{roleRemove;<role>}
Removes role
from the executing user. Returns true
if role was removed, else an error will be shown.
No more role! {roleRemove;11111111111111111}
No more role! true
{roleRemove;<role>;<user>;[quiet]}
Remove the chosen role
from user
. Returns true
if role was removed, else an error will be shown. If quiet
is specified, if a user can’t be found it will simply return false
Stupid cat no more role! {roleRemove;Bot;Stupid cat}
Stupid cat no more role! true
{roles}
Returns an array of roles on the current guild.
The roles on this guild are: {roles}.
The roles on this guild are: ["11111111111111111","22222222222222222"].
{roles;<user>;[quiet]}
Returns user
‘s roles in the current guild. If quiet
is specified, if user
can’t be found it will simply return nothing.
Stupid cat has the roles: {roles;Stupid cat}
Stupid cat has the roles: ["11111111111111111","22222222222222222"]
{roleSetColor;<role>}
Sets the color of role
to ‘#000000’. This is transparent.
The admin role is now colourless. {roleSetColor;admin}
The admin role is now colourless.
{roleSetColor;<role>;<color>;[quiet]}
Sets the color
of role
.If quiet
is specified, if role
can’t be found it will simply return nothing
The admin role is now white. {roleSetColor;admin;white}
The admin role is now white.
{roleSetMentionable;<role>}
Set role
to mentionable.
The admin role is now mentionable. {roleSetMentionable;admin}
The admin role is now mentionable.
{roleSetMentionable;<role>;<value>;[quiet]}
value
defaults to true
if left blank.
Sets whether role
can be mentioned. value
can be either true
to set the role as mentionable, or anything else to set it to unmentionable. If quiet
is specified, if role
can’t be found it will simply return nothing
The admin role is no longer mentionable. {roleSetMentionable;admin;false}
The admin role is no longer mentionable.
{roleSetName;<role>;<name>;[quiet]}
Sets the name of role
.If quiet
is specified, if role
can’t be found it will simply return nothing
The admin role is now called administrator. {roleSetName;admin;administrator}
The admin role is now called administrator.
{roleSetPermissions;<role>}
Removes all perms from role
{roleSetPermissions;Support}
(perms have been changed)
{roleSetPermissions;<role>;<permissions>;[quiet]}
permissions
defaults to 0
if left blank.
Sets the permissions of role
with the provided permissions
number. This will not apply any permissions the authorizer can’t grant. Additionally, this will completely overwrite the role’s existing permissions. If quiet
is specified, if role
can’t be found it will simply return nothing
The admin role now has the administrator permission. {roleSetPermissions;admin;8}
The admin role now has the administrator permission.
{roleSetPosition;<role>;<position>;[quiet]}
Sets the position of role
. If quiet
is specified, if role
can’t be found it will simply return nothing.
The admin role is now at position 3. {roleSetPosition;admin;3}
The admin role is now at position 3.
{roleSize;<role>}
Returns the amount of people in role role
There are {roleSize;11111111111111111} people in the role!
There are 5 people in the role!
{emojiCreate;<name>;<image>;[roles]}
Creates a emoji with the given name and image. image
is either a link to an image, or a base64 encoded data url (data:<content-type>;base64,<base64-data>
). You may need to use {semi} for the latter.roles
, if provided, will restrict the emoji’s usage to the specified roles. Must be an array of roles.Returns the new emojis’s id.
{emojiCreate;fancy_emote;https://some.cool/image.png;["Cool gang"]}
11111111111111111
{emojiDelete;<id>}
Deletes an emoji with the provided id
{emojiDelete;11111111111111111}
Please note that Discord will remove all the emojis from a message which contains an emoji that blargbot can’t use. For example, blargbot can’t use a role-restricted emoji if it doesn’t have the role. Learn more here.
{emojis}
Returns an array of emojis in the current guild.
This guild has {length;{emojis}} emojis.
This guild has 23 emojis.
{emojis;<role>}
Returns an array of emojis whitelisted for the provided role
Cool gang has {length;{emojis;Cool gang}} emojis.
Cool gang has 6 emojis.
{guildBans}
Returns an array of banned users in the current guild.
This guild has {length;{guildBans}} banned users.
This guild has 123 banned users.
{guildCreatedAt;[format]}
Returns the date the current guild was created, in UTC+0. If a format
code is specified, the date is formatted accordingly. Leave blank for default formatting. See the moment documentation for more information.
This guild was created on {guildCreatedAt;YYYY/MM/DD HH:mm:ss}
This guild was created on 2016/01/01 01:00:00
{guildFeatures}
Returns an array of guild feature strings. For a full list click this link.
{guildFeatures}
["COMMUNITY","COMMERCE","NEWS","PREVIEW_ENABLED","WELCOME_SCREEN_ENABLED","MEMBER_VERIFICATION_GATE_ENABLED","THREADS_ENABLED"]
{guildIcon}
Returns the icon of the current guild. If it doesn’t exist returns nothing.
The guild's icon is {guildIcon}
The guild's icon is (icon url)
{guildId}
Returns the id of the current guild.
The guild's id is {guildId}
The guild's id is 1234567890123456
{guildMembers}
Returns an array of user ids of the members on the current guild.
This guild has {length;{guildMembers}} members.
This guild has 123 members.
{guildName}
Returns the name of the current guild.
This guild's name is {guildName}.
This guild's name is TestGuild.
{guildOwnerId}
Returns the id of the guild’s owner.
The owner's id is {guildOwnerId}.
The owner's id is 1234567890123456.
{guildSetIcon;<image>}
Updates the current guild’s icon with the provided image. image
is either a link to an image, or a base64 encoded data url (data:<content-type>;base64,<base64-data>
). You may need to use {semi} for the latter.
{guildSetIcon;https://some.cool/image.png}
{guildSize}
Returns the number of members on the current guild.
This guild has {guildSize} members.
This guild has 123 members.