Git Product home page Git Product logo

twitchbot's Introduction

How It Works

 identity: {
    username: 'YOUR BOTS USERNAME',   <-- This is where you place the username that you gave the bot account
    password: 'YOUR BOT OAUTH TOKEN',   <-- This is where you place the OAUTH token for the bot..
  },
  channels:['YOUR TWITCH CHANNEL'],    <-- This is YOUR Twitch user handle.. make sure it matches exactly..
};

How to get OAUTH Token?

Its pretty easy actually.. if you want an auto generated one you can use This to get one auto generated.. just make sure you make a new twitch account for the bot before doing it.. Don't wanna have the bot being youself lol.

How to know the bot started up?

client.on('connected', (address, port) => {
  client.action('Ventispurr', 'Hi! VentispurrBot is connected');   
});

This is what the bot says on console startup.. its how you'll know the bot is connected to your chat

How to make a command

client.on('chat', (channel, user, message, self) => {
  if(message === '!ExampleCMD') {   
    client.action('Ventispurr', 'This is what the bot will say when the command is run');
}
});

This is a basic command for the bot.. inside the if(message ==='!command') is where youll put the trigger for the command.. Under that is the client action and thats what the bot says once the command is run..

How to add more commands

client.on('chat', (channel, user, message, self) => {
 if(message === '!ExampleCMD') {     
   client.action('Ventispurr', 'This is what the bot will say when the command is run');
   }
   });

Just copy this code and keep changing the client action and the command trigger for every command :D

How do I make the bot start?

You can use the console of anything.. Like replit, VS Code.. or anything that you really.. just run the command npm index.js and you'll be good to go..

Bot goes off once I close the code text editor

This is normal.. unless you're hosting it with a vps.. You can do it for free if you're using replit..

const express = require('express')
const app = express();
const port = 3000

app.get('/', (req, res) => res.send('Ventispurr was here!!'))

app.listen(port, () =>
  console.log(`Your app is listening to http://localhost:${port}`)
);โ€Š

Just put this at the top of the index.js file and put a few enters at the top.. then run the npm install express command.. after that run npm index.js again and youll notice in replit that this has shown up now.

Screenshot 2021-10-10 175910

Thats good if you see this.. Once you do head over to Uptime Robot and create an account and then create a new monitor.. copy the link that replit shows and then go through the uptime robot promps. This will ping the replit every 5 minutes so the bot wont shut down.. be sure to stop it once you're done streaming though!!

For more help

You can join the Discord to get help from me!

twitchbot's People

Contributors

raawt avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

mohaxgaming

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.