notsubhan.json
๐Ÿ“Ž 1 file 5,646 chars
๐Ÿ“„
pasted-code-1784927411152.txt
txt 345 lines
โ–ถ
Create a professional, powerful, and feature-rich Discord bot focused entirely on server moderation, security, automation, and community management. The bot should work directly inside Discord using slash commands, buttons, menus, and interactive embeds. It should not include any VPS, hosting, Minecraft, or external dashboard features.

The goal is to create an all-in-one Discord management solution that can replace multiple separate bots by combining moderation, protection, support, and engagement features into one clean and easy-to-use bot.

๐Ÿ›ก๏ธ 1. Advanced Moderation System

Create a complete moderation system that helps staff control and manage their Discord server.

Features:
Warning System
Allow moderators to warn members.
Store warning history for every user.
Show previous warnings using commands.
Automatically punish users after reaching a warning limit.

Example:

/warn @user Spamming

Bot response:

User warned successfully.
Reason: Spamming
Total warnings: 2/5
Punishment System

Include moderation commands:

/warn โ†’ Give warnings
/warnings โ†’ View user warnings
/mute โ†’ Temporarily remove speaking permissions
/timeout โ†’ Discord timeout system
/kick โ†’ Remove members
/ban โ†’ Permanently ban users
/unban โ†’ Remove bans
/clear โ†’ Delete messages

Allow admins to customize:

Default punishment duration
Warning limits
Required moderator roles
๐Ÿšจ 2. Anti-Raid & Server Protection System

Create a security system that protects Discord servers from attacks.

Anti-Raid Protection:

Detect suspicious activity like:

Many users joining quickly
New accounts joining during attacks
Mass message sending
Spam waves

Actions:

Automatically lock channels
Remove suspicious users
Alert moderators
Enable emergency protection mode
Anti-Nuke Protection:

Protect important server settings from malicious users.

Monitor:

Channel deletion
Role deletion
Mass bans
Permission changes
Webhook creation
Server setting changes

If someone tries to damage the server:

Example:

User banned 50 members

Bot automatically:

Stops the action
Removes dangerous permissions
Logs the event
Alerts staff
๐Ÿ” 3. Verification System

Create a member verification system to stop bots and fake accounts.

Features:

Verification button
Verification roles
Account age checking
New account restrictions
Verified member logs

Example:

New user joins:

Welcome!
Please verify yourself to access the server.
[ Verify ]

After clicking:

Verification completed.
You now have Member access.
๐ŸŽซ 4. Advanced Ticket System

Create a complete support ticket system inside Discord.

Ticket Features:
Create ticket panels
Multiple ticket categories
Staff claiming system
Private ticket channels
Ticket closing buttons
Ticket transcripts
Ticket logs

Example categories:

๐ŸŽซ Support
๐Ÿ’ฐ Purchase Help
โš ๏ธ Report User
๐Ÿ“ฉ Partnership

Staff can:

Claim tickets
Close tickets
Add/remove members
View ticket history
โš™๏ธ 5. Automation System

Reduce manual server management with automated features.

Welcome System:

Automatically send welcome messages.

Example:

Welcome @User to our community!

Read:
#rules
#announcements
Goodbye System:

Send goodbye messages when users leave.

Example:

Goodbye @User.
We hope to see you again!
Auto Role System:

Automatically assign roles.

Examples:

Member role
Verified role
New user role
Reaction Roles:

Allow users to select roles by clicking buttons.

Example:

Choose your role:

๐ŸŽฎ Gamer
๐ŸŽจ Designer
๐Ÿ’ป Developer
๐Ÿ“ข 6. Server Announcement Tools

Create tools for better communication.

Features:

Scheduled announcements
Custom embed messages
News broadcasts
Event reminders

Example:

/announce

Title:
Server Update

Message:
New features have been released!
๐ŸŽ‰ 7. Community Engagement Features

Help Discord servers become more active.

Giveaway System

Features:

Create giveaways
Set winners
Automatic ending
Giveaway reroll

Example:

/giveaway start

Prize:
Nitro Classic

Duration:
24 hours

Winners:
3
Leveling System

Reward active members.

Features:

XP system
Level roles
Leaderboards
Rank cards

Example:

User reached Level 10

Reward:
Active Member Role
Economy System

Add a virtual currency system.

Features:

Earn coins by chatting
Daily rewards
User balance
Leaderboards
Shop system

Example:

/balance

