AsyncIRCClient
Async (Twitch-) IRC client
First async code so takee everything with a bit of caution
Installation
pip install AsyncIRCClient
Example usage
from loguru import logger
from async_irc_client.async_irc_client import TwitchIRCBot, Message
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}")
@TwitchIRCBot.command("alias_test", aliases=["alias_1", "alias_2"])
async def alias_test_command(self, message: Message) -> None:
self.send_chat_message("Call as alias!")
# when using case-insensitive commands you may not use
# any other command with the same name as any case-insensitive combination
# works with aliases
@TwitchIRCBot.command("case_insensitive", case_sensitive=False)
async def case_insensitive_command(self, message: Message) -> None:
self.send_chat_message("Case insensitive")
# 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")
# repeat a task at given time
# is 1 second delayed to prevent double trigger inaccuracies
@TwitchIRCBot.loop(time="08:36")
async def my_timed_task(self):
logger.info("Hello World at 08:36")
if __name__ == "__main__":
from async_irc_client import Proxy, ProxyType
MyBot(
oauth_token="YOURTOKEN",
nick_name="BOTNAME",
channel="CHANNELNAME",
proxies=[
Proxy(ProxyType.HTTP, "ip", 1234),
Proxy(ProxyType.HTTP, "ip", 1234, password="password", username="username"),
Proxy.from_url("proxy_url")
]
).mainloop() # alternatively use .run() to run the bot non blocking.
Metadata
Release files for AsyncIRCClient 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| asyncircclient-1.0.3.tar.gz | 11.2 kB | Without provenance | Details for asyncircclient-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| AsyncIRCClient-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for AsyncIRCClient-1.0.3-py3-none-any.whl |
Total release size: 22.9 kB
Release files / asyncircclient-1.0.3.tar.gz
| Download URL | asyncircclient-1.0.3.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f3a144c60226b6f3c369d873a8fc299dbdffa25e1ffbc775a5c556769a6c41f
|
|
BLAKE2b-256 checksum How to use checksums |
9aa462a3a617654a43b0d67f9e227d1a0dd59068d8c86c1bcbf9eaf3175e0a1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.21
|
Release files / AsyncIRCClient-1.0.3-py3-none-any.whl
| Download URL | AsyncIRCClient-1.0.3-py3-none-any.whl |
|---|---|
| Size | 11.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a9179a29c9872eccd2aa605cfe328adad1026f4f4efdba68701545bec43238df
|
|
BLAKE2b-256 checksum How to use checksums |
ec85cdc95c9aeee2badf54ec94f310f2078d2737344346d24fbfc0dbcfdf82ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.21
|
Security for AsyncIRCClient 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.