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
⛑ REDCap API interface in Python

REDCap API in Python Description Supports structured data extraction for REDCap projects. The API module d3b_redcap_api.redcap.REDCapStudy can be logi

D3b 1 Nov 21, 2022
A EddieHub API python package.

EddieHub A EddieHub API python package. Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License - https://github.com/Fayas

Fayas Noushad 5 Sep 22, 2021
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 reddit.com bot that will return reference links from official python documentation site for the standard library.

Python Docs Bot A reddit.com bot that will return documentation links for the library and language reference sections of the python docs website. The

Trevor Miller 2 Sep 14, 2021
Translates English into Mandalorian (Mando'a) utilizing a "funtranslations" free API

Mandalorian Translator Translates English into Mandalorian (Mando'a) utilizing a "funtranslations" free API About I created this app to experiment wit

Hayden Covington 1 Dec 04, 2021
Riffdog Terraform scanner - finding 'things' in the Real World (aka AWS) which Terraform didn't put there.

riffdog Riffdog Terraform / Reality scanner - finding 'things' in the Real World which Terraform didn't put there. This project works by firstly loadi

Riffdog 4 Mar 23, 2020
IMDb + Auto + Unlimited Filter BoT

Telegram Movie Bot Features Auto Filter Manuel Filter IMDB Admin Commands Broadcast Index IMDB search Inline Search Random pics ids and User info Stat

Jos Projects 82 Dec 27, 2022
🎥 Stream your favorite movie from the terminal!

Stream-Cli stream-cli is a Python scrapping CLI that combine scrapy and webtorrent in one command for streaming movies from your terminal. Installatio

R E D O N E 379 Dec 24, 2022
Visionary-OS: open source discord bot

Visionary-OS Our Visionary open source discord bot. Our goal is to create a discord bot, which is hosted by us, but every member of our community can

8 Jan 27, 2022
Gathers data and displays metrics related to climate change and resource depletion on a PowerBI report.

Apocalypse Status Dashboard Purpose Climate change and resource depletion are grave long-term dangers. The code in this repository will pull data from

Summer Is Here 1 Nov 12, 2021
E-Commerce Telegram Bot for UCA Students

ucaStudentStore To buy from and sell to other students Features Register the first time, after that you will always be recognised You can login either

Shukur Sabzaliev 5 Jun 26, 2022
Auto Join: A GitHub action script to automatically invite everyone to the organization who comment at the issue page.

Auto Invite To Org By Issue Comment A GitHub action script to automatically invite everyone to the organization who comment at the issue page. What is

Max Base 6 Jun 08, 2022
DankMemer-Farmer - Autofarm Self-Bot for Discord bot Named Dankmemer.

DankMemer-Farmer Autofarm Self-Bot for Discord bot Named Dankmemer. Warning We are not responsible if you got banned, since "self-bots" outside of the

Mole 16 Dec 14, 2022
Telegram vc userbot

Telegram Vc Userbot Available Commands /ping :- To check whether userbot is up or not /joinvc :- To join vc /leavevc :- To leave vc /join_group :- To

NandyDark 7 Nov 18, 2022
🪣 Bitbucket Server PAT Generator

🪣 Bitbucket Server PAT Generator 🤝 Introduction Bitbucket Server (nee Stash) can hand out Personal Access Tokens (PAT) to be used in-place of user+p

reecetech 2 May 03, 2022
A in-development chatbot.

BackBot A in-development chatbot. How the chatbot works This is a simple chatbot that relies on the user input. It already has a (small) set of genera

1 Dec 03, 2021
EZPZ-PGP: This is a simple and easy to use PGP tool.

EZPZ-PGP This is a simple and easy to use PGP tool. Features [X] Create new PGP Keypairs, able to choose between 4096 and 8192 bit keys.\n [X] Import

6 Dec 30, 2022
Administration Panel for Control FiveM Servers From Discord

FiveM Discord Administration Panel Version 1.0.0 If you would like to report an issue or request a feature. Join our Discord or create an issue. Contr

NIma 9 Jun 17, 2022
Program that uses Python to monitor grade updates in the Genesis Platform

Genesis-Grade-Monitor Program that uses Python to monitor grade updates in the Genesis Platform Guide: Install by either cloning the repo or downloadi

Steven Gatanas 1 Feb 12, 2022
A feishu bot daily push arxiv latest articles.

arxiv-feishu-bot We develop A simple feishu bot script daily pushes arxiv latest articles. His effect is as follows: Of course, you can also use other

huchi 6 Apr 06, 2022