Skip to content

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 Clear the name list for a specific channel
/resetallchannels Reset all channel configurations for the server

Welcome

Command Description
/setwelcome Set up a customizable welcome image for new members

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
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_TOKEN=your_discord_bot_token
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

# Production
npm run build
npm start

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
  • Per-guild concurrent queue (p-queue)
  • Command handler
  • Event handler
  • /setchannel, /resetchannel, /resetallchannels
  • Crash recovery on restart
  • Docker setup
  • GitHub Actions CI/CD

v3.1 — Welcome

  • /setwelcome — customizable welcome image
  • Hex color, background image, custom message support

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

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages