A bridge between Discord and Twitch chat.
Project description
hikari-kasai
A bridge between Discord and Twitch chat.
Installation
To install the latest stable version of hikari-kasai, use the following command:
pip install hikari-kasai
You can also install the latest development version using the following command:
pip install git+https://github.com/parafoxia/hikari-kasai
You may need to prefix these commands with a call to the Python interpreter depending on your OS and Python configuration.
Usage
All methods relating to Twitch can be accessed through bot.irc
.
hikari-kasai officially supports Hikari, as well as the Lightbulb and Crescent command handlers:
kasai.GatewayApp(...)
kasai.LightbulbApp(...)
kasai.CrescentApp(...)
However, you can use hikari-kasai, with any command handler you like, so long as it doesn't conflict. To do this, you can create a subclassed bot:
import kasai
import lightbulb
class Bot(kasai.GatewayApp, lightbulb.BotApp):
...
bot = Bot(...)
Providing you inherit from GatewayApp
first, you do not need to provide an __init__
.
A full working implementation could look something like this:
import hikari
import kasai
# This can also be LightbulbApp or CrescentApp.
bot = kasai.GatewayApp(
discord_token,
irc_token,
channel,
nickname,
**[kwargs for superclass],
)
@bot.listen(hikari.GuildMessageCreateEvent)
async def on_message(event):
if event.content == "start":
await bot.start_irc()
elif event.content == "close":
await bot.close_irc()
elif event.content.startswith("send"):
await bot.irc.create_message(event.content[5:])
@bot.listen(kasai.IrcMessageCreateEvent)
async def on_irc_message(event):
print(f"{event.user} said: {event.content}")
bot.run()
Contributing
Contributions are very much welcome! To get started:
- Familiarise yourself with the code of conduct
- Have a look at the contributing guide
License
The hikari-kasai module for Python is licensed under the BSD 3-Clause License.
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
Built Distribution
Hashes for hikari_kasai-0.3a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81248e7fbcae776f53c59e2f99a98fe7802daf38147ff4c00ecada82cc288cb6 |
|
MD5 | 5272769ed1ac6491fdb44a4200aa9b35 |
|
BLAKE2b-256 | 7acb26ee54554cf6f81d4afcd03a2c1784fa154d133f6ae46e02c91a46e8159c |