Skip to content

Commit

Permalink
WaldyBot Twitch Chat Bot - Date: 4:31am 10/11/2018
Browse files Browse the repository at this point in the history
- This is WaldyBot's twitch chat bot iteration.
- Currently no use besides connection.
- Plannes uses are:
-- Ability to spam "BIG DICK WEINTRITT".
-- On user "@HDBeasta" stream.
  • Loading branch information
JeffreyBodin committed Oct 11, 2018
1 parent 6c3777a commit a7f5196
Show file tree
Hide file tree
Showing 1,874 changed files with 159,817 additions and 0 deletions.
73 changes: 73 additions & 0 deletions WaldyBotTwitch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// Imported Node Modules
var TMI = require('tmi.js'); //Twitch Messaging Interface https://docs.tmijs.org/
var client = new TMI.client(options);
var fs = require('fs');

// Valid commands start with:
var commandPrefix = '!';

// TMI Module's Options Object (Passed into the new client var.)
var options = {
options: {
debug: true
},
connnection: {
cluster: "aws",
reconnect: true
},
identity: {
username: "WaldyBot",
password: "oauth:pytxbth2ifgpojihds4c80rmjj1ivm" // http://twitchapps.com/tmi/ to create API Key
},
channels: ["HDBeasta"]
};

// Notes:
// Youtube guide used: https://www.youtube.com/watch?v=K6N9dSMb7sM
// Some code taken from: https://dev.twitch.tv/docs/irc/. Specifically official Twitch example chatbot. Under "Step:2 Sample Code".

// Global Vars
// Note: UNDER CONSTRUCTION NO CURRENT USE
var packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
var waldyBotVersion = packageJson["version"];

// Startup
// Note: UNDER CONSTRUCTION NO CURRENT USE
//client.on('ready', () => {
// console.log('v' + waldyBotVersion);
// console.log('Ready....');
// }
//);

// Event Handlers:
// Note: Registers the event handlers. (Defined Below)
client.on('message', (target, context, msg, self) => {
// Called when chat message comes in.

if(self) { return } // Ignore messages from the bot
// This isn't a command since it has no prefix:
if(msg.substr(0, 1) !== commandPrefix) {
console.log(`[${target} (${context['message-type']})] ${context.username}: ${msg}`)
return
}
});
client.on('connected', (addr, port) => {
// Called on chat connection.

// msgs logged to console:
console.log(`* Connected to ${addr}:${port}`);
}); // Channel Connection Event Handler
client.on('disconnected', onDisconnectedHandler);


function onDisconnectedHandler (reason) {
console.log(`Disconnected: ${reason}`)
process.exit(1)
}; // Called every time the bot disconnects from Twitch

// Commands:
// Placeholder Command 1
// Placeholder Command 2


client.connect();
15 changes: 15 additions & 0 deletions node_modules/.bin/har-validator

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/har-validator.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/sshpk-conv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/sshpk-conv.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/sshpk-sign

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/sshpk-sign.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/sshpk-verify

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/sshpk-verify.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/uuid

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/uuid.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions node_modules/ansi-regex/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions node_modules/ansi-regex/license

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

109 changes: 109 additions & 0 deletions node_modules/ansi-regex/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions node_modules/ansi-regex/readme.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a7f5196

Please sign in to comment.