Skip to content

Boutzi/arkaans-copilot

 
 

Repository files navigation

Arkaans Copilot

Arkaans Copilot is a Discord bot designed to streamline the management of temporary voice channels within your Discord server.

TypeScript Discord.js PostgreSQL Prisma License

Documentation · Invite the bot · Arkaans Discord server


Overview

Arkaans Copilot is a Discord bot that automatically creates and manages temporary voice channels when users join a configured source channel. When the last member leaves, the temporary channel is deleted automatically.

This repository contains v3 — a full rewrite in TypeScript with a production-ready architecture, PostgreSQL persistence, concurrent queue handling, and CI/CD pipeline. Previous versions are archived in the archive/ directory.


Features

Core

  • Temporary voice channels — Automatically created on join, deleted on leave
  • Concurrent queue handling — Per-guild queues prevent race conditions on simultaneous joins
  • Crash recovery — Active channels are persisted in DB and cleaned up on bot restart

Admin commands

Command Description
/setchannel Configure a voice channel as a source trigger with a custom name list
/resetchannel Remove the configuration for a specific source channel
/resetallchannels Remove all source channel configurations for the server
/setwelcome Set up a customizable welcome image for new members
/testwelcome Trigger the welcome message manually to preview the result

Common commands

Command Description
/arkaans Invitation link to the official Arkaans server
/help Display all available commands

Tech Stack

Layer Technology
Language TypeScript 5.x
Runtime Node.js 20+
Discord library Discord.js v14
Database PostgreSQL (Supabase)
ORM Prisma 7
Queue p-queue
Image generation @napi-rs/canvas
Containerization Docker + GHCR
CI/CD GitHub Actions
Hosting Oracle Cloud Free Tier / Railway

Database Schema

Guild (1)
├── SourceChannel (Many)
│   └── TempChannel (Many)
└── WelcomeConfig (1)
  • Guild — root entity, one record per Discord server
  • SourceChannel — configured trigger channels with a custom name list
  • TempChannel — currently active temporary channels (cleared on restart)
  • WelcomeConfig — per-guild welcome image configuration

Getting Started

Prerequisites

Installation

git clone https://github.com/Boutzi/arkaans-copilot.git
cd arkaans-copilot
npm install

Environment

Create a .env file at the root:

DISCORD_BOT_TOKEN=your_discord_bot_token
DISCORD_CLIENT_ID=your_discord_client_id

# Supabase connection pooler (used by the bot)
DATABASE_URL="postgresql://postgres.[ref]:[password]@aws-1-eu-central-1.pooler.supabase.com:6543/postgres?pgbouncer=true"

# Supabase direct connection (used for migrations)
DIRECT_URL="postgresql://postgres.[ref]:[password]@aws-1-eu-central-1.pooler.supabase.com:5432/postgres"

Database

npx prisma migrate dev --name init
npx prisma generate

Run

# Development
npm run dev

# Deploy slash commands
npm run deploy

# Production
npm run prod

CI/CD Pipeline

Push / PR  →  Lint + Type check
Merge main →  Build Docker image → Push to GHCR → Deploy

Managed via GitHub Actions. The Docker image is published to GitHub Container Registry and deployed automatically on merge to main.


Roadmap

v3.0 — Foundation

  • TypeScript rewrite
  • PostgreSQL schema with Prisma 7
  • Per-guild concurrent queue (p-queue)
  • Command handler
  • Event handler
  • /setchannel, /resetchannel, /resetallchannels
  • /setwelcome + /testwelcome — customizable welcome image
  • Crash recovery on restart
  • Docker setup
  • GitHub Actions CI/CD

v3.x — Future

  • Monitoring (Sentry)
  • Web dashboard for guild admins
  • Internationalization (i18n) — multi-language support via i18next

Documentation

Full documentation is available at copilot.arkaans.com.


License

MIT

About

Arkaans Copilot is a Discord bot designed to streamline the management of temporary voice channels within your Discord server.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages

  • TypeScript 72.8%
  • JavaScript 26.7%
  • Dockerfile 0.5%