const UserList = (function(){
  function UserList(sys){
    this.sys = sys;
    this.dom = sys.gui.initUserList();
    this.users = {};
  }

  UserList.prototype.show = function(){
    this.dom.style.display = "block";
  };

  UserList.prototype.hide = function(){
    this.dom.style.display = "none";
  };

  UserList.prototype.remove = function(nick){
    if(typeof this.users[nick] === "undefined"){
      return false;
    }
    this.users[nick].remove(nick);
    delete this.users[nick];
    return true;
  };

  UserList.prototype.append = function(nick, avatar){
    const container = document.createElement("div");
    container.className = "user-item";

    if(avatar){
      const a = document.createElement("span");
      a.style.backgroundImage = "url('"+avatar+"')";
      a.className = "user-list-avatar";
      container.appendChild(a);
    }

    const name = document.createElement("span");
    name.className = "nick";
    name.innerHTML = nick;
    container.appendChild(name);
    const self = this;
    name.onclick = function(){
      const my = self.users[myNick];
      var m = [];
      if(nick == myNick){
        m.push([
          function(){
            var newNick = prompt(language["writeNick"]);
            if(newNick){
              send("Bot", "/nick "+newNick);
            }
          },
          language["changeNick"]
        ]);
      }else if(my.isOp){
        m.push([
          function(){
            alert(typeof sys.currentPage());
            send(sys.currentPage().name, "/kick "+nick);
          },
          language["kick"]
        ]);
        m.push([
          function(){
            send(sys.currentPage().name, "/ban "+nick);
          },
          language["ban"]
        ]);
      }
       
      for(var i=0;i<m.length;i++){
         const item = document.createElement("div");
         item.onclick = m[i][0];
         item.innerHTML = m[i][1];
         menu.appendChild(item);
      }
      if(menu.offsetParent == null){
        menu.style.display = "block";
      }else{
        menu.style.display = "none";
        menu.innerHTML = "";
      }
    };

    const menu = document.createElement("div");
    menu.className = "menu";
    menu.style.display = "none";
    container.appendChild(menu);

    this.dom.appendChild(container);
    this.users[nick] = new User(
      this.sys,
      this.sys.gui.appendUser(this.dom, avatar, nick),
      nick
    );
  };

  UserList.prototype.updateNick = function(old, news){
     if(typeof this.users[old] === "undefined"){
       return false;
     }

     this.users[old].updateNick(news);
     this.users[news] = this.users[old];
     delete this.users[old];
  };

  UserList.prototype.get = function(nick){
    if(typeof this.users[nick] === "undefined")
      return null;
    return this.users[nick];
  };

  return UserList;
})();

@@ -567,1736 +567,8 @@
 r)%7B%0A
-    const container = document.createElement(%22div%22);%0A    container.className = %22user-item%22;%0A%0A    if(avatar)%7B%0A      const a = document.createElement(%22span%22);%0A      a.style.backgroundImage = %22url('%22+avatar+%22')%22;%0A      a.className = %22user-list-avatar%22;%0A      container.appendChild(a);%0A    %7D%0A%0A    const name = document.createElement(%22span%22);%0A    name.className = %22nick%22;%0A    name.innerHTML = nick;%0A    container.appendChild(name);%0A    const self = this;%0A    name.onclick = function()%7B%0A      const my = self.users%5BmyNick%5D;%0A      var m = %5B%5D;%0A      if(nick == myNick)%7B%0A        m.push(%5B%0A          function()%7B%0A            var newNick = prompt(language%5B%22writeNick%22%5D);%0A            if(newNick)%7B%0A              send(%22Bot%22, %22/nick %22+newNick);%0A            %7D%0A          %7D,%0A          language%5B%22changeNick%22%5D%0A        %5D);%0A      %7Delse if(my.isOp)%7B%0A        m.push(%5B%0A          function()%7B%0A            alert(typeof sys.currentPage());%0A            send(sys.currentPage().name, %22/kick %22+nick);%0A          %7D,%0A          language%5B%22kick%22%5D%0A        %5D);%0A        m.push(%5B%0A          function()%7B%0A            send(sys.currentPage().name, %22/ban %22+nick);%0A          %7D,%0A          language%5B%22ban%22%5D%0A        %5D);%0A      %7D%0A       %0A      for(var i=0;i%3Cm.length;i++)%7B%0A         const item = document.createElement(%22div%22);%0A         item.onclick = m%5Bi%5D%5B0%5D;%0A         item.innerHTML = m%5Bi%5D%5B1%5D;%0A         menu.appendChild(item);%0A      %7D%0A      if(menu.offsetParent == null)%7B%0A        menu.style.display = %22block%22;%0A      %7Delse%7B%0A        menu.style.display = %22none%22;%0A        menu.innerHTML = %22%22;%0A      %7D%0A    %7D;%0A%0A    const menu = document.createElement(%22div%22);%0A    menu.className = %22menu%22;%0A    menu.style.display = %22none%22;%0A    container.appendChild(menu);%0A%0A    this.dom.appendChild(container);%0A
     

Update userlist.js