Skip to main content

Fastdc is a library designed to make creating Discord bots easier.

Project description

PyPI - Version PyPI - Downloads

FastDC is a library designed to make creating Discord bots easier. FastDC has been downloaded over 2,000 times according to Pepy statistics.


Installation

Install FastDC via pip:

pip install fastdc

Quick Start

from fastdc import FastBot

bot = FastBot(token="YOUR_DISCORD_TOKEN")

# Setup AI, You can use groq or openai
bot.add_ai_provider("groq", "YOUR_GROQ_API_KEY")
bot.add_ai_provider("openai", "YOUR_OPENAI_API_KEY")

# Enable AI 
bot.ai_chat(provider="groq")  # or u can use 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
bot.auto_reply(trigger="hi", response="Hello!")

# Train the bot from a local file
bot.train_bot()  

# Welcome and leave notifications
"""
If {member} is not included in the message, the bot will use the default welcome message.

Default Welcome Message = "Hello {member}, welcome to Server!"
Default Leave Message = "{member} has left the server"
"""
bot.welcome_member(message="Helloww, welcome {member}")
bot.leave_member(message="Goodbye {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

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:

  1. Go to the Discord Developer Portal.
  2. Create a new application and add a bot.
  3. Enable all Privileged Gateway Intents.

AI Integration

FastDC supports multiple AI providers:

Groq

OpenAI


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 leave message

bot.welcome_member()
bot.leave_member()

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.


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

fastdc-1.7.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastdc-1.7-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file fastdc-1.7.tar.gz.

File metadata

  • Download URL: fastdc-1.7.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for fastdc-1.7.tar.gz
Algorithm Hash digest
SHA256 9549be302b6248e070fb7a8b4d4bfba7104bc051ad99142ef5285b0eb8b8004d
MD5 c723b437ac3a43b0dcad59f4f81d28ac
BLAKE2b-256 c88222f851f8fc23870684a868d77fd9f02c849832f427000f64755a22feb89c

See more details on using hashes here.

File details

Details for the file fastdc-1.7-py3-none-any.whl.

File metadata

  • Download URL: fastdc-1.7-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for fastdc-1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 38d798c49e77df0e62dc8b330112b6df63bb04e55466c0885b421c97190a69ba
MD5 22737f22d47b34d15b738dc9aac60c7a
BLAKE2b-256 e00027f405385bf4e3635180f81f1cbcce5423298da1ef7b6d6412e295eef783

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page