{"id":17640646,"url":"https://github.com/kritzware/node-twitchbot","last_synced_at":"2025-05-06T20:23:29.346Z","repository":{"id":85620337,"uuid":"67900303","full_name":"kritzware/node-twitchbot","owner":"kritzware","description":"Package for easily creating Twitch Bots","archived":false,"fork":false,"pushed_at":"2018-08-12T18:59:08.000Z","size":38,"stargazers_count":13,"open_issues_count":3,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T02:34:52.307Z","etag":null,"topics":["chatbot","node","npm","twitch","twitch-irc","twitchbot"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/node-twitchbot","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kritzware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-10T23:50:49.000Z","updated_at":"2024-08-06T00:32:32.000Z","dependencies_parsed_at":"2023-03-07T11:15:58.122Z","dependency_job_id":null,"html_url":"https://github.com/kritzware/node-twitchbot","commit_stats":{"total_commits":35,"total_committers":4,"mean_commits":8.75,"dds":0.4285714285714286,"last_synced_commit":"6ecb807c358410ca4d860d811ffde786cdb87e51"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kritzware%2Fnode-twitchbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kritzware%2Fnode-twitchbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kritzware%2Fnode-twitchbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kritzware%2Fnode-twitchbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kritzware","download_url":"https://codeload.github.com/kritzware/node-twitchbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252762252,"owners_count":21800284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","node","npm","twitch","twitch-irc","twitchbot"],"created_at":"2024-10-23T06:04:36.503Z","updated_at":"2025-05-06T20:23:29.281Z","avatar_url":"https://github.com/kritzware.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-twitchbot [![Build Status](https://travis-ci.org/kritzware/node-twitchbot.svg?branch=master)](https://travis-ci.org/kritzware/node-twitchbot)\n\n### NOTE: This package has been discontinued. It is highly recommend to use the new version at [kritzware/twitch-bot](https://github.com/kritzware/twitch-bot)\n\nThis package is not to be used for Twitch botting (inflating live viewer counts) and should only be used for chatbots. Attempting to 'bot' a Twitch channel can lead to your account being permanently banned. ![](https://static-cdn.jtvnw.net/emoticons/v1/91/1.0)\n\n### Installation\nVersion 2.0.0^ (\u003cb\u003eRecommended\u003c/b\u003e): \n```bash\n$ npm install node-twitchbot\n```\nVersion 1 (Deprecated):\n```bash\n$ npm install node-twitchbot@1.2.2\n```\n\n## V2 DOCS\n### Example\n```javascript\nconst TwitchBot = require('node-twitchbot')\n\nconst Bot = new TwitchBot({\n  username : 'GLADOS',\n  oauth    : 'oauth:secret-oauth-pass',\n  channel  : 'Aperture'\n})\n\n/* Connect bot to Twitch IRC */\nBot.connect()\n.then(() =\u003e {\n\n  /* Listen for all messages in channel */\n  Bot.listen((err, chatter) =\u003e {\n    if(err) {\n      console.log(err)\n    } else {\n      console.log(chatter.msg) // 'Hello World!'\n    }\n  })\n\n  /* Listen for an exact messages match */\n  Bot.listenFor('KKona', (err, chatter) =\u003e {\n    console.log(chatter)\n  })\n\n  /* Send a message in the channel */\n  Bot.msg('this is the message text PogChamp')\n\n  /* Listen for raw IRC events */\n  Bot.raw((err, event) =\u003e {\n    console.log(event)\n  })\n})\n.catch(err =\u003e {\n  console.log('Connection error!')\n  console.log(err)\n})\n```\n\n### Chatter Object\nMost callbacks return a `chatter` object which contains the following attributes:\n```javascript\n{\n  user: 'kritzware',\n  msg: 'Hello world! Kappa',\n  channel: 'kritzware',\n  twitch_id: '44667418',\n  level: 'mod',\n  sub: 0,\n  turbo: 0\n}\n```\n\n## V1 DOCS\n### Example\n```javascript\nconst Bot = require('node-twitchbot')\n\nBot.run({\nusername: 'bot_username',\n  oauth: 'oauth:twitch_oauth_key',\n  channel: 'channel'\n})\n\n/* Exact message match */\nBot.listenFor('Kappa', (err, chatter) =\u003e {\n  if(err) {\n    console.log(err)\n  } else {\n    console.log(chatter)\n  }\n})\n\n/* Return all user message in channel */\nBot.listenFor('*', (err, chatter) {\n  // Returns all viewer messages in channel\n})\n\n/* String is included in message */\nBot.listen('PogChamp', (err, chatter) =\u003e {\n  console.log(chatter)\n})\n\n/* Sub/resub event in chat */\nBot.resub((err, chatter, sub) =\u003e {\n  console.log(sub)\n})\n\n/* Say messages in chat */\nBot.msg('Hello chat!')\n\n/* Private message user */\nBot.whisper('kritzware', 'This is a private message Kappa')\n\n/* Setting commands instead of checking via string match */\nconst commands = {\n  help : 'For help using this bot, contact kritzware',\n  twitter : 'Follow this channel at https://twitter.com/test123',\n  /* You can also use functions to generate a command response */\n  random : (chatter) =\u003e {\n    return Math.floor((Math.random() * -1) + 1)\n  },\n  /* Command functions can make use of the chatter object of the user who executed the command */\n  goodnight : (chatter) =\u003e {\n    return 'Goodnight ' + chatter.user + '! FeelsGoodMan'\n  }\n}\n\nBot.commands('!', commands, (err, chatter, command) =\u003e {\n  if(err) {\n    console.log(err)\n  } else {\n    console.log(command)\n    console.log(chatter)\n  }\n})\n```\n\n#### Output for example '!goodnight' command above\n![](http://i.imgur.com/buPqiaK.gif)\n\n#### Example of a command\n```javascript\nBot.listenFor('!command', (err, chatter) =\u003e {\n  Bot.msg('This is the command response')\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkritzware%2Fnode-twitchbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkritzware%2Fnode-twitchbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkritzware%2Fnode-twitchbot/lists"}