var DISCORD = (function(){
  var regexMessageRequest = /\/channels\/(\d+)\/messages[^a-z]/;
  
  return {
    /*
     * Sets up a callback hook to trigger whenever a message request returns a response (the callback is given the channel ID and message array).
     */
    setupMessageRequestHook: function(callback){
      HOOKS.onAjaxResponse(function(args, req){
        var match = args[1].match(regexMessageRequest);
        
        if (match){
          var channel = match[1];
          var messages = JSON.parse(req.response);
          
          callback(channel, messages);
        }
      });
    },
    
    /*
     * Returns an object containing the selected server name, selected channel name and ID, and the object type.
     * For types DM and GROUP, the server and channel names are identical.
     * For SERVER type, the channel has to be in view, otherwise Discord unloads it.
     */
    getSelectedChannel: function(){
      var obj;
      
      var channelListEle = DOM.cls("private-channels")[0];
      var channel;
      
      if (channelListEle){
        channel = DOM.cls("selected", channelListEle)[0];
        
        if (!channel || !channel.classList.contains("private")){
          return null;
        }
        else{
          var linkSplit = DOM.tag("a", channel)[0].getAttribute("href").split("/");
          var name = [].find.call(DOM.cls("channel-name", channel)[0].childNodes, node => node.nodeType === Node.TEXT_NODE).nodeValue;
          
          obj = {
            server: name,
            channel: name,
            id: linkSplit[linkSplit.length-1],
            type: DOM.cls("status", channel).length ? "DM" : "GROUP"
          };
        }
      }
      else{
        channelListEle = DOM.cls("guild-channels")[0];
        channel = channelListEle && DOM.cls("selected", channelListEle)[0];
        
        if (!channel){
          return null;
        }
        else{
          var linkSplit = DOM.tag("a", channel)[0].getAttribute("href").split("/");

          obj = {
            server: DOM.tag("span", DOM.cls("guild-header")[0])[0].innerHTML,
            channel: DOM.cls("channel-name", DOM.cls("selected", channelListEle)[0])[0].innerHTML,
            id: linkSplit[linkSplit.length-1],
            type: "SERVER"
          };
        }
      }
      
      return obj.channel.length === 0 ? null : obj;
    },
    
    /*
     * Forces the message column to scroll all the way up to load older messages.
     */
    loadOlderMessages: function(){
      DOM.cls("messages")[0].scrollTop = 0;
    }
  };
})();

@@ -2375,24 +2375,222 @@
     %0A    /*%0A
+     * Returns true if there are more messages available.%0A     */%0A    hasMoreMessages: function()%7B%0A      return DOM.cls(%22messages%22)%5B0%5D.children%5B0%5D.classList.contains(%22has-more%22);%0A    %7D,%0A    %0A    /*%0A
      * Force

Add hasMoreMessages to discord.js