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.irc.start()
elif event.content == "close":
await bot.irc.close()
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.1a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 294531d630c11a5db39b2fcca71ed4fb2dc42c2c3dfadf25364ce347f2dbd26d |
|
MD5 | 08ee4d8afd890a67a26f435a37ea7e7b |
|
BLAKE2b-256 | cb2114c885c3d4fe4d2afbd067557d97952ccdb1f6d58e757edf932629f5bfa7 |