Skip to content

wojak-1234/DiscordBotProject

Repository files navigation

discord.py

discord.py Python Version License Discord

A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.


🚀 Key Features

  • Modern Pythonic API using async and await.
  • Proper rate limit handling to keep your bot running smoothly.
  • Optimised in both speed and memory.
  • Feature-rich support for the latest Discord API features.

📁 Project Structure

.
├── discord/             # Core discord.py library source
├── SKILLS/              # Skill definition for AI assistants
│   └── custom-readme-generator/ 
├── images/              # Project visual resources
├── sounds/              # Audio resources for the bot
├── main.py              # Main entry point for the bot
├── pyproject.toml       # Project configuration and dependencies
├── requirements.txt     # Python dependencies
└── README.md            # This documentation

📦 Installation

Python 3.8 or higher is required.

It is recommended to use a virtual environment.

# Basic installation
pip install -U discord.py

# With voice support
pip install -U "discord.py[voice]"

Development Version

git clone https://github.com/Rapptz/discord.py
cd discord.py
pip install -U .[voice]

💻 Quick Example

import discord

class MyClient(discord.Client):
    async def on_ready(self):
        print(f'Logged on as {self.user}')

    async def on_message(self, message):
        # don't respond to ourselves
        if message.author == self.user:
            return

        if message.content == 'ping':
            await message.channel.send('pong')

intents = discord.Intents.default()
intents.message_content = True

client = MyClient(intents=intents)
client.run('token')

🤖 Bot Example (using commands extension)

import discord
from discord.ext import commands

intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='>', intents=intents)

@bot.command()
async def ping(ctx):
    await ctx.send('pong')

bot.run('token')

🔗 Links


Made with ❤️ for the Discord community

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages