Skip to main content

A small pythonic alternative to discord.py

Project description


LightDiscord

🤖 An ultra light library to develop discord bots with Python

Get lightdiscord

To install the library, you can just run the following command:

# Linux/macOS
python3 -m pip install -U lightdiscord

# Windows
py -3 -m pip install -U lightdiscord

Key features

:warning: If the size of the library and the proximity with the discord api is not absolutely necessary for you, https://github.com/Rapptz/discord.py may be a better option.

  • Easy to use and quick to learn
  • Currently the smallest alternative to discord.py
  • Support custom listeners
  • Support multiple bot instances
  • Full support for Bot and User accounts
  • Support proxies
  • Customizable user agent
  • Low level: directly interact with the discord api and manage cache as you want

How to use?

First, you need to import lightdiscord. You can then create a bot object, specify a token and optional features:

  • user: A boolean (True for user accounts, False by default)
  • listeners: A dictionnary containing your events listeners and the API endpoint
  • proxy: A proxy (None for no proxies, None by default)
  • user_agent: The user agent sent to discord
bot = lightdiscord.Bot(
    "YOUR_TOKEN", listeners={"READY": on_ready}
)

To start the bot, you need to use an async function. Here is an example with asyncio

import asyncio

async def main(loop):
    await bot.start()

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main(loop))
    loop.run_forever()

You can check https://github.com/Th0rgal/lightdiscord/blob/master/example.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for lightdiscord, version 1.3.1
Filename, size File type Python version Upload date Hashes
Filename, size lightdiscord-1.3.1.tar.gz (9.8 kB) File type Source Python version None Upload date Hashes View
Filename, size lightdiscord-1.3.1-py3-none-any.whl (5.0 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page