A free, minimal, lightweight, cross-platform, easily expandable Twitch IRC/API bot.

Overview

parky's twitch bot

A free, minimal, lightweight, cross-platform, easily expandable Twitch IRC/API bot.

License: GPL v3 Made with love Downloads

Features

  • 🔌 Connect to Twitch IRC chat!
  • 🔌 Connect to Twitch API! (change game, title)
  • 🔊 Play custom sounds!
  • Make your own plugins with 5 lines of Python code! 🐍

Windows (8, 8.1, 10) 💾

Get @ Releases page

Linux 🐧

You may use the following live script to install this app on your machine.
Open a terminal and choose your favourite method below to install:

Using "wget"

sh -c "$(wget https://raw.githubusercontent.com/parklez/twitch-bot/master/scripts/install.sh -O -)"

Using "curl"

sh -c "$(curl -fsSL https://raw.githubusercontent.com/parklez/twitch-bot/master/scripts/install.sh)"

MacOS 🍎

See running locally below.

Included plugins

Plugin Commands
Custom commands !add <!command> < response >
Google's TTS !tts, !< language >
Misc !commands, !remind < something >
Pat & Love !pat, !love < someone >
Plugin toggle !plugin < disable/enable > <!command>
Sounds¹ !< file_name >
Twitch API² !uptime, !game < optional >, !title/!status < optional >

[1]: Custom sounds go inside /sounds in mp3/wav formats.
[2]: One must fulfill API credentials inside the application settings.

💡 Simple plugin example

Copy the template below:

from parky_bot.settings import BOT
from parky_bot.models.message import Message

@BOT.decorator(commands=['!hello', '!hi']):
def my_custom_command(message): 
    BOT.send_message(f'Howdy {message.sender}!')

Save your my_custom_plugin.py under /plugins folder and you're ready to go!

Running locally

  • Install Python 3.7 or newer
  • Set up a virtual env (optional):
python -m venv .venv
# Unix
source .venv/bin/activate

# Windows
.venv/Scripts/Activate.ps1
  • Install dependencies:
pip install -r requirements.txt
  • Start the application:
python -m parky_bot.app
# Console only/No tkinter:
python -m parky_bot.app --console

Disclaimer

This project is under heavy development and subject to refactoring and code smells.

Contributors

3rd party resources

