Getting started
Installation
If you are unfamiliar with pip
, the Python package manger you can read
more here.
Stable release
pip install yami
# Alternatively
python -m pip install yami
Development
pip install git+https://github.com/Jonxslays/Yami.git
# Alternatively
python -m pip install git+https://github.com/Jonxslays/Yami.git
Speedups
There are some optional speedups that can be installed.
These are well documented in the Hikari README.
uvloop:
pip install uvloop
A replacement for the asyncio event loop.
Only available on UNIX-like operating systems.
-
Installs
aiodns
,cchardet
,brotli
, andciso8601
.Requires a working C compiler on the system.
Yami can be installed with speedups automatically as well using
pip install "yami[speedups]"
Create a Bot
Make sure you have a bot token, obtained from the Discord developer portal.
from os import environ
import hikari
import yami
bot = yami.Bot(environ["TOKEN"], "$", allow_extra_args=True)
@bot.listen(hikari.StartedEvent)
async def on_started(_: hikari.StartedEvent) -> None:
print(f"Bot is ready. Latency: {bot.heartbeat_latency}")
if __name__ == "__main__":
bot.run()