Functions

Language basics Templates

Who and where

  • $username Name of the person who used the command. In events, the person who wrote, joined, left, was banned or reacted. Empty in scheduled commands and in the ready and bot added events.
  • $userID ID of the person who used the command: a long number that never changes. Use it wherever another function asks for a user. Empty in scheduled commands.
  • $mention Mentions the person who used the command, so they get notified. Empty in scheduled commands.
  • $serverName Name of this server.
  • $memberCount How many members this server has.
  • $channelName[channel?] Name of the channel the answer goes to, or of another channel. Join and leave events answer in the server's system channel.
  • $message[word number?] Everything typed after the command, or just one word of it. In the message event, the whole message.
  • $messageFrom[word number] Everything typed after the command, starting at this word. Handy for a reason after a mention. In the message event, the message from this word on.
  • $messageWordCount How many words were typed after the command. In the message event, how many words the message has.

Answer

  • $reply Sends the answer as a reply to the command message, so everyone sees what it answers.
  • $react[emoji] Adds a reaction to the bot's answer.
  • $deleteCommand Deletes the message that started the command, so only the answer stays.
  • $answerAs[name;avatar url?] Sends the answer under another name and picture. The bot needs the Manage Webhooks permission. Names that look like staff or the server owner are refused.

Embed

Messages

Members

Moderation

Channels and roles

  • $createChannel[name;type?;topic?;category?] Creates a channel and returns its ID. The bot and the member using the command need the Manage Channels permission.
  • $deleteChannel[channel] Deletes a channel with all its messages. This cannot be undone. The bot and the member using the command need the Manage Channels permission.
  • $createRole[name;color?;separate?;mentionable?] Creates a role and returns its ID. The bot and the member using the command need the Manage Roles permission.
  • $deleteRole[role] Deletes a role from the server. This cannot be undone. The bot and the member using the command need a role above it and the Manage Roles permission.

Variables

  • $getVar[name;id?] Reads a saved value, like someone's coins.
  • $setVar[name;value;id?] Saves a new value in a variable. It stays saved after the command ends.
  • $addVar[name;amount;id?] Adds a number to a saved number. Use a minus amount to take some away.
  • $resetVar[name;id?] Deletes a saved value, so the variable is back to its starting value.
  • $leaderboard[name;count?;format?] The people on this server with the highest values, one per line. Needs a variable saved per user.
  • $rank[name;user?] The place of a user on the leaderboard of a variable. 0 if their value is not a number.
  • $let[name;value] Keeps a value while the command runs, so you can use it again further down with $get. Nothing is saved and you do not need to add a variable for it.
  • $get[name] Reads a value that $let kept earlier in this run of the command.

Rules

Logic

  • $if[condition] Runs the lines below only when the condition is true. End the block with $endif.
  • $elseif[condition] Inside an $if block: another condition, checked only when the ones above were false.
  • $else Inside an $if block: runs the lines below when no condition above was true.
  • $endif Ends an $if block. Every $if needs one.
  • $stop Ends the command right here. Nothing below it runs.
  • $try Starts a safe block. If something in it fails, the command goes on at $catch instead of stopping with an error.
  • $catch Inside a $try block: runs the lines below only if something above failed.
  • $endtry Ends a $try block. Every $try needs one.
  • $error Inside $catch: what went wrong in the $try block.
  • $comment[text] A note for yourself. It never runs and nobody sees it.
  • $and[condition;condition...] true if all conditions are true, otherwise false.
  • $or[condition;condition...] true if at least one condition is true, otherwise false.
  • $not[condition] Turns true into false and false into true.
  • $sameText[text;text] true if both texts are the same, ignoring capital letters and spaces around them.

Loops

  • $loop[times] Runs the lines below several times in a row. End the block with $endloop.
  • $endloop Ends a $loop block. Every $loop needs one.
  • $loopIndex Inside $loop or $while: which round it is, counted from 1.
  • $while[condition] Runs the lines below again and again, as long as the condition is true. End the block with $endwhile.
  • $endwhile Ends a $while block. Every $while needs one.
  • $forEach[list;separator?] Runs the lines below once for every item of a list. $item is the item of the current round. End the block with $endforEach.
  • $endforEach Ends a $forEach block. Every $forEach needs one.
  • $item Inside $forEach: the item of the list this round is about.
  • $itemIndex Inside $forEach: where the current item is in the list, counted from 1.
  • $break Inside a loop: ends the loop right here. The command goes on below the end of the loop.
  • $continue Inside a loop: skips the rest of this round and goes on with the next one.
  • $wait[time] Pauses the command for a moment, at most 10 seconds. The whole command still has to finish within 10 seconds.

Text

Numbers

Lists

Time

Server

Bot

  • $botName The name of the bot.
  • $botID The ID of the bot. Use it to mention the bot or to check if a message is from the bot.
  • $uptime[format?] How long the bot has been online since it last connected to Fluxer, like 3h 25m 12s.
  • $serverCount How many servers the bot is in.
  • $log[text;level?] Writes a line into the bot's log on the Logs page, so you can see what a command did. A command can write up to 5 lines per run.
  • $setStatus[status] Changes the bot's online status for everyone. It stays until it is changed again or the bot restarts.
  • $setActivity[text;emoji?] Sets the custom status shown under the bot's name. Leave the text and emoji empty to remove it.

Events

  • $reactionEmoji The emoji someone reacted with. Works in reaction events and after $waitForReaction.
  • $oldText In the message edited event: the text before the edit. Empty if the message was older than the bot.
  • $newText In the message edited event: the text after the edit.
  • $deletedText In the message deleted event: the text of the deleted message, if Fluxer still had it.
  • $awaitedMessage In an awaited command: the text of the answer the bot waited for.
  • $reactToCommand[emoji] Adds a reaction to the message that started this, like the command message or the edited message.

Waiting for answers

Schedules

Web

Files

  • $attachFile[link or file;file name?] Sends a file with the answer, up to 8 MB. The file comes from a link or from the Files page of your bot. Each link counts as a web request.
  • $fileText[file name] The text of a TXT, MD, CSV or JSON file you uploaded on the Files page of your bot. Use it with $jsonValue to read data from a JSON file.
  • $attachmentCount How many files are attached to the message that started the command.
  • $attachmentURL[number?] The link to a file attached to the message that started the command. Empty when there is no such file.
  • $attachmentName[number?] The name of a file attached to the message that started the command. Empty when there is no such file.

Threads