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.2a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ce9952559ad285da39275c5ea4809d33d40c82c544dae194d355f4d89282f57 |
|
MD5 | c8eae845f1219d08e7b681d32f9c1f66 |
|
BLAKE2b-256 | 496c7e9c5520c6b1816126ed9e61f5baeda5424b59ef9169eda51d6c2e4da7d7 |