Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. const tmi = require('tmi.js');
  2. const moment = require('moment');
  3. const Twit = require('./twit');
  4. let e621 = require('e621-api').default;
  5. let enums = require('e621-api/build/enums');
  6.  
  7. let TIME_SINCE_PLAY = moment();
  8. let AMOUNT_OF_PLAY = 0;
  9.  
  10. const options = {
  11. options: {
  12. debug: true,
  13. },
  14. connection: {
  15. reconnect: true,
  16. },
  17. identity: {
  18. username: 'FrostfireBot',
  19. password: 'oauth:4rsh7mp625osuxn0ekgb2deknfg1yn',
  20. },
  21. channels: ['frostfireee'],
  22. };
  23.  
  24. const client = new tmi.client(options);
  25. client.connect().then(() => {
  26. Twit.feed(client);
  27. })
  28.  
  29. client.on('chat', async (channel, user, message, self) => {
  30. if (self) return;
  31. if (message.toLowerCase() === '!test') {
  32. client.say(channel, 'Bot is up and running!');
  33. }
  34. })
  35.  
  36. if(message.includes('!e621')) {
  37. var MyNum = Math.floor(Math.random()*2)
  38. console.log(MyNum)
  39. comments = wrapper.comments.getRecentComments(0)
  40. .then((response) => {
  41. var MyNumb = Math.floor(Math.random()*200000);
  42. client.say('frostfireee', '"' + response[0].body + '" - MrDestructoid your requested e621 comment ' + MyNumb)
  43. });
  44. } else if (MyNum = 2) {
  45. wrapper.comments.list(MyNumb, 2, 'visible')
  46. var MyNumb = Math.floor(Math.random()*200000)
  47. client.say ('frostfireee', '"' + response[0].body + '" - MrDestructoid your requested e621 comment ' + MyNumb )
  48. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement