A fast, modular, and AI-integrated Discord bot framework.
Project description
FastDC
FastDC is a powerful, modular, and AI-integrated Discord bot framework that helps you build feature-rich Discord bots effortlessly. With built-in support for multiple AI providers, command handling, moderation tools, and more, FastDC helps you go from idea to implementation in seconds.
Installation
Install FastDC via pip:
pip install fastdc
Quick Start
from fastdc import FastBot
bot = FastBot(token="YOUR_DISCORD_TOKEN")
# Setup AI providers
bot.add_ai_provider("groq", "YOUR_GROQ_API_KEY")
bot.add_ai_provider("openai", "YOUR_OPENAI_API_KEY")
# Enable AI chat with multiple providers
bot.ai_chat(provider="groq") # or "openai"
# Setup command categories and help system
bot.setup_command_categories()
# Add moderation commands
bot.add_moderation_commands()
# Add utility commands
bot.add_utility_commands()
# Setup event logging
bot.setup_event_logging()
# Auto-reply feature
bot.auto_reply(trigger="hi", response="Hello!")
# Train the bot from a local file
bot.train_bot() # Make sure 'data_train.txt' exists
# Trivia bot from json
bot.trivia_game(json_path="questions.json")
# Welcome and leave notifications
bot.welcome_member()
bot.leave_member()
# Run the bot
bot.run()
Discord Commands
AI Commands
| Command | Description |
|---|---|
!ai {prompt} |
Interact with AI using configured provider (Groq/OpenAI) |
!askbot {question} |
Ask a question based on trained data |
Games
| Command | Description |
|---|---|
!trivia |
Start trivia game |
!trivia_score |
Show trivia score |
!trivia_leaderboard |
Show trivia leaderboard |
Moderation
| Command | Description |
|---|---|
!kick @user [reason] |
Kick a user from the server |
!ban @user [reason] |
Ban a user from the server |
!clear [amount] |
Clear specified number of messages |
Utility
| Command | Description |
|---|---|
!ping |
Check bot latency |
!serverinfo |
Display server information |
!bothelp |
Show help menu with all commands |
Discord Bot Token Setup
To create your bot, follow these steps:
-
Go to the Discord Developer Portal.
-
Create a new application and add a bot.
-
Enable all Privileged Gateway Intents.
AI Integration
FastDC supports multiple AI providers:
Groq
- Visit Groq Console
- Sign in and generate your API key
OpenAI
- Visit OpenAI Platform
- Create an account and generate your API key
Training Your Bot
The train_bot() method allows your bot to respond based on your own dataset.
Simply create a file named data_train.txt in your project root with Q&A pairs.
Example format:
What is FastDC?
FastDC is a Python library for creating Discord bots quickly.
Member Join & Leave Events
Welcome and farewell messages are built-in.
bot.welcome_member()
bot.leave_member()
These functions send automatic messages to the system channel when members join or leave the server:
welcome_member()→"Hello {username}, Welcome to Server!"leave_member()→"{username} has left the server 🖐️"
Event Logging
FastDC includes a built-in logging system that tracks:
- Command usage
- Errors and exceptions
- Bot events
- AI interactions
Logs are formatted and can be easily integrated with your preferred logging system.
Contribution
Contributions are welcome!
If you have ideas for improvements or new features, feel free to open an issue or submit a pull request.
License
Licensed under the MIT License.
Github
Note :
- This project will be updated regularly with new features and improvements
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastdc-1.5.tar.gz.
File metadata
- Download URL: fastdc-1.5.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6c1ee503058c892de63fb80e8372d039f6b36ce03646e35930778d047f6b406
|
|
| MD5 |
9a8cb0636edef55974be9e5632d1aaf8
|
|
| BLAKE2b-256 |
f2f7970698c12a4380f0564b2562572e2fdbf89bc1b077e3d2aa4fd85a25f952
|
File details
Details for the file fastdc-1.5-py3-none-any.whl.
File metadata
- Download URL: fastdc-1.5-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f9b147cc0af6dac4f5f0cfd2f46f32933b0bd0c9f5f1815d72733b1da76a7fe
|
|
| MD5 |
fda67659e8806cae75cafeb2014fbd83
|
|
| BLAKE2b-256 |
1768a64dfec3c6a52ab2a8ba3d2d13ce5559e7bcc1d984d36242e43efb3af3c9
|