Skip to content

A discord bot designed to catch, delete, and ban advertising bots / stolen accounts right off the bat.

License

Notifications You must be signed in to change notification settings

Cheddlar/Bugjar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🐞 Bugjar — Smart Auto-Ban Protection Bot

"Silence the noise, guard the signal."
Bugjar safeguards your most sacred Discord channels — instantly banning anyone who speaks where they shouldn't. Clean, fast, and built for admins who don't tolerate clutter.

Python Discord.py License


💡 Overview

Bugjar is a high-performance Discord moderation bot designed for one job:
protecting certain channels from unwanted messages.
If anyone other than your allowed users or roles posts there — they're banned, their recent messages are purged, and you get notified via console or webhook logs.


Core Features

Feature Description
🚫 Automatic Instant Bans Unauthorized users posting in protected channels are auto-banned — no commands, no delays.
🧹 Message Cleanup Deletes up to seven days of the offender's messages in those channels for a pristine record.
⚙️ Interactive Config Builder No manual editing required! On first run, Bugjar launches an interactive CLI wizard.
🛡️ Granular Access Control Whitelist specific User IDs or Role IDs — guild owners always immune.
💬 Webhook Logging (optional) Rich embeds for allowed messages, bans, and errors.
🪄 Admin Commands !reload & !protected with admin-only access.
🎨 Colorized Console Beautiful logs with colorama support.

📦 Installation Guide

🔧 Step-by-step setup

🧰 Requirements

  • Python 3.10+
  • Discord bot token with Message Content, Guilds, and Members intents
  • discord.py, aiohttp, colorama

1️⃣ Create workspace

mkdir Bugjar && cd Bugjar
# Copy bot.py here

2️⃣ Install dependencies

python3 -m venv .venv
source .venv/bin/activate      # Windows: .venv\Scripts\activate
pip install -U discord.py aiohttp colorama

3️⃣ First launch (interactive setup)

python3 bot.py

Bugjar launches an interactive CLI wizard to collect:

  • Bot Token
  • Guild ID
  • Protected Channel IDs
  • Allowed Roles/Users
  • Appeal contact & webhook URL

Config is auto-saved as config.json!


⚙️ Configuration File

📄 Generated `config.json` example
{
    "config": {
        "token": "YOUR_BOT_TOKEN_HERE",
        "guild_id": 123456789012345678,
        "protected_channels": ,
        "allowed_roles": ,
        "allowed_users": [],
        "appeal_target": "AdminUser#1234",
        "webhook_url": "https://discord.com/api/webhooks/..."
    }
}

Key Fields:

  • protected_channels: Channel IDs under auto-ban protection
  • allowed_roles / allowed_users: IDs exempt from protection
  • appeal_target: DM target for banned users
  • webhook_url: Rich logging endpoint

▶️ Running the Bot

python3 bot.py

Console output:

[2026-02-02 14:20:15] [INFO] Starting Bugjar — connecting to Discord...
[2026-02-02 14:20:17] [INFO] Bugjar#1234 (ID: 123456789012345678) is online

Required Bot Permissions:

  • View Channel
  • Manage Messages
  • Ban Members
  • Higher role position than users it bans

🕹️ Admin Commands

Command Permission Description
!reload Administrator Reloads config.json without restart
!protected Administrator Lists all protected channels with mentions

📡 Webhook Logging

🔍 Rich Discord webhook embeds

Ban Event Example:

🟥 User Banned
👤 User: @Offender (123456789)
💬 Channel: #announcements (987654321)
📝 Message: "oops wrong channel"
🏰 Guild: My Server (123456789)
✅ Result: Banned
🕐 Feb 2, 2026 2:20 PM

Event Types: Allowed Messages, Successful Bans, Permission Errors, API Failures


⚠️ Safety & Best Practices

⚡ Quick Checklist

  • Test server first — Verify config & permissions
  • Precise channels only — Announcements, rules, info-only
  • Use roles — Easier than user ID lists
  • Bot role hierarchy — Must rank above troublemakers
  • Persistent loggingtmux, screen, or systemd

🧹 Uninstall / Disable

  1. Stop process: Ctrl+C
  2. Remove bot: Kick from Discord server
  3. Delete files: rm -rf Bugjar/ (or your workspace)

❤️ Made with Purpose

Bugjar enforces server boundaries with surgical precision — perfect for communities where discipline meets automation.

👨‍💻 Created by Cheddlar
Star this repo if Bugjar keeps your channels clean!


📈 ASCII Art Preview (Console Startup)
    ,---,.                                   
 ,'  .'  \                                  
,---.' .' |         ,--,                 .--.            
|   |  |: |       ,'_ /|  ,----._,.    .--,`|           ,' ,'/ /| 
:   :  :  /  .--. |  | : /   /  ' /    |  |.    ,--.--.  '  | |' | 
:   |    ; ,'_ /| :  . ||   :     |    '--`_   /       \ |  |   ,' 
|   :     \|  ' | |  . .|   | .\  .    ,--,'| .--.  .-. |'  :  /   
|   |   . ||  | ' |  | |.   ; ';  |    |  | '  \__\/: . .|  | '     
'   :  '; |:  | : ;  ; |'   .   . |    :  | |  ," .--.; |;  : |     
|   |  | ; '  :  `--'   \`---`-'| |  __|  : ' /  /  ,.  ||  , ;     
|   :   /  :  ,     .-/.'__/\_: |.'__/\_: |;  :   .'   \---'       
|   | ,'    `--`----'    |   :   :|   :   :|  ,     .-/           
`----'                     \   \  /  \   \  /  `--`---'             
                           `--`-'    `--`-'                       

About

A discord bot designed to catch, delete, and ban advertising bots / stolen accounts right off the bat.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages