TMI (Twitch Messaging Interface) library for Python.
Project description
pytmi
TMI (Twitch Messaging Interface) library for Python.
Example
Here's a little application that logs in the user using OAuth, joins the Twitch channel requested by the user, sends the message Hello, Twitch
to the chat and then leaves the channel.
import pytmi
def send_message() -> None:
username = input("Insert your Twitch username: ").lstrip()
token = input("Insert your Twitch OAuth token: ").lstrip()
channel = input("Insert the channel to join: ").lstrip()
client = pytmi.TmiClient()
client.login_oauth(token, username)
client.join(channel)
client.privmsg("Hello, Twitch")
client.logout()
if __name__ == "__main__":
try:
send_message()
except:
print("Something went wrong.")
You can find an extended example in the tests
directory.
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
pytmi-0.1.1.tar.gz
(7.9 kB
view hashes)
Built Distribution
pytmi-0.1.1-py3-none-any.whl
(10.5 kB
view hashes)