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 python wrapper for the mangadex API V5. Work in progress

mangadex A python wrapper for the mangadex API V5. It uses the requests library and all the aditional arguments can be viewed in the Official Mangadex

Eduardo Ceja 27 Dec 14, 2022
Lazy airdrop based on private temporary ids

LobsterDAO This uses a modified MerkleDistributor, which allows to issue a lazy airdrop using temporary IDs. In this example it uses Telegram chat_id

41 Sep 10, 2022
Python bindings for swm-core client REST API

Python bindings for swm-core client REST API Description Sky Port is an universal bus between user software and compute resources. It can also be cons

Sky Workflows 1 Jan 01, 2022
A simple python oriented telegram bot to give out creative font style's

Font-Bot A simple python oriented telegram bot to give out creative font style's REQUIREMENTS tgcrypto pyrogram==1.2.9 Installation Fork this reposito

BL4CK H47 4 Jan 30, 2022
A way to export your saved reddit posts to a Notion table.

reddit-saved-to-notion A way to export your saved reddit posts and comments to a Notion table.Uses notion-sdk-py and praw for interacting with Notion

19 Sep 12, 2022
A repo-watcher to watch for commits on a repo an trigger GitHub action by sending a `repository_dispatch` event to destinantion repo

repo-watcher-dispatch-sender This app is used to send a repository_dispatch event to the destination repo set in config.py or Environmental Variables

Divide Projectsβ„’ 2 Feb 06, 2022
A script to forward mass number of media to another group/channel. Heroku deploy

Telegram Forward Script πŸ˜‡ This is a Script to Forward Large Number of Files to Another Telegram Channel. Star ΰΆ‘ΰΆšΰΆšΰ·Š ࢯාࢽ fork ΰΆ‘ΰΆšΰΆšΰ·Š ΰΆœΰ·„ΰΆ΄ΰ·’ΰΆΊΰ·€ΰ·Š πŸ₯΄ If You Tr

Anjana Madu 17 Oct 21, 2022
discord.xp Bot, counts XP for members

discord.xp Bot, counts XP for members. How to setup and run? You must have an mysql database Download libs from the requirements.txt file Configurize

irwing 4 Feb 05, 2022
An Advance Discord Generator Written in python Verified Email and Phone Number For Free!

Intro An Advance Discord Generator Written in python It can generate nearly fully verified tokens USAGE put server invite code inside ( invitecode = "

36 May 02, 2022
Lumi-Bot - Discord bot that fetches cryptocurrency prices utilizing CoinGeko API

Lumi-Bot Discord bot that fetches and monitors cryptocurrency prices utilizing C

Diego Castro 2 Oct 08, 2022
ClearML - Auto-Magical Suite of tools to streamline your ML workflow. Experiment Manager, MLOps and Data-Management

ClearML - Auto-Magical Suite of tools to streamline your ML workflow Experiment Manager, MLOps and Data-Management ClearML Formerly known as Allegro T

ClearML 3.9k Jan 01, 2023
Pycardano - A lightweight Cardano client in Python

PyCardano PyCardano is a standalone Cardano client written in Python. The librar

151 Dec 31, 2022
Unofficial Coinbase Python Library

Unofficial Coinbase Python Library Python Library for the Coinbase API for use with three legged oAuth2 and classic API key usage Version 0.3.0 Requir

George Sibble 104 Dec 01, 2022
Repository containing the project files for CEN4020's Team Utah.

inCollege-Team-Utah Repository containing the project files for CEN4020's Team Utah. Contributors: Deepak Putta Jose Ramirez Fuentes Jaason Raudales C

Keylin Sanchez 3 Jul 12, 2022
A chatbot on Telegram using technologies of cloud computing.

Chatbot This project is about a chatbot on Telegram to study the cloud computing. You can refer to the project of chatbot-deploy which is conveinent f

Jeffery 4 Apr 24, 2022
Images to PDF Telegram Bot

ilovepdf Convert Images to PDF Bot This bot will helps you to create pdf's from your images [without leaving telegram] πŸ˜‰ By Default: your pdf fil

✰NaΝ₯biΝ£lΝ« A Navab✰ 116 Dec 29, 2022
A Bot to Track Kernel Upstreams from kernel.org and Post it on Telegram Channel

Channel Kernel Tracker is the channel where the bot will be sending the updates in. Introduction This is a Telegram Bot to Track Kernel Upstreams kern

Kartikeya Hegde 3 Oct 05, 2021
Scrapes an instagram user's photos and videos

Instagram Scraper instagram-scraper is a command-line application written in Python that scrapes and downloads an instagram user's photos and videos.

7.3k Nov 18, 2022
A Telegram Userbot to play Audio and Video songs / files in Telegram Voice Chats.

VC UserBot A Telegram Userbot to play Audio and Video songs / files in Telegram Voice Chats. It's made with PyTgCalls and Pyrogram Requirements Python

쑰던 1 Nov 29, 2021
A Simple Voice Music Player

πŸ“€ π•π‚π”π¬πžπ«ππ¨π­ βˆšπ™π™šπ™–π™’βœ˜π™Šπ™˜π™©π™–π™«π™š NOTE JUST AN ENGLISH VERSION OF OUR PRIVATE SOURCE WAIT FOR LATEST UPDATES JOIN @π’π”πππŽπ‘π“ JOIN @𝐂?

TeamOctave 8 May 08, 2022