Skip to content

JMoogs/bot697

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bot697

A general-purpose Discord bot written in Rust. Runs on Tokio — single async runtime handles gateway events, voice streams, and database queries concurrently without thread-per-connection overhead.

Overview

Covers the commands you actually want: moderation, music playback, server utilities, and RNG. Configuration is layered — JSON file for the baseline, CLI flags to override at startup — so the same binary runs across multiple servers without touching code.

Built with poise (slash + prefix commands from the same handler), songbird for voice, and sqlx for SQLite. Everything flows through the same event loop; no thread pools or blocking I/O.

Commands

Moderation — all restricted to server owners

Command Description
kick <user> [reason] Kick with audit log entry
ban <user> [days] [reason] Ban and optionally purge message history (0–7 days)
unban <user_id> Remove a ban by user ID
timeout <user> <minutes> [reason] Communicate-disable via Discord's timeout API
purge <count> Bulk-delete 2–100 messages (ephemeral confirmation)

Utility

Command Description
userinfo [user] Embed with account info — ID, creation date, flags
serverinfo Guild overview — member count, channels, roles, boost tier
avatar [user] Full-size avatar embed
uptime How long the bot has been running (HH:MM:SS)
help [command] List all commands or look up a specific one

Voice / Music

Command Description
join Join your current voice channel
leave Disconnect
play <url or search> Play from a YouTube URL or search query; queues if something is already playing
skip Skip the current track
stop Stop playback and leave
mute / unmute Toggle bot mic mute
deafen / undeafen Toggle bot deafen

RNG

Command Description
coinflip Heads or tails
dice Roll a d6
8ball [question] 25-response Magic 8-Ball — echoes your question back
roll <notation> Full dice notation parser: 2d6, 1d20+5, 3d8-2, d6 — shows individual rolls and total

Polls

Command Description
poll <question> <options> [minutes] Timed reaction poll with 2–5 options. Adds number reactions automatically, then edits the embed in-place with final vote counts when the timer expires — runs in a background Tokio task

Tech Stack

  • Rust (2021 edition) — async throughout, zero blocking I/O
  • Tokio — the runtime everything shares
  • Poise 0.6 on Serenity — slash and prefix commands from the same handler
  • Songbird 0.4 — voice connection management and audio queuing
  • Symphonia — audio decoding (AAC, MP3, ALAC)
  • SQLx 0.7 + SQLite — async database with a connection pool
  • Clap 4 — CLI with layered config
  • tracing — structured log output on every significant action

Getting Started

You'll need yt-dlp on $PATH for music playback. Everything else is handled by Cargo.

cargo build --release

export DISCORD_TOKEN=your_token_here
export DATABASE_URL=sqlite://bot.db

# Run with a prefix
./target/release/bot697 run --prefix ","

# Or point at a config file
./target/release/bot697 run --config-file config.json

Config file schema (config.json):

{
  "developers": ["your_user_id"],
  "developer_guilds": ["your_testing_guild_id"],
  "prefixes": [","],
  "mention_as_prefix": true
}

CLI flags take precedence over config file values. Run bot697 run --help for the full reference.

About

My discord bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages