Kurdishgpt

Here's a solid blueprint for an OwO-style economy bot with canvas-generated image cards.

Tech stack discord.js v14 (or Eris) node-canvas or @napi-rs/canvas (faster) for image rendering MongoDB or SQLite/Postgres for player data node-cron for daily resets/passive income Core economy loop Currency: 2 tiers work well โ€” "coins" (common, earned fast) and "gems" (rare, premium/gacha) daily / weekly โ€” streak bonuses to encourage retention work โ€” random job flavor text + payout, cooldown 30-60min beg โ€” small payout, short cooldown, low risk crime / rob โ€” risk/reward, chance to fail and lose coins or go to "jail" (temporary cooldown lock) gamble / slots / blackjack / coinflip โ€” coin sinks with house edge Progression systems inventory โ€” items, boxes, materials shop / buy / sell โ€” rotating or static shop pets or battle โ€” collectible mechanic with rarity tiers (common โ†’ mythical), driven by canvas-rendered cards craft โ€” combine materials into rare items market / trade โ€” player-to-player trading or auction house Canvas image cards (the OwO-style visual hook) Pet/item pull cards: background by rarity color, sprite image, name, stats overlay profile card: avatar, level bar, balance, badges leaderboard card: top 10 with avatars pulled via loadImage(user.displayAvatarURL()) Cache generated backgrounds/frames as static PNGs, composite dynamic text/avatar on top each call โ€” much faster than redrawing everything Command categories for "full quality" | Category | Examples | |---|---| | Economy | balance, daily, work, rob, gamble, deposit/withdraw (bank) | | Collection | hunt, catch, pets, battle, evolve | | Shop/Items | shop, buy, sell, inventory, use | | Social | profile, leaderboard, marry/trade (optional) | | Utility | help, settings, cooldowns | | Admin | give/take (mod only), reset, config | Anti-abuse essentials Server-side cooldowns (Redis or in-memory Map) โ€” never trust client timing Rate-limit rob/gamble per user Log large transactions for anti-cheat auditing

Kodari AI
KodariAug 1 at 11:25 am 1
KodariEconomyBot
Kodari Economy Bot is an OwO-style Discord economy game with coins, gems, daily streaks, jobs, begging, crime, slots, shops, inventories, player profiles, and leaderboards. It persists account data in SQLite, records transactions for auditing, enforces server-side cooldowns, supports administrator currency management, and generates canvas-based profile and leaderboard cards with avatars, balances, levels, and progression details.
Kurdishgpt

How deployed in host but want a free host

Kodari AI
KodariAug 1 at 11:28 am 1

For a Discord bot, use a host that can run a Node.js process continuously. Static hosting such as GitHub Pages or Netlify will not work.

Best free option: Oracle Cloud Always Free VPS

Oracle provides an always-free virtual machine suitable for a small Discord bot. The setup is more technical, but it supports 24/7 uptime and persistent SQLite data.

1. Create the server

  1. Create an account at cloud.oracle.com.

  2. Create a free Ubuntu instance.

  3. Choose an Always Free shape.

  4. Save the SSH private key.

  5. Copy the serverโ€™s public IP address.

2. Connect through SSH

Shell
ssh ubuntu@YOUR_SERVER_IP

3. Install Node.js and Git

Shell
sudo apt update
sudo apt install -y git curl

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

node --version
npm --version

4. Upload your bot

If your project is on GitHub:

Shell
git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.git
cd YOUR_REPOSITORY
npm install

If it is not on GitHub, upload the project with SCP:

Shell
scp -r ./KodariEconomyBot ubuntu@YOUR_SERVER_IP:/home/ubuntu/

Then connect and run:

Shell
cd KodariEconomyBot
npm install

5. Add your environment variables

Shell
cp .env.example .env
nano .env

Add your Discord token:

Env
DISCORD_TOKEN=your_discord_bot_token
CLIENT_ID=your_application_client_id
GUILD_ID=your_test_server_id

Never put the real token directly into GitHub.

6. Register slash commands

Run the command registration script once:

Shell
npm run register

If your package.json uses a different script name, run the corresponding registration command.

7. Keep the bot online

Install PM2:

Shell
sudo npm install -g pm2

Start the bot:

Shell
pm2 start index.js --name kodari-economy
pm2 save
pm2 startup

Run the command printed by pm2 startup, then check the bot:

Shell
pm2 status
pm2 logs kodari-economy

The bot will automatically restart if it crashes or if the server reboots.

Easier free alternatives

Host
Ease
24/7 reliability
Notes
Oracle Cloud Always Free
Medium
Good
Best for persistent SQLite bots
Koyeb
Easy
Depends on current free plan
Connects directly to GitHub
Render
Easy
Limited
Free services may sleep
Replit
Very easy
Limited
Usually sleeps unless paid or externally kept awake
Railway
Easy
Trial/limited
Free credits and plans can change

For this bot, avoid hosts that delete the filesystem on restart. Your SQLite database contains balances, inventory, cooldowns, and player data. If the host has temporary storage, the economy may reset.

Discord Developer Portal settings

In the botโ€™s Discord Developer Portal:

  1. Open Bot โ†’ Reset Token if necessary and copy the token.

  2. Enable Message Content Intent only if the bot uses message commands.

  3. Generate an invite using these scopes:

    • bot

    • applications.commands

  4. Give it permissions such as:

    • View Channels

    • Send Messages

    • Embed Links

    • Attach Files

    • Use Slash Commands

For a free and reliable setup, I recommend Oracle Cloud + Ubuntu + PM2.

Kurdishgpt

I want a create pterodactyl panel for discorf bot full setup

Kodari AI
KodariAug 1 at 11:29 am 1

You can host your Discord bot on a Pterodactyl panel, but Pterodactyl itself must be installed on a VPS. The panel is not a free hosting service by itself.

Recommended free setup

Use:

  • Oracle Cloud Always Free VPS

  • Ubuntu 22.04 or 24.04

  • 2โ€“4 GB RAM minimum

  • AMD64/x86 server recommended for canvas packages

  • A domain or subdomain such as panel.example.com

  • Pterodactyl Panel

  • Pterodactyl Wings

  • Docker

  • Node.js Discord bot server

Oracle free instances can be difficult to obtain because of capacity limits. A paid VPS is usually easier and more reliable.


1. Prepare the VPS

Connect to the server:

Shell
ssh ubuntu@YOUR_SERVER_IP

Update Ubuntu:

Shell
sudo apt update && sudo apt upgrade -y

Set the hostname:

Shell
sudo hostnamectl set-hostname ptero

Install basic packages:

Shell
sudo apt install -y curl wget git unzip tar ca-certificates gnupg lsb-release ufw

Open the required firewall ports:

Shell
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 8080/tcp
sudo ufw allow 2022/tcp
sudo ufw enable

Also open ports 80, 443, and 2022 in the Oracle Cloud security rules.


2. Point your domain to the VPS

Create these DNS records:

Plain Text
panel.example.com     A     YOUR_SERVER_IP
node.example.com      A     YOUR_SERVER_IP

Wait for DNS propagation before configuring SSL.

You can test DNS with:

Shell
ping panel.example.com

3. Install Pterodactyl Panel

The official installation documentation is here:

The panel requires:

  • Nginx

  • PHP

  • MariaDB or MySQL

  • Redis

  • Composer

  • A queue worker

  • Cron

  • SSL certificate

For a first installation, use the official documentation rather than random YouTube scripts because unofficial installers can install outdated or unsafe packages.

The panel URL will eventually be:

Plain Text
https://panel.example.com

During the installation, create:

  • A database named panel

  • A database user such as pterodactyl

  • A strong panel administrator account

  • An application encryption key

  • Your domain name

Important: save the encryption key securely. Losing it can make the panel data unusable.


4. Install Wings

Wings is the daemon that actually runs the Discord bot containers.

Install Docker:

Shell
curl -sSL https://get.docker.com | sudo bash
sudo systemctl enable --now docker

Create the Wings directory:

Shell
sudo mkdir -p /etc/pterodactyl

Download Wings according to the version shown in your Pterodactyl panel. The official Wings documentation is:

Check that Wings is installed:

Shell
sudo wings --version

5. Create a node in Pterodactyl

Log in to your panel as administrator.

Go to:

Plain Text
Admin Panel โ†’ Locations

Create a location, for example:

Plain Text
Name: Oracle
Short code: oracle

Then go to:

Plain Text
Admin Panel โ†’ Nodes โ†’ Create New

Use values similar to:

Plain Text
Name: Oracle Node
Location: Oracle
FQDN: node.example.com
Scheme: https
Daemon Port: 8080
SFTP Port: 2022

Set memory and disk limits based on your VPS.

For example, on a VPS with 4 GB RAM:

Plain Text
Memory: 3500 MB
Disk: 20000 MB

Do not allocate all VPS memory to the bot. Leave some memory for Ubuntu, Docker, and the panel.


6. Configure Wings

After creating the node, open:

Plain Text
Admin Panel โ†’ Nodes โ†’ Oracle Node โ†’ Configuration

Copy the generated configuration.

Create the configuration file:

