A compatability shim between Discord.py and Hikari.
Project description
Usage as a partial shim:
import discord
import hikari
import hikari_shim
dpy_bot = discord.Client(intents=discord.Intents.all(), enable_debug_events=True)
hikari_bot = hikari.GatewayBot("TOKEN")
@dpy_bot.event
async def on_connect():
# This is required to use REST routes :(
hikari_bot._rest.start()
@dpy_bot.event
async def on_message(message):
print("message received on discord.py side!")
@hikari_bot.listen(hikari.MessageCreateEvent)
async def hikari_on_message(evt):
print("message received on hikari side!")
hikari_shim.partial_load(dpy_bot, hikari_bot)
dpy_bot.run("TOKEN")
There's also a full (?) shim, but it runs into loop issues and whatnot. It requires you to use a hikari client with no intents and start both clients.
caveat emptor
- This does not work with
discord.AutoShardedClient
. - This has a peer dependency on discord.py, make sure to install that!
- There are some operations that are not shimmed (voice and chunking guild members, to be specific, because I do not know how to do them in dpy).
- Ratelimiting is not shared.
- You will have double the CPU usage and double the memory usage. (or something in that range).
- Some components may not have been started yet.
- More, probably.
contact me
You can find me in the Hikari Discord server.
Download from PyPI!
pip install hikari_shim
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hikari_shim-1.0.1.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for hikari_shim-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a4368a2f4afa42d71fc40669451d56b03136a1c14b6b93469dbf1a7ff4ce19f |
|
MD5 | 4741baac975ce6d389d8e5386d401be3 |
|
BLAKE2b-256 | 36a732da3b69a5fb49d15fa350bb49515cf674dddf3f7d6a4833caf883b13073 |