{ "info": { "author": "jspaulsen", "author_email": "jspaulsen@github.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6" ], "description": "# python-twitch-irc\n`python-twitch-irc` is a layer of logic which takes the [Pydle] package and provides (or modifies existing) logic to handle Twitch IRC pecularities.\n\n## Installation\n`python-twitch-irc` can be installed via `pip install python-twitch-irc`\n\n## Usage\n`python-twitch-irc` is a layer which sits above `Pydle` so if documentation is lacking, refer to `Pydle` documentation. Twitch IRC is not fully compliant with RFC1459 and later, so some behaviors may not function as expected (such as who/whois, nick, etc).\n\n### Twitch\nUtilizing this library requires a Twitch account and a token generated for that account. A token can be generated via [TwitchApps]. Note that the generated token has the prefix 'oauth' which should be removed before use.\n\n#### Rate Limiting\n`TwitchIrc` does not provide rate limiting. To see rates and limits, see [Twitch Irc Guide].\n\n### Basic Usage\n`TwitchIrc` is expected to be used as a base class.\n```python\nfrom python_twitch_irc import TwitchIrc\n\n# Simple echo bot.\nclass MyOwnBot(TwitchIrc):\n def on_connect(self):\n self.join('#best_streamer')\n\n # Override from base class\n def on_message(self, timestamp, tags, channel, user, message):\n self.message(channel, message)\n\nclient = MyOwnBot('MyBot', 'MyTwitchOAuthToken').start()\nclient.handle_forever()\n```\n### Pydle IRC Functionality\nMost of the Basic IRC functionality can be found via [Pydle Documentation]. It shold be noted that not all functionality provided by `Pydle` is compatible with Twitch IRC. \n\n### Twitch IRC functionality\n`TwitchIrc` provides the following additional functionality. These functions may or may not require permissioning per channel.\n``` python\ndef start(self):\n # Starts the connection the Twitch IRC servers\n\ndef stop(self):\n # Stops connection to Twitch IRC servers\n\ndef whisper(self, user, message):\n # Sends a whisper to a user\n\ndef message(self, target, message):\n # Sends a message to a channel or whisper to a user\n\ndef action(self, target, message):\n # Performs the IRC ' ACTION'\n # * John slaps Jim around a bit with a large trout\n\ndef timeout(self, channel, user, seconds, reason=None):\n # Times a user out for specified seconds from a channel\n\ndef ban(self, channel, user, reason=None):\n # Permanently bans a user from a channel\n\ndef unban(self, channel, user):\n # Unbans a user from a channel\n\ndef slow(self, channel, seconds):\n # Sets the message rate of a channel to specified seconds\n\ndef slow_off(self, channel):\n # Turns off slowmode\n\ndef followers(self, channel, restrict):\n # Sets a channel to follower mode only. Restrict should be set to values as\n # defined here: https://help.twitch.tv/customer/portal/articles/659095-chat-moderation-commands\n\ndef followers_off(self, channel):\n # Turns off follower mode in a channel\n\ndef subscribers(self, channel):\n # Turns on subscriber mode in a channel\n\ndef subscribers_off(self, channel):\n # Turns off subscriber mode in a channel\n\ndef clear(self, channel):\n # Clears the chat history in a channel\n\ndef r9kbeta(self, channel):\n # Turns on r9kbeta mode in a channel\n\ndef r9kbeta_off(self, channel):\n # Turns off r9kbeta mode in a channel\n\ndef emoteonly(self, channel):\n # Turns on emote only mode in a channel\n\ndef emoteonly_off(self, channel):\n # Turns off emote only mode in a channel\n\ndef commercial(self, channel, seconds=30):\n # Runs a commercial in the channel. Seconds should be an appropriate value\n # defined here: https://help.twitch.tv/customer/portal/articles/659095-chat-moderation-commands\n\ndef host(self, channel, target):\n # Hosts a channel\n\ndef unhost(self, channel):\n # Stops hosting a channel\n\ndef mod(self, channel, user):\n # Gives moderation powers to user in channel\n\ndef unmod(self, channel, user):\n # Removes moderation powers from user in channel\n```\n### Twitch IRC Callbacks\n`TwitchIRC` provides callbacks which can be overriden. Their purpose/meaning can be divined from [Twitch Irc Guide].\n```python\ndef on_cleared_chat(self, timestamp, tags, channel):\n pass\n\ndef on_channel_ban(self, timestamp, tags, channel, user):\n pass\n\ndef on_hosting(self, timestamp, host, hostee, viewers):\n pass\n\ndef on_stop_hosting(self, timestamp, host, viewers):\n pass\n\ndef on_notice(self, timestamp, tags, channel, message):\n pass\n\ndef on_reconnect_cmd(self, timestamp):\n pass\n\ndef on_roomstate(self, timestamp, tags, channel):\n pass\n\ndef on_usernotice(self, timestamp, tags, channel, message):\n pass\n\ndef on_userstate(self, timestamp, tags, channel):\n pass\n\ndef on_whisper(self, timestamp, tags, user, message):\n pass\n\ndef on_message(self, timestamp, tags, channel, user, message):\n pass\n```\n\n### Capabilities\nBy default, capabilities are enabled. To disable capabilities, override the following functions and return `False`:\n``` python\ndef on_capability_twitch_tv_membership_available(self, value):\ndef on_capability_twitch_tv_tags_available(self, value):\ndef on_capability_twitch_tv_commands_available(self, value):\n```\n## Development\nDevelopment environment utilizes `docker` and `docker-compose` for building and testing the library.\n### Building\nThe `python_twitch_irc` library can be build via `./build.sh`\n### Testing\nThe unit tests can be run via `./test.sh`. Local changes can be tested without rebuilding the test container via `./test-dev.sh` but requires that the initial test container be built.\n\n[Pydle]: \n[Pydle Documentation]: \n[TwitchApps]: \n[Twitch Irc Guide]: \n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jspaulsen/python-twitch-irc", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "python-twitch-irc", "package_url": "https://pypi.org/project/python-twitch-irc/", "platform": "", "project_url": "https://pypi.org/project/python-twitch-irc/", "project_urls": { "Homepage": "https://github.com/jspaulsen/python-twitch-irc" }, "release_url": "https://pypi.org/project/python-twitch-irc/1.1.0/", "requires_dist": [ "pydle", "pendulum" ], "requires_python": "", "summary": "Python Library for Twitch IRC eccentricities", "version": "1.1.0" }, "last_serial": 4240952, "releases": { "1.0.2": [ { "comment_text": "", "digests": { "md5": "19cbfedcf4f805bd5b90f05a7786306c", "sha256": "3d3b64331a3c3b92c0b69c9b294642246a0f569f1e702b0a9716bdf1dc7ef1fa" }, "downloads": -1, "filename": "python_twitch_irc-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "19cbfedcf4f805bd5b90f05a7786306c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6113, "upload_time": "2018-08-12T16:28:15", "url": "https://files.pythonhosted.org/packages/c6/62/1fac60cf2ed36f0bf9dd0c744a707ba27a8a5e9e234288f97437d43949d5/python_twitch_irc-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "95d08ab8695ff3912fa801e74943b7b1", "sha256": "ba67a532d10c4ce2acde1f9bb265fbd18d9e105b197ff3489a3a121c9da63142" }, "downloads": -1, "filename": "python-twitch-irc-1.0.2.tar.gz", "has_sig": false, "md5_digest": "95d08ab8695ff3912fa801e74943b7b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5693, "upload_time": "2018-08-12T16:28:16", "url": "https://files.pythonhosted.org/packages/ce/95/e12ff8627c5f49440b16d781458a473fc9d8e725afd78e3a9a0fdfebaabf/python-twitch-irc-1.0.2.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "eced7eb0b15d97d19138a79503fa0299", "sha256": "3b30649f0ffdd2969ad4354b9e1eefe246378c57200f157df7662eee80ad25ad" }, "downloads": -1, "filename": "python_twitch_irc-1.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "eced7eb0b15d97d19138a79503fa0299", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6176, "upload_time": "2018-09-04T19:07:25", "url": "https://files.pythonhosted.org/packages/fd/34/22759225f02d563cce8643d9992f1f8b9be0ceac162266cf62310ee936e2/python_twitch_irc-1.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f442293171441aec4c4524256ffd82ba", "sha256": "2bced1ddf0beea9f06c874e6650c387cf27687d6082351484c0de746fb4a619c" }, "downloads": -1, "filename": "python-twitch-irc-1.0.6.tar.gz", "has_sig": false, "md5_digest": "f442293171441aec4c4524256ffd82ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5749, "upload_time": "2018-09-04T19:07:27", "url": "https://files.pythonhosted.org/packages/70/2c/cfdd28b772e47fc152852b2436c1ef896b786c0e3bd657e69acba000aaaa/python-twitch-irc-1.0.6.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "1dfaa0f434fc4a2002f496c2c73faeb9", "sha256": "f3d86e9fd502f46c3e402825d15dd6c84c1498365cc549eb493dbb70313bd726" }, "downloads": -1, "filename": "python_twitch_irc-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1dfaa0f434fc4a2002f496c2c73faeb9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6172, "upload_time": "2018-09-05T13:26:56", "url": "https://files.pythonhosted.org/packages/96/9a/0d64ad36e53105314b932d8477bc4b6099c3ba8a0ec0acc4d11577d67d6d/python_twitch_irc-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "39078317a1937a244859eeb1a819b21a", "sha256": "4af8ac9e2a82975bb019edde59ef2d714532e18a3599979784aa1f1a61164ae2" }, "downloads": -1, "filename": "python-twitch-irc-1.1.0.tar.gz", "has_sig": false, "md5_digest": "39078317a1937a244859eeb1a819b21a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5748, "upload_time": "2018-09-05T13:26:57", "url": "https://files.pythonhosted.org/packages/ba/3b/1afc31320f20c499d7ec49215ddfc9b0e8e9ad0c8844b9508e52ae773335/python-twitch-irc-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1dfaa0f434fc4a2002f496c2c73faeb9", "sha256": "f3d86e9fd502f46c3e402825d15dd6c84c1498365cc549eb493dbb70313bd726" }, "downloads": -1, "filename": "python_twitch_irc-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1dfaa0f434fc4a2002f496c2c73faeb9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6172, "upload_time": "2018-09-05T13:26:56", "url": "https://files.pythonhosted.org/packages/96/9a/0d64ad36e53105314b932d8477bc4b6099c3ba8a0ec0acc4d11577d67d6d/python_twitch_irc-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "39078317a1937a244859eeb1a819b21a", "sha256": "4af8ac9e2a82975bb019edde59ef2d714532e18a3599979784aa1f1a61164ae2" }, "downloads": -1, "filename": "python-twitch-irc-1.1.0.tar.gz", "has_sig": false, "md5_digest": "39078317a1937a244859eeb1a819b21a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5748, "upload_time": "2018-09-05T13:26:57", "url": "https://files.pythonhosted.org/packages/ba/3b/1afc31320f20c499d7ec49215ddfc9b0e8e9ad0c8844b9508e52ae773335/python-twitch-irc-1.1.0.tar.gz" } ] }