Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const tmi = require('tmi.js');
- const moment = require('moment');
- const Twit = require('./twit');
- let e621 = require('e621-api').default;
- let enums = require('e621-api/build/enums');
- let TIME_SINCE_PLAY = moment();
- let AMOUNT_OF_PLAY = 0;
- const options = {
- options: {
- debug: true,
- },
- connection: {
- reconnect: true,
- },
- identity: {
- username: 'FrostfireBot',
- password: 'oauth:4rsh7mp625osuxn0ekgb2deknfg1yn',
- },
- channels: ['frostfireee'],
- };
- const client = new tmi.client(options);
- client.connect().then(() => {
- Twit.feed(client);
- })
- client.on('chat', async (channel, user, message, self) => {
- if (self) return;
- if (message.toLowerCase() === '!test') {
- client.say(channel, 'Bot is up and running!');
- }
- })
- if(message.includes('!e621')) {
- var MyNum = Math.floor(Math.random()*2)
- console.log(MyNum)
- comments = wrapper.comments.getRecentComments(0)
- .then((response) => {
- var MyNumb = Math.floor(Math.random()*200000);
- client.say('frostfireee', '"' + response[0].body + '" - MrDestructoid your requested e621 comment ' + MyNumb)
- });
- } else if (MyNum = 2) {
- wrapper.comments.list(MyNumb, 2, 'visible')
- var MyNumb = Math.floor(Math.random()*200000)
- client.say ('frostfireee', '"' + response[0].body + '" - MrDestructoid your requested e621 comment ' + MyNumb )
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement