Giter VIP home page Giter VIP logo

basicjsbot's Introduction

Table of contents

Initial setup

You will need the following to use this properly:

  • tmi.js
  • dotenv
  • sqlite3 and the bindings for node
  • node-fetch
  • Twitch account that you will use as the bot (preferably registered as an app)
  • Local databases for clips and commands(plus quotes, but this will be created when first run (none are provided))

You can register your bot account as an app here
Twitch provides this handy guide getting started with chat & chatbots
Twitch api reference

After getting bot related OAuth, access token, client ID (username and channel id) fill those in to dotenv file and rename it to ".env"
Change the channel:

channels: [ 'myChannel' ]

To which channel(s) you want it to join after running the program.

Layout of clips and commands databases:
clips: CREATE TABLE IF NOT EXISTS "clips" ("id" INTEGER, "clips" TEXT);

commands: CREATE TABLE IF NOT EXISTS "command" ("id" INTEGER, "command" TEXT);
CREATE TABLE IF NOT EXISTS "answer" ("id" INTEGER, "answer" TEXT);

If you want to utilize convert command, you will need to (possibly) sign up to one currency exchange rate site.
I'm using open exchange rates for this.
If you are using another service, api querys and responses might be different so you will need to figure out how to deal with that yourself or you can file an issue and ask for my help(no guarantees though).

If you wish to use followage & uptime commands, you will need to include your own channels id in the .env file.

Usage

Run npm start to get the bot online, after the bot has connected to the chat commands can be used.

Sources

tmi.js https://github.com/tmijs/tmi.js
dotenv https://github.com/motdotla/dotenv
sqlite3 bindings for node https://github.com/mapbox/node-sqlite3
node-fetch https://github.com/node-fetch/node-fetch
Twitch dev site https://dev.twitch.tv/
Twitch bot guide https://dev.twitch.tv/docs/irc
Twitch api reference https://dev.twitch.tv/docs/api/reference
Open Exchange Rates https://openexchangerates.org/ https://github.com/openexchangerates
Open Exchange Rates api docs https://docs.openexchangerates.org/docs

basicjsbot's People

Contributors

tyhjakuori avatar

Watchers

 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.