Coins:
500
๐Ÿ’ก 8. Suggestion & Feedback System

Allow members to submit ideas.

Features:

Suggestion channels
Voting buttons
Staff responses
Approval/rejection system

Example:

Suggestion:
Add more events

๐Ÿ‘ 50
๐Ÿ‘Ž 5
๐Ÿ“Š 9. Logging System

Create detailed logs for server actions.

Log:

Messages deleted
Messages edited
Members joining/leaving
Moderation actions
Role changes
Channel changes
Security alerts

Example:

Moderation Log

Moderator:
Admin

Action:
Banned User

Reason:
Rule violation
๐Ÿ‘ค 10. User Management System

Create detailed member management tools.

Features:

User information command
Join date
Roles
Warning history
Activity tracking
Reputation system

Example:

/userinfo @user

Shows:

Username:
Join Date:
Roles:
Warnings:
Level:
๐ŸŽจ Design Requirements

The bot should have:

Premium Discord-style embeds
Modern buttons and menus
Clean command responses
Fast performance
Easy setup process
Multi-server support
Secure database
Permission-based commands
Professional error handling
Final Goal:

Create a complete Discord server operating system that combines moderation, security, automation, support, and community features into one powerful bot.

The bot should feel like a premium alternative to popular Discord bots such as Dyno, Carl-bot, MEE6, and Wick, but with more customization, better organization, and a complete set of tools managed directly inside Discord.
Kodari AI
KodariJul 24 at 9:12 pm 11
GuardianDiscordBot
GuardianDiscordBot is an all-in-one Discord server management bot built with discord.py. It provides slash-command moderation, warning history, timeouts, bans, anti-raid alerts, emergency protection, member verification, welcome and auto-role automation, private support tickets with transcripts, suggestions, giveaways, leveling, virtual currency, server logging, and interactive embeds, buttons, and role panels. Configuration is stored per server in a secure SQLite database, with tokens loaded from environment variables.
notsubhan.json

bot is not starting this is my token <redacted>

Kodari AI
KodariJul 24 at 9:19 pm 2

That Discord bot token is exposed and must be revoked immediately. In the Discord Developer Portal:

  1. Open Developer Portal โ†’ Your Application โ†’ Bot.

  2. Click Reset Token, then copy the new token.

  3. Do not send the new token here.

Create a .env file in the same folder as bot.py:

Env
DISCORD_TOKEN=PASTE_THE_NEW_TOKEN_HERE
DATABASE_PATH=guardian.sqlite3

Then install dependencies and start the bot:

Shell
python -m pip install -r requirements.txt
python bot.py

Also enable these under Developer Portal โ†’ Bot โ†’ Privileged Gateway Intents:

  • Server Members Intent

  • Message Content Intent

If it still fails, paste the complete terminal traceback here, but remove the token and any other secrets. Common errors:

  • DISCORD_TOKEN is not configured โ€” .env is missing, misnamed, or in the wrong folder.

  • Improper token has been passed โ€” the token was copied incorrectly or has been reset.

  • PrivilegedIntentsRequired โ€” the required intents are not enabled.

  • ModuleNotFoundError โ€” run the dependency installation command again.