Comments
  • vlc.MediaPlayer() instances are causing memory leaks

    vlc.MediaPlayer() instances are causing memory leaks

    Whenever a vlc.MediaPlayer is initialized and played, the object frees the memory from the audio but not from itself once it's done playing, so over time, memory is being eaten. For normal situations this won't be too impactful.

    bug 
    opened by parklez 4
  • how to play one random sound from a folder of sounds?

    how to play one random sound from a folder of sounds?

    Please help, I've been trying this all day and I've got nothing. I can either play all the sounds from a folder or none. Adding a command to core_sounds.py to just play a sound doesn't work with AudioPlayer, I don't know what I'm doing wrong. I would share my code but I've mostly just tried to copy it from yours and it's unsuccessful. An example would be like:

    @BOT.decorator(['!random'])
    def random_sound(_):
        rand = random.choice(SOUNDS)
        rand_sound = AudioPlayer(os.path.join(SOUNDS_PATH, rand))
        play_sound(rand_sound)
    

    Nothing happens and I have no idea why this doesn't work... please help!!!

    question 
    opened by defensem3ch 3
  • __init__.py is empty

    __init__.py is empty

    image

    Had errors when attempting to run the bot as it could not find module "Parky_Bot". Pretty sure this isn't supposed to be empty?

    This is the same with all the init files in the parky_bot package.

    question 
    opened by EarlGreyFTW 3
  • Support Linux/Mac builds through Pyinstaller

    Support Linux/Mac builds through Pyinstaller

    Both Linux/Mac comes with python pre-installed and in my opinion, a waste to bundle lots of system binaries just to make it "convenient" for the user. I know for a fact Pyinstaller bundles everything into a single file for MacOS and acts like a regular system app, with the drawback of slow startup speed, which I totally don't want.

    In order to make it convenient for both systems, I need to find the best way for them to run the application. (other than following the running locally instructions)

    enhancement wontfix 
    opened by parklez 3
  • MacOS support issues

    MacOS support issues

    • Tkinter's Button looks weird: Fixed widgets for MacOS: https://github.com/Saadmairaj/tkmacosx Should be easy to import the correct Class depending on OS
    • grab_set() causes Entry on main Tk window to not work anymore.
    • resizable does not work at all

    *Python 3.6 on Big Sur

    enhancement tkinter 
    opened by parklez 2
  • Message regex problems

    Message regex problems

    @badge-info=subscriber/45;badges=broadcaster/1,subscriber/0,premium/1;client-nonce=e82f3c0e5259ab25d21f55fe8096ba00;color=#88CEFF;display-name=leparklez;emotes=1:4-5;flags=0-2:P.3;id=46a94f45-b6f8-4094-80a2-472a1f8cefe8;mod=0;room-id=45453555;subscriber=1;tmi-sent-ts=1616027196869;turbo=0;user-id=45453555;user-type= :[email protected] PRIVMSG #fulano :hello this breaks :)) :) Outputs: username: fulano :hello this breaks :)) message: )

    bug 
    opened by parklez 2
  • Improve Tk, Tcl Non-ASCII rendering

    Improve Tk, Tcl Non-ASCII rendering

    Tkinter has a limited amount of chars it can display, and ASCII range is a bit too low for my taste.

    There's a function here that could solve the problem but I'm not happy with it: https://stackoverflow.com/questions/23530080/how-to-print-non-bmp-unicode-characters-in-tkinter-e-g

    opened by parklez 2
  • API access and token refreshing

    API access and token refreshing

    Currently, the user must visit "www.twitchapps.com/tmi/" and generate their token and refresh it. Would be a lot better if this could be done with fewer clicks or even within the application.

    • Find a way for the user to authorize access to their twitch accounts.
    • Understand how to refresh the token so the user doesn't need to manually edit that every time

    This website's source should give us a hint https://twitchapps.com/tokengen/

    enhancement help wanted 
    opened by parklez 2
  • Rework plugin loading and building

    Rework plugin loading and building

    Currently, all plugins are loaded in app.py, that was a decision because pyinstaller wasn't hooking external dependencies correctly at some point in time(?). Plugins are also loaded from 2 different locations, which is confusing. My proposed change is to move the plugins folder to the root of the project. During the build, pyinstaller now needs to hook "hidden imports".

    enhancement 
    opened by parklez 1
  • Tkinter can't run on secondary thread on MacOS

    Tkinter can't run on secondary thread on MacOS

    The solution is to run tkinter on the main thread, and call BOT.pooling() on a secondary thread. In fact, this looks like the ideal thing to do regardless of the platform.

    bug MacOS 
    opened by parklez 1
  • Welcome screen for new users

    Welcome screen for new users

    A welcome message being displayed in form of log could help users to know what to do on their first setup. A tkinter window could also be added. There's two ways I can think of to implement this feature:

    • Add a new setting called "welcome_on_startup" in settings.json, to be set to False after checking... somewhere?
    • Add a new Settings class that will have volatile information (might useful in the future)
    enhancement 
    opened by parklez 1
  • IRC enhancements

    IRC enhancements

    Current way of parsing Twitch IRC works well enough, but following this IRC model from an expert twitch dev, maybe I could make my implementation better and smarter in a future release: https://github.com/BarryCarlyon/twitch_misc/blob/main/chat/chat.js

    enhancement 
    opened by parklez 0
Releases(1.0.3)
Owner
Andreas Schneider
Andreas Schneider
A simple python discord bot which give you a yogurt brand name, basing on a large database often updated.

YaourtBot A discord simple bot by Lopinosaurus Before using this code : ・Move env file to .env ・Change the channel ID on line 38 of bot.py to your #pi

The only one bunny who can dev. 0 May 09, 2022
An advanced api client for python botters.

[ALPHA] pybotters An advanced api client for python botters. 📌 Description pybottersは仮想通貨botter向けのPythonライブラリです。複数取引所に対応した非同期APIクライアントであり、bot開発により素晴ら

261 Dec 31, 2022
A file-based quote bot written in Python

Let's Write a Python Quote Bot! This repository will get you started with building a quote bot in Python. It's meant to be used along with the Learnin

Jyoti prakash Rout 1 Jan 08, 2022
Generate and Visualize Data Lineage from query history

Tokern Lineage Engine Tokern Lineage Engine is fast and easy to use application to collect, visualize and analyze column-level data lineage in databas

Tokern 237 Dec 29, 2022
PancakeTrade - Limit orders and more for PancakeSwap on Binance Smart Chain

PancakeTrade helps you create limit orders and more for your BEP-20 tokens that swap against BNB on PancakeSwap. The bot is controlled by Telegram so you can interact from anywhere.

Valentin Bersier 187 Dec 20, 2022
Buscar y descargar canciones de YouTube automáticamente desde la web

🎶 DescargarCanciones 🎶 Buscar y descargar canciones o playlist de Spotify o YouTube automáticamente con todos los metadatos de la canciones en forma

1 Dec 20, 2021
This Code is Property of Rehyann Saini. Feel Free to use this Project.

Email-Spammer Rehyann Saini in Collabration With Fe13 Productions This is an easy to use Dev Friendly Email spammer... #Important Things to know..! St

Rehyann Saini 1 Jan 14, 2022
Just another Shiny and Greninja-ash killing preventor for Myuu

Myuu-Anti-Shiny-Discord-Bot Why I made it? Since, I was legit fed up of NebbyBot's lag (not criticising it), I decided to make my own but in python an

5 Nov 12, 2022
cipher bot telegram

cipher-bot-telegram cipher bot telegram Telegram bot that encode/decode your messages To work correctly, you must install the latest version of python

anonim 1 Oct 10, 2021
File-sharing-Bot: Telegram Bot to store Posts and Documents and it can Access by Special Links.

Bromélia HSS bromelia-hss is the second official implementation of a Diameter-based protocol application by using the Python micro framework Bromélia.

1 Dec 17, 2021
Space Bot, a Discord bot built for HackerSpace Club of PES University

Space Bot Space Bot, a Discord bot built for HackerSpace Club of PES University What can Space Bot do? Space Bot allows you to lookup any mentor or to

HackerSpace @PESU 7 Oct 23, 2022
A modern Python client for controlling Wyze devices.

Python Wyze SDK A modern Python client for controlling Wyze devices. Whether you're building a custom app, or integrating into a third-party service l

Shaun Tarves 205 Jan 02, 2023
pyhakuna is a client to access the API of the time keeping service hakuna.ch.

pyhakuna pyhakuna is a client to access the API of the time keeping service hakuna.ch. The Hakuna API is – unfortunately – personal and currently does

Christian Mäder 1 Feb 15, 2022
Coronavirus whatsapp chatbot to give real time info on covid

Covy Developed a coronavirus whatsapp chatbot which gives case counts in a particular district, city, state or country. It also predicts future cases

Devinco (Rachit) 0 Oct 03, 2021
An API wrapper around the pythonanywhere's API.

pyaww An API wrapper around the pythonanywhere's API. The name stands for pythonanywherewrapper. 100% API coverage Most of the codebase is documented

7 Dec 11, 2022
Python Library for Secp256k1 Bitcoin curve to do fast ECC calculation

secp256k1 Python Library for Secp256k1 Bitcoin curve to do fast ECC calculation Example Usage import secp256k1 as ice print('[C]',privatekey_to_addres

iceland 49 Jan 01, 2023
Scrape Twitter for Tweets

Backers Thank you to all our backers! 🙏 [Become a backer] Sponsors Support this project by becoming a sponsor. Your logo will show up here with a lin

Ahmet Taspinar 2.2k Jan 02, 2023
Tickergram is a Telegram bot to look up quotes, charts, general market sentiment and more.

Tickergram is a Telegram bot to look up quotes, charts, general market sentiment and more.

Alberto Ortega 25 Nov 26, 2022
A program used to create accounts in bulk, still a work in progress as of now.

Discord Account Creator This project is still a work in progress. It will be published upon its full completion. About This project is still under dev

patched 8 Sep 15, 2022
A tool that ensures consistent string quotes in your Python code.

pyquotes Single quotes are superior. And if you disagree, there's an option for this as well. In any case, quotes should be consistent throughout the

Adrian 9 Sep 13, 2022