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 crashbot for Discord

Description A Effective crash bot code How to use Setup First, we need to install the library: pip install discord or (for linux users): pip3 install

3 Sep 17, 2021
PHION's client-side core python library

PHION-core PHION's client-side core python library. This library is not meant to be used directly by users. If you want to install phion please use th

PHION 2 Feb 07, 2022
1.本项目采用Python Flask框架开发提供(应用管理,实例管理,Ansible管理,LDAP管理等相关功能)

op-devops-api 1.本项目采用Python Flask框架开发提供(应用管理,实例管理,Ansible管理,LDAP管理等相关功能) 后端项目配套前端项目为:op-devops-ui jenkinsManager 一.插件python-jenkins bug修复 (1).插件版本 pyt

3 Nov 12, 2021
As Slack no longer provides an API to invite people, this is a Selenium Python script to do so

As Slack no longer provides an API to invite people, this is a Selenium Python script to do so

Pincer-bot-template - A template for a Discord bot created using the Pincer library

Pincer Discord Bot Template (Python) WARNING: Pincer is still in its alpha/plann

binds 2 Mar 17, 2022
WeChat SDK for Python

___ __ _______ ________ ___ ___ ________ _________ ________ ___ ___ |\ \ |\ \|\ ___ \ |\ ____\|\ \|\ \|\ __ \|\___

wechatpy 3.3k Dec 26, 2022
Halcyon is a Matrix bot library created with the intention of being easy to install and use. Inspired by discord.py

Halcyon is a Matrix bot library with the goal of being easy to install and use. The library takes inspiration from discord.py and the Slack li

Wes Ring 19 Jan 06, 2023
Pycord, a maintained fork of discord.py, is a python wrapper for the Discord API

pycord A fork of discord.py. PyCord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Mo

Pycord Development 2.3k Dec 31, 2022
Faux is a chatbot bridge between urbit and discord.

Faux Faux is a chatbot bridge between urbit and discord. Whenever a member posts in your discord group, a bot will echo their message in your urbit gr

10 Dec 27, 2022
This is Source Code of PdiskUploaderBot

PdiskUploaderBot This is the source code of PdiskUploaderBot. And the developer of this bot is AJTimePyro, His Telegram Channel & Group. You can use t

Abhijeet 8 Oct 20, 2022
Andrei 1.4k Dec 24, 2022
An elegant mirai-api-http v2 Python SDK.

Ariadne 一个适用于 mirai-api-http v2 的 Python SDK。 本项目适用于 mirai-api-http 2.0 以上版本。 目前仍处于开发阶段,内部接口可能会有较大的变化。 安装 poetry add graia-ariadne 或 pip install graia

Graia Project 259 Jan 02, 2023
Discord Account Generator that will create Account with hCaptcha bypass. Using socks4 proxies

Account-Generator [!] This was made for education. Please use socks4 proxies for nice experiences. [!] Please install these modules - "pip3 install ht

RyanzSantos 10 Feb 23, 2022
a discord libary that use to make discord bot with low efficiency and bad performance because I don't know how to manage the project

Aircord 🛩️ a discord libary that use to make discord bot with low efficiency and bad performance because I don't know how to manage the project Examp

Aircord 2 Oct 24, 2021
Charged's cogs for Red!

Light-Cogs Charged's cogs for Red! Read below for more information. Features and Cogs TechInfo Lots of commands helping you and your devices! Extended

Charged 2 Jan 07, 2022
Morpy Bot Linux - Morpy Bot Linux With Python

Morpy_Bot_Linux Guide to using the robot : 🔸 Lsmod = to identify admins and st

2 Jan 20, 2022
An integrated information collection tool

infoscaner 环境配置 目前infoscaner仅支持在linux上运行,建议运行在最新版本的kali中 infoscaner是基于python3版本实现的,运行之前首先安装python库 如果同时存在python2和python3,请输入以下命令 pip3 install -r requi

CMACCKK 74 Sep 13, 2021
A high level library for building Discord bots.

Qord A high level library for building Discord bots. 🚧 This library is currently in development. Questions that you are having What is this? This is

Izhar Ahmad 16 May 14, 2022
Heroku app to explore boardgame data

A Dashboard for the Board Game Geeks among us Link to Application As many Board Game Geeks like myself track the scores of board game matches I decide

Maarten Grootendorst 20 Nov 23, 2022