Make a bot for Roar
Bots welcome people, answer commands, run games and keep servers tidy. Make one without writing code, or code your own in a few lines of JavaScript.
import { Bot } from "roar.js";
const bot = new Bot({ token: process.env.ROAR_TOKEN });
// Someone says !ping: answer them.
bot.on("message", async (msg) => {
if (msg.content === "!ping") await msg.reply("Pong! ๐");
});
// A slash command: /roll
bot.command("roll", "Roll a die", (i) => {
const n = 1 + Math.floor(Math.random() * 6);
return i.reply(`๐ฒ You rolled **${n}**`);
});
bot.start();Three ways
Pick how you want to build โ you can switch later.
Bot Builder No code
Click a bot together in the Roar desktop app: rules like "when someone says good morning, reply". Runs while Roar is open.
- Slash commands and keyword replies
- Welcome messages and auto-roles
- Timed messages
Roar.js JavaScript
Our bot framework: one file, no dependencies. Events, slash commands, embeds, files, roles, DMs. Your bot can do anything.
- Works with Node.js 22+, Deno and Bun
- Autocomplete in VS Code
- Reconnects by itself
Webhooks One link
Post into a channel from any program, script or website with a single web request. No bot account and nothing to keep running.
- Build alerts and game updates
- A custom name and picture per post
- Works from curl, Python, anything
How it fits together
A bot is a program that listens and acts.
Your bot signs in with its own account. Roar tells it what happens (a message, a new member, someone using /roll) and the bot answers by sending messages, reacting or giving roles. How bots work โ
Ready-made
Bots you don't have to make.
Every node comes with two verified bots. Add them from Server Settings โ Bots in one click.
Welcomer
Greets new members in a channel or by DM, and can give them a role. You write the message: Welcome to {server}, {user}!
Levels
Gives XP for chatting, announces level-ups, and answers /rank and /leaderboard.
Examples to copy
Dice, reaction roles, a welcomer, server info cards, reminders and a webhook script, all ready to run.
See the examples โQuestions
Good to know
Do I need to know how to code?
No. Bot Builder makes bots from rules you click together in the desktop app. When you want more, Roar.js takes a few lines of JavaScript, and the first-bot guide walks you through every step.
Does it cost anything?
Making bots with Roar.js and webhooks is free. Bot Builder is a Roar Plus perk. Your bot runs on your own computer (or any server you have), so there's nothing to pay Roar for.
Where does my bot run?
On whatever computer runs its code: your PC while you test, then something that stays on, like a spare PC, a Raspberry Pi or a small server. When the program stops, the bot goes offline. A Bot Builder bot runs inside your Roar app while it's open.
Can I use a Discord bot library?
Not as is. Roar's API is shaped like Discord's, but the addresses, the connection and some details differ (there are no intents, buttons or RESUME). The differences are listed here. Roar.js is made for Roar and feels familiar if you know discord.js.
Can bots work on other nodes, not just the official one?
Yes. Anyone can host a Roar node, and a bot can join any node it has an account on: give Roar.js the node's id or address. Which node โ