Skip to main content

A simple Discord bot package.

Project description

🚀 Introducing Barrel – The Ultimate Discord Bot Package! 🚀

Barrel is a lightweight and powerful custom Discord bot package designed for simplicity and efficiency. With Barrel, you can easily manage commands, handle errors, and customize your bot's interactions with Discord's API.

Features:

  • Custom Commands: Easily add and manage commands for your bot.
  • Seamless Integration: Connects smoothly with Discord’s API.
  • Error Handling: Built-in error handling to ensure smooth operation.
  • Embed Support: Create and send rich embeds for enhanced message formatting.
  • Latency Checking: Built-in command to check the bot's latency.

📦 Installation

To install Barrel, use pip:

pip3 install barrel.py

🛠 Usage Instructions

1. Basic Setup

Create a new Python file for your bot, e.g., main.py.

# main.py
from barrel import Bot  # Importing the Bot class

# Initialize the bot (create an instance of the Bot class)
barrel_bot = Bot(command_prefix="!")  # Command prefix defaults to "!" if not provided

# Register a simple command
@barrel_bot.command()
async def greet(ctx):
    """Command to greet users with an embed."""
    title = "Greetings from BarrelBot!"
    description = "This is a message sent using an embed."
    await barrel_bot.send_embed(ctx, title, description)

@barrel_bot.command()
async def my_command(ctx):
    await ctx.send("This is a custom command!")

# Run the bot with your bot token
barrel_bot.run('YOUR_BOT_TOKEN_HERE')  # Replace with your actual bot token

2. Adding Custom Commands

To add custom commands to your bot:

Define a command using the @barrel_bot.command() decorator:

# main.py
@barrel_bot.command()
async def my_command(ctx, *args):
    """Your custom command description."""
    # Your command logic here
    await ctx.send("This is a custom command!")

3. Running the Bot

To run your bot:

Make sure your main.py includes:

# main.py
if __name__ == "__main__":
    barrel_bot.run('YOUR_BOT_TOKEN_HERE')  # Replace with your actual bot token

Execute your script:

python3 main.py

Feel free to replace 'YOUR_BOT_TOKEN_HERE' with your actual bot token when running the bot.

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

barrel_py-0.4.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

barrel.py-0.4-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file barrel_py-0.4.tar.gz.

File metadata

  • Download URL: barrel_py-0.4.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for barrel_py-0.4.tar.gz
Algorithm Hash digest
SHA256 4e8fd28cbe85df56ce721b76f95149ec3c20bb54e1d9caaaf03347596d8b9718
MD5 304b4c1887a47ed5968617a1358ca5af
BLAKE2b-256 bcc767d592e106a08f455adf4cb646edd41b11540f1ee0417161c521141a51cb

See more details on using hashes here.

File details

Details for the file barrel.py-0.4-py3-none-any.whl.

File metadata

  • Download URL: barrel.py-0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for barrel.py-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3987eac07d168ff5ffb6adb722acf07ba65e88cdcbb7df4b530cdfea0844d802
MD5 3f66b2c34a50bef9f05c8a73d1897cef
BLAKE2b-256 cca22fb9c1016528d9c7f1fa75dc0a401f7270d0923b00e46f4fb5977f59c8f3

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