-
Notifications
You must be signed in to change notification settings - Fork 10
/
meet.js
62 lines (44 loc) · 1.86 KB
/
meet.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const EventEmitter = require('events');
const puppeteer = require('puppeteer-extra');
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
puppeteer.use(StealthPlugin());
const authenticate = require('./core/authenticate');
const meeting = require('./core/meeting');
const message = require('./core/message');
const member = require('./core/member');
const audio = require('./core/audio'); // Not working
class Meet extends EventEmitter {
constructor() {
super();
console.log("Client created!")
// Listeners (for use in login function)
this.message = message;
this.member = member;
this.audio = audio;
this.meetingLink = undefined;
this.email = undefined
this.puppeteer = puppeteer;
this.browser = undefined;
this.page = undefined;
this.ctx = undefined;
this.isMicEnabled = true;
this.isVideoEnabled = true;
this.isChatEnabled = undefined;
this.recentMessage = undefined;
this.members = undefined;
};
login = authenticate.auth;
toggleMic = meeting.toggleMic;
toggleVideo = meeting.toggleVideo;
toggleChat = meeting.toggleChat;
toggleMemberList = meeting.toggleMemberList;
chatEnabled = meeting.chatEnabled;
sendMessage = meeting.sendMessage;
screenshot = meeting.screenshot;
}
module.exports.Meet = Meet;
/* Notes */
// Various XPaths and element class names or ids are not explained throughout this source; there's probably a better way to have a permanent selector to a specific element though
// The Audio part of this package has not yet been implemented
// This code can be improved in many ways, but I wrote this during the beginning of Covid lockdown; I've only now decided to add a license and create a repository to publish
// This package aims to be similar to the Discord JS library