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!


Metadata

Release files for asynctwitch 4.1.0

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.1.0
File Size Uploaded Provenance Actions
asynctwitch-4.1.0.tar.gz 13.5 kB Without provenance Details for asynctwitch-4.1.0.tar.gz

Built distributions (wheels)

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

Total release size: 63.8 kB

Release files / asynctwitch-4.1.0.tar.gz

Download URL asynctwitch-4.1.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a9a6261db93ee21e863045d606df25ca6748d60dea371c9241a6cf302dc99325
BLAKE2b-256 checksum
How to use checksums
68200b051f8d5a391069cada66fb03433e7b70737af2a0fbaa1ba5623d5b0449
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / asynctwitch-4.1.0-py3.5.egg

Download URL asynctwitch-4.1.0-py3.5.egg
Size 34.3 kB
Tags Egg
SHA-256 checksum
How to use checksums
0cbc8222bfc5aad66fb033fb72345761ba155c1f5798d5dbb80dc41db9c2984e
BLAKE2b-256 checksum
How to use checksums
ba7e50ad2648742cb985424ca97f4e86dbac6feae02fcd4b71e83f0d55787c8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

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

Download URL asynctwitch-4.1.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c9cdaef7b34703e3fcce329c055cecec0ad531f0f4d537af35133a23a6c3c30
BLAKE2b-256 checksum
How to use checksums
071403ba793cc1631c6100ee9f43607dee56a30d43c91e309db88d8fdeffd19d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for asynctwitch 4.1.0

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.

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