Async IRC Client
Project description
AsyncIRCClient
Async (Twitch-) IRC client
First async code so takee everything with a bit of caution
Example usage
from async_irc_client.async_irc_client import TwitchIRCBot, Message
from loguru import logger
class MyBot(TwitchIRCBot):
# subscribe to twitch's irc events
async def on_client_ready(self, message: Message) -> None:
logger.info("Bot is Ready")
# create commands
@TwitchIRCBot.command("test")
async def test_command(self, message: Message) -> None:
self.send_chat_message(f"Hello World {message.source.nick}")
# mod only command
@TwitchIRCBot.command("mod_test", mod_only=True)
async def mod_test_command(self, message: Message) -> None:
self.send_chat_message(f"Hello World mod {message.source.nick}")
# repeat a task
# runs once the client is ready and after the specified time interval
# here 1000s
@TwitchIRCBot.loop(1000)
async def my_task(self):
logger.info("Hello World")
if __name__ == "__main__":
MyBot(oauth_token="YOURTOKEN", nick_name="BOTNAME", channel="CHANNELNAME").run()
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
AsyncIRCClient-0.0.4.tar.gz
(8.3 kB
view hashes)
Built Distribution
Close
Hashes for AsyncIRCClient-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df7e8b8570af21c9519c6ed5fe3f290d3c62b6db3565a38489dd174433bdbdf5 |
|
MD5 | d021b7421ef206d40b75aeef4ba207d9 |
|
BLAKE2b-256 | 2a8776be1b2fe2da22996aad0fde3cff4894a3535828768743360952df4694e3 |