Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Prettier class object calls
- function classObj(name) {
- return document.getElementsByClassName(name);
- }
- //Returns True if you're in a call, else False
- function inCall() {
- if (classObj('rtcConnectionStatus-2-jIsi rtcConnectionQualityFine-2J6i8z').length === 0) {
- return false;
- } else {
- return true;
- }
- }
- //Rejoins voice channel by name
- function rejoin(channel) {
- for (x = 0; x < classObj("mainContent-u_9PKf").length; x++) {
- if (classObj("mainContent-u_9PKf")[x].text === channel) {
- classObj("mainContent-u_9PKf")[x].click();
- }
- }
- }
- //Checks if you're in call and rejoins the specified channel when you're not.
- setInterval(function() {
- if (!inCall()) {
- rejoin('General[1]');
- }
- }, 3000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement