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
Automatically send commands to send Twitch followers to any Twitch account.

Automatically send commands to send Twitch followers to any Twitch account. You just need to be in a Twitch follow bot Discord server!

Thomas Keig 6 Nov 27, 2022
Faster Twitch Alerts is a highly customizable, lightning-fast alternative to Twitch's slow mobile notification system

Faster Twitch Alerts What is "Faster Twitch Alerts"? Faster Twitch Alerts is a highly customizable, lightning-fast alternative to Twitch's slow mobile

null 6 Dec 22, 2022
an OSU! bot sdk based on IRC

osu-bot-sdk an OSU! bot sdk based on IRC Start! The following is an example of event triggering import osu_irc_sdk from osu_irc_sdk import models bot

chinosk 2 Dec 16, 2021
A Python IRC bot with dynamically loadable modules

pybot This is a modular, plugin-based IRC bot written in Python. Plugins can bedynamically loaded and unloaded at runtime. A design goal is the abilli

Jeff Kent 1 Aug 20, 2021
This is the repository for HalpyBOT, the Hull Seals IRC Chatbot Assistant.

HalpyBOT 1.4.2 This is the repository for HalpyBOT, the Hull Seals IRC Chatbot Assistant. Description This repository houses all of the files required

The Hull Seals 3 Nov 3, 2022
A unified API wrapper for YouTube and Twitch chat bots.

Chatto A unified API wrapper for YouTube and Twitch chat bots. Contributing Chatto is open to contributions. To find out where to get started, have a

Ethan Henderson 5 Aug 1, 2022
A bot to display per user data from the Twitch Leak

twitch-leak-bot-discord A bot to display per user data from the Twitch Leak by username Where's the data? I can't and don't want to supply the .csv's

SSSEAL-C 0 Nov 8, 2022
A Twitch bot to provide information from the WebNowPlayingCompanion extension

WebNowPlayingTwitch A Twitch bot made using TwitchIO which displays information obtained from the WebNowPlaying Compaion browser extension. Image is o

NiceAesth 1 Mar 21, 2022
(unofficial) Googletrans: Free and Unlimited Google translate API for Python. Translates totally free of charge.

Googletrans Googletrans is a free and unlimited python library that implemented Google Translate API. This uses the Google Translate Ajax API to make

Suhun Han 3.2k Jan 4, 2023
Automatically gets clips from twitch streams and uploads them to a YouTube channel.

Twitch Stream Highlights to YT Automatic Uploader (AutoBot Clipper) This script can be used to automatically extract highlights (or clips) from a twit

Teja Swaroop 57 Dec 12, 2022
List of twitch bots n bigots

This is a collection of bot account names NamelistMASTER contains all the names we reccomend you ban in your channel Sometimes people get on that list

null 62 Sep 5, 2021
Simple script to ban bots at Twitch chats using a text file as a source.

AUTOBAN ???? English version Simple script to ban bots at Twitch chats using a text file as a source. How to use Windows Go to releases for further in

And Paiva 5 Feb 6, 2022
Twitch Points Miner for multiple accounts with Discord logging

Twitch Points Miner for multiple accounts with Discord logging Creator of the Twitch Miner -- PLEASE NOTE THIS IS PROBABLY BANNABLE -- Made on python

null 8 Apr 27, 2022
TwitchAccountMaker - Twitch Account Maker with python

Twitch Account Creator A Twitch Account Creator, Requires Capmonster.cloud Verif

vanis / 1800 0 Jan 20, 2022
Twitch Linux Typer

Twitch Linux Typer The most cursed Twitch chat bot Listens to twitch chat, and then types it handles hotkeys and button presses via the ^ char, eg ctr

Robin Universe 4 Jun 27, 2022
A lightweight, dependency-free Python library (and command-line utility) for downloading YouTube Videos.

24 July 2020 Actively soliciting contributers! Ping @ronncc if you would like to help out! pytube pytube is a very serious, lightweight, dependency-fr

pytube 7.9k Jan 2, 2023
SongLink Discord Bot - Discord bot to share music links easily

SongLink_Discord_Bot Discord bot to share music links easily. Take a link from y

Edgar Lefevre 4 Feb 18, 2022
Kevin L. 3 Jul 14, 2022
Minimal API for the COVID Booking System of the Offices at the UniPD Math Dep

Simple and easy to use python BOT for the COVID registration booking system of the math department @ unipd (torre archimede). This API creates an interface with the official website, with more useful functionalities.

Guglielmo Camporese 4 Dec 24, 2021