Go to file
Anthony Sottile c89740f1f2
Merge pull request #17 from anthonywritescode/azure_pipelines
azure pipelines
2019-11-19 10:37:22 -08:00
.activate.sh Add aactivator 2019-03-14 17:31:49 -07:00
.deactivate.sh Add aactivator 2019-03-14 17:31:49 -07:00
.gitignore Add !today and !settoday 2019-08-10 17:25:07 -07:00
.pre-commit-config.yaml azure pipelines 2019-11-19 10:24:25 -08:00
LICENSE Add a license 2019-11-16 14:31:04 -08:00
README.md azure pipelines 2019-11-19 10:24:25 -08:00
azure-pipelines.yml azure pipelines 2019-11-19 10:24:25 -08:00
bot.py Update keyboard link 2019-11-16 16:00:30 -08:00
requirements.txt Add !today and !settoday 2019-08-10 17:25:07 -07:00
setup.cfg Combine mypy.ini and setup.cfg 2019-05-08 14:21:14 -07:00

README.md

Build Status

twitch-chat-bot

A hackety chat bot I wrote for my twitch stream. I wanted to learn asyncio and this felt like a decent project to dive in on.

setup

  1. Set up a configuration file

    {
      "username": "...",
      "channel": "...",
      "oauth_token": "...",
      "client_id": "..."
    }
    
    • username: the username of the bot account
    • channel: the irc channel to connect to, for twitch this is the same as the streamer's channel name
    • oauth_token: follow the directions here to get a token
    • client_id: set up an application for your chat bot here
  2. Use python3.7 or newer and install aiohttp

    virtualenv venv -ppython3.7
    venv/bin/pip install aiohttp
    
  3. Run! venv/bin/python bot.py

implemented commands

!help

List all the currently supported commands

anthonywritescode: !help
anthonywritescodebot: possible commands: !help, !ohai, !uptime

!ohai

Greet yo self

anthonywritescode: !ohai
anthonywritescodebot: ohai, anthonywritescode!

!uptime

Show how long the stream has been running for

anthonywritescode: !uptime
anthonywritescodebot: streaming for: 3 hours, 57 minutes, 17 seconds

PING ...

Replies PONG to whatever you say

anthonywritescode: PING
anthonywritescodebot: PONG
anthonywritescode: PING hello
anthonywritescodebot: PONG hello

!discord

Show the discord url

anthonywritescode: !discord
anthonywritescodebot: We do have Discord, you are welcome to join: https://discord.gg/HxpQ3px