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.

Source Distribution

lightdiscord-1.3.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

lightdiscord-1.3.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file lightdiscord-1.3.1.tar.gz.

File metadata

  • Download URL: lightdiscord-1.3.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20210325 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.8

File hashes

Hashes for lightdiscord-1.3.1.tar.gz
Algorithm Hash digest
SHA256 7acae500aa2f9bb4f7ac3d95fe1402723877e4ec9dc5afb61a0a49a2d1bb91b1
MD5 c07de70eec3ad3ed019a1b777faf8aea
BLAKE2b-256 43886edb667dcfa4e73f7e6fcac86db88288a6db788b3b0cc25fc222cdc635b3

See more details on using hashes here.

File details

Details for the file lightdiscord-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: lightdiscord-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20210325 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.8

File hashes

Hashes for lightdiscord-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 549678f7eb5cf8271bb17e882999b35f5e70f88af1362a8f75fa3dc5b3366213
MD5 36ab0a0ebc5b44ba435b55537fbfd520
BLAKE2b-256 82f5eade35110f06c7c321c1fe4bf6d0eb878283066361255b3119c0743f08ed

See more details on using hashes here.

Supported by

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