Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jazzpi/sirc
Easy-to-use IRC library with focus on the Twitch.TV IRC interface
https://github.com/jazzpi/sirc
Last synced: 11 days ago
JSON representation
Easy-to-use IRC library with focus on the Twitch.TV IRC interface
- Host: GitHub
- URL: https://github.com/jazzpi/sirc
- Owner: jazzpi
- Created: 2015-05-09T16:33:32.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-09T16:34:52.000Z (over 9 years ago)
- Last Synced: 2023-02-26T19:17:04.546Z (over 1 year ago)
- Language: Python
- Size: 97.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simply IRC
This is a easy-to-use IRC library mainly focused on the Twitch.TV IRC interface
based on asynchat. To use it, simply create a class and make it inherit from
`IRCConnection` or `TwitchIRCClient`:```python
class MyTwitchBot(TwitchIRCClient):def __init__(self, *args, **kwargs):
# Call the __init__ method in the superclass to initialize the
# connection
super().__init__(*args, **kwargs)
self.join_channel("#twitchusername")def handle_privmsg(self, channel, user, msg):
# Overwrite this method to handle chat messages
if msg.lower().startswith("!hello"):
self.queue_message(channel, "Hello {}! I'm a bot!".format(user))def handle_join(self, channel, user):
# Overwrite this method to handle users joining the chat
super().handle_join(channel, user)
self.queue_message(channel, "Welcome {} to the chat :)".format(user))def handle_part(self, channel, user):
super().handle_part(channel, user)
self.queue_message(channel, "Goobye {} :(".format(user))
```For more information on the methods, look into the source code and the
docstrings.## Dependencies
This library depends on the `asynchat` and `schedule` libraries.