Shell
sudo nano /etc/pterodactyl/config.yml

Paste the node configuration and save it.

Create a systemd service:

Shell
sudo nano /etc/systemd/system/wings.service

Add:

Ini
[Unit]
Description=Pterodactyl Wings Daemon
After=docker.service
Requires=docker.service

[Service]
User=root
WorkingDirectory=/etc/pterodactyl
LimitNOFILE=4096
PIDFile=/var/run/wings/daemon.pid
ExecStart=/usr/local/bin/wings
Restart=on-failure
StartLimitInterval=180
StartLimitBurst=30

[Install]
WantedBy=multi-user.target

Enable Wings:

Shell
sudo systemctl daemon-reload
sudo systemctl enable --now wings

Check the status:

Shell
sudo systemctl status wings

View logs:

Shell
sudo journalctl -u wings -f

The node should show as Connected in the Pterodactyl panel.


7. Install the Node.js egg

For your Discord bot, use a Node.js Docker image.

In the panel, go to:

Plain Text
Admin Panel โ†’ Nests

You can import the official Node.js egg from the Pterodactyl Discord or Node.js egg repository. Alternatively, create a simple custom egg using a Node.js Docker image.

Recommended image:

Plain Text
ghcr.io/parkervcp/yolks:nodejs_20

Use Node.js 20 because most discord.js v14 projects support it.

Your server startup command should be:

Shell
npm install && npm start

If your package.json does not contain a start script, use:

Shell
npm install && node index.js

A suitable package.json script is:

JSON
{
  "scripts": {
    "start": "node index.js",
    "register": "node src/register-commands.js"
  }
}

8. Create the Discord bot server

In Pterodactyl:

Plain Text
Servers โ†’ Create New

Select:

Plain Text
Node: Oracle Node
Nest: Node.js
Egg: Node.js

Use:

Plain Text
Name: Kodari Economy Bot
Owner: your panel account
Memory: 1024โ€“2048 MB
Disk: 5000โ€“10000 MB
CPU: 100%

A Discord bot normally does not need a public network port. If Pterodactyl requires an allocation, create one but do not make your bot listen publicly.


9. Upload the bot

You have several options.

GitHub method

In the Pterodactyl console:

Shell
git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.git .
npm install

Do not upload your real .env file to GitHub.

SFTP method

Use an SFTP client such as:

  • FileZilla

  • WinSCP

  • Cyberduck

Connection details:

Plain Text
Host: node.example.com
Port: 2022
Username: panel_username.server_identifier
Password: your_panel_password
Protocol: SFTP

Upload:

Plain Text
index.js
package.json
package-lock.json
src/

Do not upload:

Plain Text
node_modules/
.env

Run npm install inside the Pterodactyl server instead.


10. Add bot environment variables

In the Pterodactyl server, open:

Plain Text
Startup โ†’ Variables

Add:

Plain Text
DISCORD_TOKEN=your_discord_bot_token
CLIENT_ID=your_discord_application_id
GUILD_ID=your_test_server_id

If your bot uses SQLite, also add any database path expected by your code, for example:

Plain Text
DATABASE_PATH=data/economy.sqlite

Then create the data directory in the console:

Shell
mkdir -p data

Your .env file should not be committed to GitHub.

Example local .env:

Env
DISCORD_TOKEN=replace_with_your_token
CLIENT_ID=replace_with_client_id
GUILD_ID=replace_with_server_id
DATABASE_PATH=data/economy.sqlite

Never share the Discord token. If it is exposed, immediately reset it in the Discord Developer Portal.


11. Register slash commands

Start the server once and install dependencies:

Shell
npm install

Then register commands:

Shell
npm run register

For fast testing, use GUILD_ID. Guild commands update almost immediately.

After commands are working, you can register global commands by removing the guild-specific registration code. Global commands may take time to appear.

Start the bot:

Shell
npm start

Or use the Pterodactyl consoleโ€™s Start button.


12. Recommended server settings

Set the following in Pterodactyl:

Plain Text
Restart Behavior: Always
Auto Allocate Ports: Disabled
OOM Killer: Enabled

For a small economy bot:

Plain Text
RAM: 1024 MB
Disk: 5 GB
CPU: 100%

If you use canvas image generation, increase memory:

Plain Text
RAM: 2048 MB

Canvas libraries can require additional native dependencies. @napi-rs/canvas is usually easier than node-canvas because it generally avoids compiling Cairo and Pango during installation.

Use:

Shell
npm install @napi-rs/canvas

instead of canvas if your project supports it.


13. SQLite persistence

SQLite works on Pterodactyl as long as the serverโ€™s disk is persistent.

