Public
NexusEconomy Discord bot — economy system with slash commands
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

💰 NexusEconomy Discord Bot

A full-featured economy bot for your Discord server, using the n! prefix.

Commands

CommandDescription
n!bal [@user]Check your or someone's balance
n!dailyClaim daily reward (24h cooldown, streak bonus)
n!workWork a random job for coins (1h cooldown)
n!give @user amountTransfer coins to another user
n!dep amountMove coins from wallet → bank
n!with amountMove coins from bank → wallet
n!lbTop 10 richest members
n!helpShow all commands

How It Works

The bot polls your Discord server every 15 minutes for new messages (free tier minimum). When it finds messages starting with n!, it processes the command and replies.

Rendering mermaid diagram...

⚠️ Note: Because Val Town's free tier polls every 15 minutes, responses are not instant. Upgrade to Pro for 1-minute polling.

Setup Guide

1. Create a Discord Application

  1. Go to Discord Developer Portal
  2. Click New Application → name it NexusEconomy

2. Create a Bot

  1. Go to the Bot tab → click Reset Token → copy the token
  2. Enable MESSAGE CONTENT INTENT and SERVER MEMBERS INTENT

3. Invite the Bot

  1. Go to OAuth2 → URL Generator
  2. Select scopes: bot
  3. Select permissions: Send Messages, Read Message History, View Channels
  4. Copy the URL and open it to invite the bot to your server

4. Set Environment Variables

Add these to the val's environment variables:

  • DISCORD_BOT_TOKEN — the bot token
  • DISCORD_GUILD_ID — your Discord server ID

5. Done!

The bot will start polling automatically. Type n!help in any channel!

Tech Stack

  • Runtime: Val Town (Deno)
  • Database: Val Town SQLite (persistent)
  • Polling: Interval val (every 15 min on free tier)
  • API: Discord REST API v10