Code Monkey home page Code Monkey logo

twitch-bot-timeout-new-accounts's Introduction

twitch-bot-timeout-new-accounts

This is a single-channel Twitch bot that times out accounts that have been created too recently. For example, if you only want accounts older than 7 days to be able to chat and a 3-day-old account types something, it will be timed out for 4 days.

This bot was only intended to be foundational code, so while it does what it's supposed to do, there are a lot of improvements that could be made, e.g.:

  • Allow a whitelist of users so that the bot doesn't just keep timing them out.
  • Allow this to work in multiple channels at a time (e.g. Nightbot).
  • Persist the cache to disk so that returning chatters don't trigger additional Twitch API calls.
  • Allow for dynamic configuration via chat commands.

Non-technical explanation of how to set this up

  • The bot needs to be run somewhere, i.e. it's not like Nightbot where you can just add it to your channel.
  • The bot can run as any user whose credentials you have. For example, if you stream as Adam13531, the bot can actually run as you, or you could make a new account altogether. It currently says a message like in this picture, but that can be manually disabled if you want it to just silently run as you.
  • If you want to run it on your own computer, then you would install NodeJS and Yarn, then get the code (ZIP file here: https://github.com/Adam13531/twitch-bot-timeout-new-accounts/archive/master.zip), unzip it, then follow the installation and running instructions below.
  • If you don't want to run it yourself, then you can get one of your mods to run it. This is great if they already have a server that they don't mind throwing a tiny Node process onto.
  • The code is MIT-licensed, meaning anyone can modify it, use it, make money off of it, etc. without having to credit me.
  • I had some free time and was happy to do what I did here, but I don't plan on maintaining this or adding new features.

Installation

  1. Make sure you have Node and Yarn on your system.
  2. yarn
  3. Set environment variables for OAUTH, CLIENT_ID, CHANNEL_NAME, and USER_NAME.

Running / configuration

Run via yarn start.

The threshold in days before an account is allowed to chat is hard-coded as numDaysBeforeBeingAllowedToChat in main.js.

Running with docker-compose

  1. Open the file docker-compose.yml.
  2. Edit the environment section with your own values.
  3. Run docker-compose up --build.

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.