GithubHelp home page GithubHelp logo

twitch-live-discord's Introduction

twitch-live-discord

Python script to authenticate against the Twitch API, get live user details and then post a rich text message to a channel in Discord. The reason I built this instead of using a bot is that most bots do not add a random number to the preview URL, resulting in a cached image in Discord

Setup

  • Register an application with Twitch. Note the Client ID and Client Secret

twitch-app

  • Create a Webhook in Discord. Note the Webhook URL

webhook

brew install python
/opt/homebrew/bin/python3 -m pip install --break-system-packages python-dotenv requests
  • Create a .env file in the root directory to put the follow variables
TWITCH_USER="twitch_streamer_name"
CLIENT_ID="<your twitch app client id"
CLIENT_SECRET="<your twitch dev secret>"
WEBHOOK_URL="https://discord.com/api/webhooks/<REST OF THE URL>

Execute the script

  • Run the script to with the following command.
python3 script.py
  • Example output in Discord discord

StreamDeck Integration

  • To launch with StreamDeck Use the System -> Open option

Windows

wsl.exe "/usr/bin/python3" "/home/user/git/twitch-live-discord/script.py"

Mac

  • StreamDeck will only open .sh files so select bash-python.sh

you will need to edit the hardcoded path to script.py inside this file to match your system

streamdeck

twitch-live-discord's People

Contributors

mechevarria avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.