notsubhan.json
๐Ÿ“Ž 1 file 2,124 chars
๐Ÿ“„
pasted-code-1784928002339.txt
txt 39 lines
โ–ถ
Loading bot files...
Creating a super duper secure sandbox...
Sandbox created, starting bot...
2026-07-24 21:19:54,984 | WARNING | discord.client | PyNaCl is not installed, voice will NOT be supported
[2026-07-24 21:19:54] [INFO ] discord.client: logging in using static token
2026-07-24 21:19:54,985 | INFO | discord.client | logging in using static token
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/discord/http.py", line 816, in static_login
data = await self.request(Route('GET', '/users/@me'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/discord/http.py", line 758, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/bot.py", line 86, in 
bot.run(settings.token)
File "/usr/local/lib/python3.12/site-packages/discord/client.py", line 869, in run
asyncio.run(runner())
File "/usr/local/lib/python3.12/asyncio/runners.py", line 195, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/discord/client.py", line 858, in runner
await self.start(token, reconnect=reconnect)
File "/usr/local/lib/python3.12/site-packages/discord/client.py", line 786, in start
await self.login(token)
File "/usr/local/lib/python3.12/site-packages/discord/client.py", line 620, in login
data = await self.http.static_login(token)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/discord/http.py", line 820, in static_login
raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
Bot process crashed
Kodari AI
KodariJul 24 at 9:20 pm 1

The bot is reaching Discord successfully, but Discord is rejecting the token:

Plain Text
401 Unauthorized
discord.errors.LoginFailure: Improper token has been passed.

The PyNaCl warning is unrelated; it only disables voice support.

Because the token was exposed, immediately:

  1. Go to Discord Developer Portal โ†’ Your Application โ†’ Bot.

  2. Click Reset Token.

  3. Copy the new token. Do not post it here.

  4. Update the token in your hosting panel or .env file.

  5. Restart/redeploy the bot.

Your .env should contain the new token without quotes or extra spaces:

Env
DISCORD_TOKEN=your_new_token_here

If your code uses settings.token, verify that it loads the same environment variable:

Python
import os
from dotenv import load_dotenv

load_dotenv()

token = os.getenv("DISCORD_TOKEN")
if not token:
    raise RuntimeError("DISCORD_TOKEN is not configured")

bot.run(token)

Also check that:

  • The variable is named exactly DISCORD_TOKEN.

  • The hosting service has been restarted after changing it.

  • You pasted the bot token, not the application ID, public key, or client secret.

  • No leading/trailing spaces or accidental line breaks were included.

Do not try to reuse the token that was posted; resetting it invalidates the exposed token.

notsubhan.json

<redacted>

Kodari AI
KodariJul 24 at 9:22 pm 1

That token is exposed. Reset it immediatelyโ€”do not use or share it again.

  1. Go to Discord Developer Portal โ†’ Your Application โ†’ Bot.

  2. Click Reset Token and copy the new token privately.

  3. Update your hosting environment or .env:

Env
DISCORD_TOKEN=your_new_token_here
  1. Restart the bot.

Make sure the value has no quotes, spaces, or line breaks. The previous token should be considered compromised and invalidated.

notsubhan.json

fix this

๐Ÿ“Ž 1 file 1,794 chars
๐Ÿ“„
pasted-code-1784928906751.txt
txt 27 lines
โ–ถ
D:\Website\bot>python bot.py
Traceback (most recent call last):
  File "D:\Website\bot\bot.py", line 3, in 
    import discord
  File "C:\Users\SubhanZahid\AppData\Roaming\Python\Python314\site-packages\discord\__init__.py", line 23, in 
    from .client import *
  File "C:\Users\SubhanZahid\AppData\Roaming\Python\Python314\site-packages\discord\client.py", line 51, in 
    from .sku import SKU, Entitlement
  File "C:\Users\SubhanZahid\AppData\Roaming\Python\Python314\site-packages\discord\sku.py", line 31, in 
    from .app_commands import MissingApplicationID
  File "C:\Users\SubhanZahid\AppData\Roaming\Python\Python314\site-packages\discord\app_commands\__init__.py", line 12, in 
    from .commands import *
  File "C:\Users\SubhanZahid\AppData\Roaming\Python\Python314\site-packages\discord\app_commands\commands.py", line 53, in 
    from .models import Choice
  File "C:\Users\SubhanZahid\AppData\Roaming\Python\Python314\site-packages\discord\app_commands\models.py", line 44, in 
    from ..member import Member
  File "C:\Users\SubhanZahid\AppData\Roaming\Python\Python314\site-packages\discord\member.py", line 33, in 
    import discord.abc
  File "C:\Users\SubhanZahid\AppData\Roaming\Python\Python314\site-packages\discord\abc.py", line 59, in 
    from .voice_client import VoiceClient, VoiceProtocol
  File "C:\Users\SubhanZahid\AppData\Roaming\Python\Python314\site-packages\discord\voice_client.py", line 35, in 
    from .player import AudioPlayer, AudioSource
  File "C:\Users\SubhanZahid\AppData\Roaming\Python\Python314\site-packages\discord\player.py", line 29, in 
    import audioop
ModuleNotFoundError: No module named 'audioop'

D:\Website\bot>t
Kodari AI
KodariJul 24 at 9:35 pm 2
  1. Add the Python 3.13+ audioop compatibility package to the dependencies.

  2. Reinstall dependencies in the same Python 3.14 environment and restart the bot.

The error is caused by Python 3.14 removing audioop, while your installed discord.py version still imports it.

Updated requirements.txt to include:

Txt
audioop-lts>=0.2.1; python_version >= "3.13"
PyNaCl>=1.5.0

From D:\Website\bot, run:

Shell
py -3.14 -m pip install --upgrade -r requirements.txt
py -3.14 bot.py

If audioop-lts does not install correctly on Python 3.14, use Python 3.12 instead:

Shell
py -3.12 -m pip install -r requirements.txt
py -3.12 bot.py

The PyNaCl package removes the voice-support warning. It is not required for normal text, moderation, slash-command, or interaction features.

notsubhan.json

remove audioloop

Kodari AI
KodariJul 24 at 9:37 pm 2

Removed audioop-lts from requirements.txt.

Reinstall dependencies:

Shell
py -3.14 -m pip install --upgrade -r requirements.txt

However, Python 3.14 may still fail because discord.py==2.4.0 imports the removed audioop module. If that happens, use Python 3.12:

Shell
py -3.12 -m pip install -r requirements.txt
py -3.12 bot.py
notsubhan.json
๐Ÿ“Ž 1 file 2,394 chars
๐Ÿ“„
pasted-code-1784929523481.txt
txt 42 lines
โ–ถ
(.venv) PS D:\Website\bot> python bot.py        
2026-07-25 02:44:51,042 | WARNING | discord.client | PyNaCl is not installed, voice will NOT be supported
2026-07-25 02:44:51,044 | WARNING | discord.client | davey is not installed, voice will NOT be supported
2026-07-25 02:44:51 INFO     discord.client logging in using static token
2026-07-25 02:44:51,047 | INFO | discord.client | logging in using static token
Traceback (most recent call last):
  File "D:\Website\bot\.venv\Lib\site-packages\discord\http.py", line 844, in static_login
    data = await self.request(Route('GET', '/users/@me'))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Website\bot\.venv\Lib\site-packages\discord\http.py", line 778, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\Website\bot\bot.py", line 86, in 
    bot.run(settings.token)
    ~~~~~~~^^^^^^^^^^^^^^^^
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 933, in run
    asyncio.run(runner())
    ~~~~~~~~~~~^^^^^^^^^^
  File "C:\Program Files\Python314\Lib\asyncio\runners.py", line 204, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "C:\Program Files\Python314\Lib\asyncio\runners.py", line 127, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "C:\Program Files\Python314\Lib\asyncio\base_events.py", line 719, in run_until_complete        
    return future.result()
           ~~~~~~~~~~~~~^^
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 922, in runner
    await self.start(token, reconnect=reconnect)
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 850, in start
    await self.login(token)
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 679, in login
    data = await self.http.static_login(token)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Website\bot\.venv\Lib\site-packages\discord\http.py", line 848, in static_login
    raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
(.venv) PS D:\Website\bot> 
Kodari AI
KodariJul 24 at 9:45 pm 1

The bot code is starting correctly. The failure is only authentication:

Plain Text
401 Unauthorized
discord.errors.LoginFailure: Improper token has been passed.

All tokens previously posted must be considered compromised. Reset the bot token again in:

Discord Developer Portal โ†’ Application โ†’ Bot โ†’ Reset Token

Then update your .env file with the new token:

Env
DISCORD_TOKEN=your_new_token_here

Use the raw bot token onlyโ€”do not include Bot , quotes, spaces, or line breaks.

In PowerShell, make sure an old environment variable is not overriding .env:

Powershell
Get-ChildItem Env:DISCORD_TOKEN

If an old value appears, replace it temporarily:

Powershell
$env:DISCORD_TOKEN="your_new_token_here"
python bot.py

Your code should ultimately pass the raw value:

Python
bot.run(settings.token)

or:

Python
import os
from dotenv import load_dotenv

load_dotenv()

token = os.getenv("DISCORD_TOKEN")
if not token:
    raise RuntimeError("DISCORD_TOKEN is missing")

bot.run(token)

The PyNaCl and davey messages are only voice-support warnings; they are unrelated to the login failure.

notsubhan.json
๐Ÿ“Ž 1 file 2,174 chars
๐Ÿ“„
pasted-code-1784929570065.txt
txt 38 lines
โ–ถ
.venv) PS D:\Website\bot> $env:DISCORD_TOKEN=""
>> python bot.py
2026-07-25 02:45:55,506 | WARNING | discord.client | PyNaCl is not installed, voice will NOT be supported
2026-07-25 02:45:55,507 | WARNING | discord.client | davey is not installed, voice will NOT be supported
2026-07-25 02:45:55 INFO     discord.client logging in using static token
2026-07-25 02:45:55,509 | INFO | discord.client | logging in using static token
Traceback (most recent call last):
  File "D:\Website\bot\bot.py", line 86, in 
    bot.run(settings.token)
    ~~~~~~~^^^^^^^^^^^^^^^^
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 933, in run
    asyncio.run(runner())
    ~~~~~~~~~~~^^^^^^^^^^
  File "C:\Program Files\Python314\Lib\asyncio\runners.py", line 204, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "C:\Program Files\Python314\Lib\asyncio\runners.py", line 127, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "C:\Program Files\Python314\Lib\asyncio\base_events.py", line 719, in run_until_complete        
    return future.result()
           ~~~~~~~~~~~~~^^
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 922, in runner
    await self.start(token, reconnect=reconnect)
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 850, in start
    await self.login(token)
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 693, in login
    await self.setup_hook()
  File "D:\Website\bot\bot.py", line 48, in setup_hook
    synced = await self.tree.sync()
             ^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Website\bot\.venv\Lib\site-packages\discord\app_commands\tree.py", line 1121, in sync       
    raise CommandSyncFailure(e, commands) from None
discord.app_commands.errors.CommandSyncFailure: Failed to upload commands to Discord (HTTP status 400, error code 50035)
In command 'unban' defined in function 'Moderation.unban'
  In parameter 'user_id'
    max_value: int53 value should be less than or equal to 9007199254740991.
(.venv) PS D:\Website\bot> 
Kodari AI
KodariJul 24 at 9:46 pm 2

Fixed the command-sync error in cogs/moderation.py.

Discord only accepts integer slash-command bounds up to:

Python
9007199254740991

The /unban parameter now uses that valid maximum instead of 10**20.

Restart the bot:

Powershell
python bot.py

The PyNaCl and davey messages are only voice warnings and do not prevent startup. Also reset the token you posted publicly before restarting.

notsubhan.json
๐Ÿ“Ž 1 file 2,175 chars
๐Ÿ“„
pasted-code-1784929618694.txt
txt 38 lines
โ–ถ
(.venv) PS D:\Website\bot> $env:DISCORD_TOKEN=""
>> python bot.py
2026-07-25 02:46:45,518 | WARNING | discord.client | PyNaCl is not installed, voice will NOT be supported
2026-07-25 02:46:45,519 | WARNING | discord.client | davey is not installed, voice will NOT be supported
2026-07-25 02:46:45 INFO     discord.client logging in using static token
2026-07-25 02:46:45,521 | INFO | discord.client | logging in using static token
Traceback (most recent call last):
  File "D:\Website\bot\bot.py", line 86, in 
    bot.run(settings.token)
    ~~~~~~~^^^^^^^^^^^^^^^^
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 933, in run
    asyncio.run(runner())
    ~~~~~~~~~~~^^^^^^^^^^
  File "C:\Program Files\Python314\Lib\asyncio\runners.py", line 204, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "C:\Program Files\Python314\Lib\asyncio\runners.py", line 127, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "C:\Program Files\Python314\Lib\asyncio\base_events.py", line 719, in run_until_complete        
    return future.result()
           ~~~~~~~~~~~~~^^
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 922, in runner
    await self.start(token, reconnect=reconnect)
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 850, in start
    await self.login(token)
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 693, in login
    await self.setup_hook()
  File "D:\Website\bot\bot.py", line 48, in setup_hook
    synced = await self.tree.sync()
             ^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Website\bot\.venv\Lib\site-packages\discord\app_commands\tree.py", line 1121, in sync       
    raise CommandSyncFailure(e, commands) from None
discord.app_commands.errors.CommandSyncFailure: Failed to upload commands to Discord (HTTP status 400, error code 50035)
In command 'unban' defined in function 'Moderation.unban'
  In parameter 'user_id'
    max_value: int53 value should be less than or equal to 9007199254740991.
(.venv) PS D:\Website\bot> 
Kodari AI
KodariJul 24 at 9:47 pm 2

Fixed /unban by removing the invalid max_value constraint that Discord was still rejecting.

Restart the bot:

Powershell
python bot.py

The PyNaCl and davey messages are unrelated voice-support warnings.

Also, the token shown in your command is exposed and must be reset in the Discord Developer Portal before using the bot again.

notsubhan.json
๐Ÿ“Ž 1 file 2,139 chars
๐Ÿ“„
pasted-code-1784929667807.txt
txt 37 lines
โ–ถ
(.venv) PS D:\Website\bot> python bot.py
2026-07-25 02:47:32,226 | WARNING | discord.client | PyNaCl is not installed, voice will NOT be supported
2026-07-25 02:47:32,226 | WARNING | discord.client | davey is not installed, voice will NOT be supported
2026-07-25 02:47:32 INFO     discord.client logging in using static token
2026-07-25 02:47:32,228 | INFO | discord.client | logging in using static token
Traceback (most recent call last):
  File "D:\Website\bot\bot.py", line 86, in 
    bot.run(settings.token)
    ~~~~~~~^^^^^^^^^^^^^^^^
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 933, in run
    asyncio.run(runner())
    ~~~~~~~~~~~^^^^^^^^^^
  File "C:\Program Files\Python314\Lib\asyncio\runners.py", line 204, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "C:\Program Files\Python314\Lib\asyncio\runners.py", line 127, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "C:\Program Files\Python314\Lib\asyncio\base_events.py", line 719, in run_until_complete        
    return future.result()
           ~~~~~~~~~~~~~^^
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 922, in runner
    await self.start(token, reconnect=reconnect)
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 850, in start
    await self.login(token)
  File "D:\Website\bot\.venv\Lib\site-packages\discord\client.py", line 693, in login
    await self.setup_hook()
  File "D:\Website\bot\bot.py", line 48, in setup_hook
    synced = await self.tree.sync()
             ^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Website\bot\.venv\Lib\site-packages\discord\app_commands\tree.py", line 1121, in sync       
    raise CommandSyncFailure(e, commands) from None
discord.app_commands.errors.CommandSyncFailure: Failed to upload commands to Discord (HTTP status 400, error code 50035)
In command 'unban' defined in function 'Moderation.unban'
  In parameter 'user_id'
    max_value: int53 value should be less than or equal to 9007199254740991.
(.venv) PS D:\Website\bot> 
Kodari AI
KodariJul 24 at 9:48 pm 3
  1. Change /unbanโ€™s ID option to text so Discord does not generate the invalid integer max_value.

  2. Convert and validate the ID inside the command before fetching the user.

Fixed /unban by changing user_id from an integer slash-command option to a text option. Discord will no longer generate the invalid max_value.

Restart the bot:

Powershell
python bot.py

Use the command with a Discord ID, for example:

Plain Text
/unban user_id:123456789012345678 reason:Appeal approved

The ID is validated and converted inside the command. The voice warnings are unrelated. Reset the exposed bot token before running the bot again.

Kodari can make mistakes. Review important code before using.
Files
cogs
bot.py
common.py
config.py
database.py
README.md
requirements.txt
Code
13 2,127
bot.py
import logging

import discord
from discord import app_commands
from discord.ext import commands

from config import load_settings
from database import Database


logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s | %(levelname)s | %(name)s | %(message)s",
)


