Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Bot {
- constructor(client) {
- this.client = client;
- this.client.on(ChatEvent.NEW_MESSAGE, this.processMessage.bind(this));
- this.client.on(ChatEvent.EDIT, this.processMessage.bind(this));
- }
- async processMessage(msg) {}
- saveData(name, data){}
- }
- class Client {
- async getSites() {
- let sites = this.bot.loadData('sites', sites);
- if(rep){
- return sites;
- }
- resp = await request({
- [...]
- });
- sites = JSON.parse(resp);
- this.bot.saveData('sites', sites);
- return sites;
- }
- bot = new Bot();
- bot.client = new Client(bot);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement