How to build a Voxnup bot (Voxnup Bot Manager v2)
Voxnup bots are written in JavaScript and run in the Voxnup Bot Manager app (Windows and Linux, x64). Steps: 1) get an API key and create a bot on developer.voxnup.com, 2) download and open Bot Manager, 3) type bot new mybot in its console, 4) put your bot_token and api_key in bots/mybot.json, 5) start it with bot start mybot. In chat, /mybot:yardim lists the bot's commands.
Run your first bot
Get an API key on the developer portal
Sign in to developer.voxnup.com with your Voxnup account. On the API Anahtarı (API Key) page, click API Anahtarı Oluştur. You need an API key before you can create bots. Keep it secret; if you think it leaked, use Yenile (Regenerate) on the same page, and the old key stops working. The developer portal is in Turkish only.
Create a bot and copy its token
Botlarım (My Bots) → Yeni Bot (New Bot): a name (3–32 characters), a category and an optional description. After saving, the Bot bağlantı bilgileri (connection details) window shows the API Key and Bot Token. The bot gets its own account on the platform and shows a Voxnup Bot badge next to its name.
Download and open Voxnup Bot Manager
Download the Windows or Linux (x64) zip from the portal's Dokümantasyon (Docs) page, extract it and open the app (
Voxnup.BotManager.exeon Windows,./Voxnup.BotManageron Linux). No installer or .NET needed. The zip also contains a sample bot (bots/ornekbot.js).Create the bot from the template
Type in the app's console:
bot new mybotThis creates
bots/mybot.js(the bot code) andbots/mybot.json(the credentials). Type definitions for the whole API are inbots/voxbot.d.ts, which gives you autocomplete in editors such as VS Code.Put the credentials in the .json file
bots/mybot.json:{ "bot_token": "…", "api_key": "…", "owners": ["<your user key>"] }The API key must belong to the account that owns the bot.
ownersis for owner-only commands. Credentials never go in the.jsfile, so sharing the.jsfile is safe; don't share the.json. You can also use environment variables:VOXNUP_MYBOT_BOT_TOKEN,VOXNUP_MYBOT_API_KEY.Start the bot
Type
bot start mybot. The bot runs in the background and the console stays usable. Check it withbot statusand read its log withbot logs mybot. To try it in a channel, the bot must join that channel like any user, through an invite link; channel roles and permissions apply to bots too.
Example bot
A bot is a JavaScript class that extends VoxBot. This example answers /selamci:zar (or !zar) with a dice roll and replies when it is mentioned:
/// <reference path="./voxbot.d.ts" />
class Selamci extends VoxBot {
constructor() {
super();
this.name = "selamci";
this.prefix = "!"; // "!zar" works too; "/selamci:zar" always works
this.command("zar", { description: "Rolls a die", usage: "[sides]", cooldown: 3 }, (ctx) => {
const n = parseInt(ctx.args[0]) || 6;
ctx.reply(`🎲 ${Math.floor(Math.random() * n) + 1}`);
});
}
onReady() { console.info("ready"); }
onMessage(text, user, roomKey, channelKey, msg) {
if (msg.mentionsMe) msg.reply(`Yes, ${user.displayName}?`);
}
}
globalThis.bot_instance = new Selamci();Every command option, event and method: Bot commands, events and methods.
While developing, use bot watch mybot: the bot reloads every time you save the file.
Frequently asked questions
Does Voxnup have a public API?
Yes. Bots sign in over REST (POST https://voxnup.com/api/v1/login?api_key=… with bot_token in the body) and connect in real time over a secure WebSocket. Voxnup Bot Manager handles this for you; details are in the developer docs.
Which systems does Bot Manager run on?
Windows and Linux (x64). To run it headless on a server: Run a bot 24/7 on a server.
Will my v1 bot still work?
Yes. v1 bots run unchanged, and the old bot activate command is the same as bot start. Moving the credentials from the .js file to the .json file is recommended.
Can a bot talk in a voice room?
No. A bot can join a voice room and moderate (move, deafen, kick from the room), but it can't send audio.
Can a bot access files on my computer?
No. Bot code runs in a sandbox with no access to the file system, the operating system or the local network. For persistent data it uses its own storage (getState / setState).