class GuardianBot(commands.Bot):
    def __init__(self, database: Database):
        intents = discord.Intents.default()
        intents.members = True
        intents.message_content = True
        intents.guilds = True
        intents.moderation = True

        super().__init__(
            command_prefix="!",
            intents=intents,
            case_insensitive=True,
            help_command=None,
        )
        self.db = database

    async def setup_hook(self) -> None:
        await self.db.connect()

        extensions = (
            "cogs.moderation",
            "cogs.security",
            "cogs.automation",
            "cogs.tickets",
            "cogs.community",
            "cogs.utility",
        )

        for extension in extensions:
            await self.load_extension(extension)

        synced = await self.tree.sync()
        logging.getLogger("guardian").info(
            "Synchronized %d application commands.", len(synced)
        )

    async def close(self) -> None:
        await self.db.close()
        await super().close()


settings = load_settings()
bot = GuardianBot(Database(settings.database_path))


@bot.event
async def on_ready() -> None:
    if bot.user:
        logging.getLogger("guardian").info(
            "Logged in as %s (%s)", bot.user, bot.user.id
        )


@bot.tree.error
async def on_app_command_error(
    interaction: discord.Interaction, error: app_commands.AppCommandError
) -> None:
    logging.getLogger("guardian").exception("Application command error", exc_info=error)

    message = "Something went wrong while processing that command."
    if isinstance(error, app_commands.CommandOnCooldown):
        message = "That command is being used too quickly. Please try again."

    if interaction.response.is_done():
        await interaction.followup.send(message, ephemeral=True)
    else:
        await interaction.response.send_message(message, ephemeral=True)


bot.run(settings.token)