mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-13 07:17:12 +03:00
Add a function to select the next text channel to discord.js
This commit is contained in:
parent
939720dfa9
commit
d6bbb57a3f
@ -81,6 +81,22 @@ var DISCORD = (function(){
|
||||
*/
|
||||
loadOlderMessages: function(){
|
||||
DOM.cls("messages")[0].scrollTop = 0;
|
||||
},
|
||||
|
||||
/*
|
||||
* Selects the next text channel and returns true, otherwise returns false if there are no more channels.
|
||||
*/
|
||||
selectNextTextChannel: function(){
|
||||
var nextChannel = DOM.cls("selected", DOM.cls("channels-wrap")[0])[0].nextElementSibling;
|
||||
var classes = nextChannel && nextChannel.classList;
|
||||
|
||||
if (nextChannel === null || !classes.contains("channel") || !(classes.contains("private") || classes.contains("channel-text"))){
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
DOM.tag("a", nextChannel)[0].click();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
Loading…
x
Reference in New Issue
Block a user