Lefi
A discord API wrapper focused on clean code, and usability
Installation
-
Poetry
poetry add git+https://github.com/an-dyy/Lefi.git --no-dev
Note: if you plan on contributing, omit the
--no-dev
flag. -
Pip
pip install git+https://github.com/an-dyy/Lefi.git
Note: After stable the wrapper will get a pip package rather then requiring to install from git
Example(s)
import os
import asyncio
import lefi
async def main() -> None:
token = os.getenv(
"discord_token"
) # NOTE: I'm on linux so I can just export, windows might need a `.env`
client = lefi.Client(token) # type: ignore
@client.once("ready")
async def on_ready(client_user: lefi.User) -> None:
print(f"LOGGED IN AS {client_user.id}")
@client.on("message_create")
async def on_message_create(message: lefi.Message) -> None:
print(message)
await client.start()
asyncio.run(main())
Documentation
Contributing
- If you plan on contributing please open an issue beforehand
- Install pre-commit hooks (makes it a lot easier for me)
pre-commit install
Flowchart for release
Contributors
- blanketsucks - collaborator
- an-dyy - creator and maintainer