Skip to main content
AsyncTwitch
=======================

This library is used to asynchronously interact with twitch chat.

----

Requirements:

- Create a twitch.tv account
- Get an Oauth token

----

How to use:

```python
import asynctwitch

# Use the pre-made CommandBot, to handle messages yourself, use asynctwitch.Bot and handle event_message.
bot = asynctwitch.CommandBot(
user = "Your_bot_twitch_username",
oauth = "Your_twitch_oauth_token", # oauth:1234567890abcdefghijklmnopqrst
channel = "channel_name", # Defaults to Twitch
prefix = "your_prefix_here", # Defaults to '!'
)



# Example command:
@bot.command('example', alias=['moreexample','anothaone'], desc='example command')
async def example(message, word1:str, number1:int, rest:str):
bot.say('wow')



# Example subcommand:
@bot.command('say')
async def say(m, subcommand:str):
pass

@say.subcommand('this')
async def this(m):
bot.say("that")

bot.start()
```

To use a config file instead, use
```python
asynctwitch.Bot(config="your_settings.ini")
# or
asynctwitch.CommandBot(config="your_settings.ini")
```
see config.ini for an example file


It's also possible to handle messages your own way, just use

```python
@bot.override
async def event_message(message):
# your handling here
```

The same applies to all bot.event_X functions.


To use `await bot.play_file('file.mp3')`, ffprobe, ffmpeg and ffplay have to be installed. They can be found on the ffmpeg website.

To use `await bot.play_ytdl('song')`, youtube_dl has to be installed. Use `pip install youtube_dl` to install it.
You will also need the requirements for `bot.play_file`


These examples use the `async/await` syntax added in python 3.5, to use this code in 3.4 use `@asyncio.coroutine` and `yield from` instead.
THIS DOES NOT WORK WITH PYTHON VERSIONS BELOW 3.4!


Release files for asynctwitch 4.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asynctwitch 4.2.1
File Size Uploaded
asynctwitch-4.2.1.tar.gz 14.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for asynctwitch 4.2.1
File Interpreter ABI Platform
asynctwitch-4.2.1-py3.6.egg Legacy Egg format - - Details
asynctwitch-4.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 68.6 kB

Release files / asynctwitch-4.2.1.tar.gz

Download URL asynctwitch-4.2.1.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6f994ddc54358ea6daf09f0c65ed26060e91ea00083bb0393cc12b247096f154
BLAKE2b-256 checksum
How to use checksums
79ac7f1846d6a35b6d3d9a5edb65a1018427e1bd65db1d547bca45488289df96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / asynctwitch-4.2.1-py3.6.egg

Download URL asynctwitch-4.2.1-py3.6.egg
Size 36.7 kB
Tags Egg
SHA-256 checksum
How to use checksums
837ba00b153d08aaec1403602a77eda762f6c1bbad726890a42a9214d7e83d81
BLAKE2b-256 checksum
How to use checksums
87725f7171886f7e0067c7a7d19426821550ee17660a4541cda2cc0f4ba1ed3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / asynctwitch-4.2.1-py3-none-any.whl

Download URL asynctwitch-4.2.1-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
555f970f9029bef71f652d1ebbaf1b5c2cfdab0b581b3d2b4ac5535a3ce29fbb
BLAKE2b-256 checksum
How to use checksums
5fabb653a1673ad423d35cb425ef642ea9541baa387bf4128df8f11fb2f269bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

4.2.1 This release

3 release files

4.2.0

3 release files

4.1.1

3 release files

4.1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page