A feature-rich Discord bot with multiple functionalities, including message logging, welcome messages, polls, role assignment, reminders, and moderation tools.
- Welcome Messages: Automatically sends a direct message to new members when they join the server.
- Message Logging: Logs all server messages in an SQLite database for analysis and auditing.
- Poll Creation: Users can create polls with up to 10 options.
- Reminder System: Users can set reminders with a custom message and time.
- Role Assignment: Admins can set up reaction-based role assignment for users.
- Moderation Tools: Includes
!kick
and!ban
commands for admins. - Bot Info: Displays bot details such as server count and name.
- Fetch Logs: Retrieves the last N logged messages from the database.
- Python 3.8+: Ensure Python is installed on your machine.
- Discord Bot Token: Create a bot at the Discord Developer Portal and get the token.
- Clone the repository:
git clone https://github.com/AmirGhorbaniDev/DiscordBotProject.git cd DiscordBotProject
pip install discord.py
python -c " import sqlite3; conn = sqlite3.connect('discord_bot.db'); cursor = conn.cursor(); cursor.execute('CREATE TABLE IF NOT EXISTS messages (id INTEGER PRIMARY KEY, user_id TEXT, username TEXT, message_content TEXT, channel_name TEXT, timestamp TEXT)'); cursor.execute('CREATE TABLE IF NOT EXISTS reminders (id INTEGER PRIMARY KEY, user_id TEXT, username TEXT, reminder_text TEXT, remind_at TEXT)'); conn.commit(); conn.close(); "
python bot.py
!botinfo: Displays information about the bot. !poll ...: Creates a poll with up to 10 options. !remind : Sets a reminder (units: seconds, minutes, hours). !reactrole : Sets up a reaction role. !fetch_logs : Fetches the last N logged messages. Moderation: !kick @user : Kicks a user from the server. !ban @user : Bans a user from the server.
DiscordBotProject/ ├── bot.py # Main bot script ├── discord_bot.db # SQLite database (created at runtime) ├── README.md # Project documentation └── requirements.txt # Dependencies