Store the database inside the server directory:

Plain Text
/data/economy.sqlite

Back it up regularly. From the Pterodactyl console:

Shell
mkdir -p backups
cp data/economy.sqlite backups/economy-$(date +%F).sqlite

For a larger bot, use MariaDB or PostgreSQL instead of SQLite.

Do not store the database in:

Plain Text
/tmp

Temporary directories may be cleared.


14. Create a backup

In the Pterodactyl panel:

Plain Text
Server โ†’ Backups โ†’ Create Backup

Schedule regular backups if your panel configuration supports it.

Back up at least:

Plain Text
data/economy.sqlite
config files
package.json
src/

The Discord token should not be included in public backups.


15. Common problems

Bot immediately stops

Check the console:

Shell
npm start

Typical causes:

  • Missing DISCORD_TOKEN

  • Incorrect start command

  • Missing dependency

  • Wrong Node.js version

  • JavaScript syntax error

Slash commands do not appear

Check:

  • CLIENT_ID

  • GUILD_ID

  • Bot was invited with applications.commands

  • Registration command completed successfully

Canvas installation fails

Prefer:

Shell
npm uninstall canvas
npm install @napi-rs/canvas

Also ensure the server uses AMD64 rather than ARM64 if the package does not provide a compatible binary.

Wings is offline

Check:

Shell
sudo systemctl status wings
sudo journalctl -u wings -n 100

Also verify:

  • DNS for node.example.com

  • Port 8080

  • Port 2022

  • SSL certificate

  • /etc/pterodactyl/config.yml

Panel cannot connect to the node

The nodeโ€™s FQDN must resolve to the VPS IP:

Plain Text
node.example.com โ†’ VPS IP

Do not use localhost as the node FQDN when the panel and Wings are configured through a domain.


Final architecture

Plain Text
Discord
   โ†“
Discord bot process
   โ†“
Pterodactyl server container
   โ†“
Wings
   โ†“
Docker
   โ†“
Ubuntu VPS

For your economy bot, the simplest stable deployment is:

Plain Text
Pterodactyl
Node.js 20 egg
npm install && npm start
@discordjs
@napi-rs/canvas
SQLite in data/economy.sqlite
Automatic restart enabled
Scheduled Pterodactyl backups

Pterodactyl requires a VPS with root access. If you do not have a VPS, the easiest free alternative is to run the bot directly on Oracle Cloud Always Free rather than installing the full panel.

Kodari can make mistakes. Review important code before using.
Files
src
.gitignore
index.js
package.json
README.md
Code
10 1,437
index.js
require('dotenv').config();

const { Client, GatewayIntentBits, REST, Routes } = require('discord.js');
const config = require('./src/config');
const Database = require('./src/database');
const Economy = require('./src/economy');
const { commands, handleInteraction } = require('./src/commands');

if (!config.token || !config.clientId) {
    console.error('DISCORD_TOKEN and DISCORD_CLIENT_ID must be set in .env');
    process.exit(1);
}

const client = new Client({
    intents: [GatewayIntentBits.Guilds]
});

const database = new Database(config.databasePath);
const economy = new Economy(database);

async function registerCommands() {
    const rest = new REST({ version: '10' }).setToken(config.token);
    const route = config.guildId
        ? Routes.applicationGuildCommands(config.clientId, config.guildId)
        : Routes.applicationCommands(config.clientId);

    await rest.put(route, { body: commands });
    console.log(`Registered ${commands.length} slash commands.`);
}

client.once('ready', async () => {
    console.log(`Bot is ready as ${client.user.tag}`);

    try {
        await registerCommands();
    } catch (error) {
        console.error('Failed to register slash commands:', error);
    }
});

client.on('interactionCreate', async interaction => {
    if (!interaction.isChatInputCommand()) {
        return;
    }

    try {
        await handleInteraction(interaction, economy);
    } catch (error) {
        console.error(`Command ${interaction.commandName} failed:`, error);

        const response = {
            content: 'Something went wrong while processing that command.',
            ephemeral: true
        };

        if (interaction.replied || interaction.deferred) {
            await interaction.editReply(response).catch(() => {});
        } else {
            await interaction.reply(response).catch(() => {});
        }
    }
});

client.on('error', error => {
    console.error('Discord client error:', error);
});

process.on('SIGINT', () => {
    database.close();
    client.destroy();
    process.exit(0);
});

process.on('SIGTERM', () => {
    database.close();
    client.destroy();
    process.exit(0);
});

client.login(config.token).catch(error => {
    console.error('Failed to log in:', error);
    process.exit(1);
});