FastDC: A fast, modular, and AI-integrated Discord bot framework.
Project description
⚡ FastDC
FastDC is a lightweight and powerful Python library designed to help you build Discord bots effortlessly. With built-in support for command handling, AI chat, bot training, 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")
# Auto-reply feature
bot.auto_reply(trigger="hi", response="Hello!")
# Enable AI chat with Groq API
bot.ai_chat(api_key_usr="YOUR_GROQ_API_KEY")
# Train the bot from a local file
bot.train_bot() # Make sure 'data_train.txt' exists
# Welcome and leave notifications
bot.welcome_member()
bot.leave_member()
# Run the bot
bot.run()
💬 Discord Commands
| Command | Description |
|---|---|
!askbot {question} |
Ask a question based on trained data (data_train.txt) |
!ai {prompt} |
Interact with an AI using Groq API |
🔑 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.
🧠 Groq AI API Key
To use the !ai command, you'll need an API key from Groq:
- Visit Groq Console
- Sign in 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:
Q: What is FastDC?
A: 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 🖐️"
👀 Preview
🙌 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.
❤️ Support
If you like this project, consider giving it a ⭐ on GitHub or sharing it with others!
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.1.tar.gz.
File metadata
- Download URL: fastdc-1.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57b115360867bb1f1d73f0ada75f9c140037d8488c832ee25332a46cf6a0a5da
|
|
| MD5 |
139ed8cb6020394c66d462d7d8982530
|
|
| BLAKE2b-256 |
19d44300a29d5d6ce82388f122cc8bb3fb3b5e60bb4cf34b9dc2de59c1324164
|
File details
Details for the file fastdc-1.1-py3-none-any.whl.
File metadata
- Download URL: fastdc-1.1-py3-none-any.whl
- Upload date:
- Size: 5.8 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 |
fa29577aaafa8b931a39e8a5fee90d98d841da7ba8951049cdd2651b333edbb7
|
|
| MD5 |
e59cc7b3b0babdc8e4eb2d365a42963b
|
|
| BLAKE2b-256 |
4b5ea1ed5b49f657f93273be89a049e46a15bfd5aee9bb1496cb347edfd0bfc8
|