Created
July 6, 2022 00:25
-
-
Save shawnco/3335707a020aa90644e760fe96966710 to your computer and use it in GitHub Desktop.
Twitch Bot Idle Game section 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"username": "shawntc", | |
"password": "oauth:xxxxxxxxxxxxx", | |
"channels": ["shawntc"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {Sequelize} = require('sequelize'); | |
const db = new Sequelize({ | |
dialect: 'sqlite', | |
storage: __dirname + '/idle.sqlite' | |
}); | |
const Upgrade = db.define('upgrade', { | |
id: { | |
type: Sequelize.INTEGER, | |
primaryKey: true, | |
autoIncrement: true | |
}, | |
name: Sequelize.STRING, | |
cost: Sequelize.INTEGER, | |
points: Sequelize.INTEGER | |
}, { | |
freezeTableName: true, | |
timestamps: false | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tmi = require('tmi.js'); | |
const {username, password, channels} = require('./config.json'); | |
const client = new tmi.Client({ | |
options: { | |
debug: true, | |
messagesLogLevel: 'info' | |
}, | |
connection: { | |
reconnect: true, | |
secure: true | |
}, | |
identity: { | |
username, password | |
}, | |
channels | |
}); | |
try { | |
client.connect(); | |
} catch (ex) { | |
console.log('Problem connecting:', ex); | |
} | |
client.on('message', (channel, tags, message, self) => { | |
console.log(channel, message); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment