SHARE
TWEET

Untitled

a guest Jun 18th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Bot {
  2.     constructor(client) {
  3.         this.client = client;
  4.         this.client.on(ChatEvent.NEW_MESSAGE, this.processMessage.bind(this));
  5.         this.client.on(ChatEvent.EDIT, this.processMessage.bind(this));
  6.     }
  7.  
  8.     async processMessage(msg) {}
  9.     saveData(name, data){}
  10. }
  11.      
  12. class Client {
  13.    async getSites() {
  14.       let sites = this.bot.loadData('sites', sites);
  15.       if(rep){
  16.         return sites;
  17.       }
  18.         resp = await request({
  19.             [...]
  20.         });
  21.         sites = JSON.parse(resp);
  22.         this.bot.saveData('sites', sites);
  23.         return sites;
  24. }
  25.      
  26. bot = new Bot();
  27. bot.client = new Client(bot);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top