Skip to content

Repository files navigation

🎰 SlotBot

The ultimate Discord bot for seamless slot management

Pythondiscord.pyLicenseStarsIssues


SlotBot Banner

Click the banner above to watch the setup tutorial!


FeaturesQuick StartConfigurationCommandsContributingSupport


✨ Features

FeatureDescription
🎰 Slot CreationCreate slots with custom durations (days/months), categories, and ping limits
🔄 Slot RenewalRenew existing slots with new durations seamlessly
Slot ExtensionExtend slot duration without resetting the channel
🔀 Slot TransferTransfer slot ownership between users
⏸️ Hold / UnholdTemporarily freeze slots during investigations
🚫 Slot RevocationRevoke slots with automatic role & permission cleanup
📢 Ping ManagementConfigurable ping counts with automatic 24-hour resets + cooldowns
Auto-ExpiryBackground task automatically expires and locks slots hourly
⚠️Warning SystemWarn slot owners with DM notifications and tracking
🚫 Blacklist SystemBlacklist users from receiving slots with auto-revocation
📊 Advanced StatisticsDetailed stats with progress bars, 24h activity, warnings, and more
🏆 LeaderboardRank slots by remaining time with medal display
📜 Activity HistoryTrack all slot actions with timestamps
📋 Audit LoggingAll actions logged to a dedicated channel and log file
🔧 Setup WizardInteractive first-time configuration command
Slash CommandsModern Discord slash commands alongside prefix commands
🛡️ Role-Based AccessStaff-only commands with proper permission checks
⚠️Error HandlingGraceful error handling with cooldown support
💣 Nuke CommandClear slot channels while preserving bot embeds
📢 AnnouncementsStaff can send formatted announcement embeds
🏠 Server InfoDetailed server information display
⏱️ Uptime TrackingReal-time bot uptime monitoring
🎫 Ticket SystemCreate support tickets with buttons, auto-transcripts on close, DM delivery
🎟️ Redeem CodesGenerate redeemable codes that auto-create slots with set duration/pings

🚀 Quick Start

Step 1: Create a Discord Bot

  1. Go to the Discord Developer Portal
  2. Click "New Application" → give it a name → click "Create"
  3. Go to the "Bot" tab → click "Add Bot"
  4. Under "Privileged Gateway Intents", enable:
    • ✅ Presence Intent
    • ✅ Server Members Intent
    • ✅ Message Content Intent
  5. Click "Reset Token" → copy the token (you'll need it later)

Step 2: Invite the Bot

  1. Go to "OAuth2""URL Generator"
  2. Select scopes: bot, applications.commands
  3. Select permissions: Administrator
  4. Copy the generated URL and open it in your browser
  5. Select your server and authorize

Step 3: Set Up Your Server

Create these in your Discord server:

  • 2 Categories for slot channels (e.g., "Slots Category 1" and "Slots Category 2")
  • 1 Staff Role for bot managers
  • 1 Premium/Buyer Role for slot holders
  • 1 Slot Role (additional role for slot holders)
  • 1 Log Channel for audit logs (optional but recommended)

💡 Tip: Enable Developer Mode in Discord (Settings → Advanced → Developer Mode) to copy IDs by right-clicking.

Step 4: Install & Run

# Clone the repository
git clone https://github.com/codewithriza/SlotBot.git
cd SlotBot
# Create a virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate# Install dependencies
pip install -r requirements.txt
# Configure the bot (see next section)# Then run:
python3 main.py

Step 5: Use the Setup Wizard

Once the bot is running with just the token set, use the setup wizard in Discord:

,setup

This will interactively ask you for all the IDs and save them to config.json!


⚙️ Configuration

Edit config.json with your values:

{
"token": "YOUR_BOT_TOKEN_HERE",
"prefix": ",",
"staffrole": 123456789,
"premiumeroleid": 123456789,
"guildid": 123456789,
"categoryid_1": 123456789,
"categoryid_2": 123456789,
"slot_role_id": 123456789,
"log_channel_id": 123456789,
"default_ping_count": 3,
"ping_reset_hours": 24
}
KeyDescriptionRequired
tokenYour Discord bot token
prefixCommand prefix (default: ,)
staffroleStaff role ID
premiumeroleidPremium/buyer role ID
guildidYour server ID
categoryid_1First slot category ID
categoryid_2Second slot category ID
slot_role_idSlot holder role ID
log_channel_idAudit log channel IDOptional
default_ping_countDefault pings per slotOptional
ping_reset_hoursHours between ping resetsOptional
ticket_category_idCategory ID for ticket channelsOptional

🔐 Token Security

Option 1: Set in config.json (keep the file private!)

{ "token": "your_token_here" }

Option 2: Environment variable (recommended for production)

export SLOTBOT_TOKEN="your_token_here"
python3 main.py

Important

Never commit your bot token to Git! The .gitignore is configured to protect sensitive files.


🎮 Commands

🛡️ Staff Commands

CommandDescriptionExample
,createCreate a new slot,create @user 7 d 3 category1 Shop
,renewRenew an existing slot,renew @user #channel 30 d
,extendExtend slot duration,extend @user 7 d
,transferTransfer slot ownership,transfer @from @to
,revokeRevoke a user's slot,revoke @user #channel
,holdPut slot on hold,hold
,unholdRemove hold,unhold
,addAdd slot role,add @user
,removeRemove slot role,remove @user
,deleteDelete slot channel,delete
,warnWarn a slot owner,warn @user Inactive
,blacklistBlacklist a user,blacklist @user Scammer
,unblacklistRemove from blacklist,unblacklist @user
,slotinfoView slot details,slotinfo #channel
,slotsList all slots,slots
,announceSend announcement,announce Sale today!
,setupSetup wizard,setup
,ticketSend ticket panel with button,ticket
,closeticketClose current ticket,closeticket
,createredeemCreate a redeem code,createredeem 7 d 3 category1 1
,redeemsList all redeem codes,redeems
,deleteredeemDelete a redeem code,deleteredeem CODE

👤 User Commands

CommandDescriptionExample
,pingPing in your slot,ping everyone
,nukeClear slot messages,nuke
,myslotView your slot,myslot
,statsBot statistics,stats
,uptimeBot uptime,uptime
,serverinfoServer information,serverinfo
,leaderboardSlot leaderboard,leaderboard
,historyRecent activity,history
,redeemRedeem a code for a slot,redeem XXXX-XXXX-XXXX

⚡ Slash Commands

CommandDescription
/pingCheck bot latency
/slotinfoView slot information
/statsView bot statistics
/myslotView your slot
/serverinfoServer information
/leaderboardSlot leaderboard

🏗️ Project Structure

SlotBot/
├── main.py # Main bot file with all commands
├── config.json # Bot configuration
├── data.json # Slot expiry data
├── pingcount.json # Ping count tracking
├── blacklist.json # Blacklisted users
├── history.json # Action history log
├── tickets.json # Open ticket tracking
├── redeems.json # Redeem codes storage
├── slotbot.log # Runtime log file
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore rules
├── .env.example # Environment variable template
├── CONTRIBUTING.md # Contribution guidelines
├── LICENSE # MIT License
├── README.md # This file
└── image/
├── banner.png # Project banner
└── slotbotthumbnail.png

🔧 How It Works

┌─────────────────┐ ┌──────────────────┐ ┌───────────────────┐
│ Staff runs │────▶│ Bot validates │────▶│ Channel created │
│ ,create │ │ & checks blacklist│ │ with permissions │
└─────────────────┘ └──────────────────┘ └───────────────────┘
│
▼
┌──────────────────┐
│ Roles assigned │
│ Rules posted │
│ Info embed sent │
│ History logged │
└──────────────────┘
│
▼
┌────────────────────────────┐
│ Background Tasks Run │
│ • Expire check (1hr) │
│ • Ping reset (24hr) │
│ • Auto role cleanup │
│ • Audit log updates │
└────────────────────────────┘

💡 Tips & Notes

Note

The bot needs Administrator permissions and should be positioned above the slot roles in the role hierarchy.

Tip

Use the ,setup command for easy first-time configuration instead of manually editing config.json.

Tip

Set up a dedicated log channel to track all slot actions with timestamps.

Warning

Create two separate categories in your Discord server before running the bot.

Caution

Users with 3+ warnings should be reviewed for potential slot revocation.


🤝 Contributing

Contributions are welcome! Please read our Contributing Guide for details.

Discord


⭐ Support

If you find this project useful, please consider giving it a star on GitHub! 🌟

DiscordXYouTubeGitHub


Made with ❤️ by @codewithriza

About

Slot Bot is a Discord bot designed to streamline slot management in your server. It allows users to create slots for various purposes, such as selling items or offering services

Topics

Resources

Contributing

Stars

22 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages