text: const Discord = require("discord.js");
  const prefix = "u!";
  
  const rgbcolor = require('rgbcolor');
  const getImageColors = require('get-image-colors');
  
  module.exports.run = async (client, message, args, User, db) => {
  
      const unitedGuild = client.guilds.get('455652326066094091');
  
      const messageArray = message.content.split(/\s+/g);
      const otherArgs = messageArray.slice(1);
      const command = messageArray[0].slice(prefix.length).toLowerCase();
  
      message.delete().catch(O_o => {});
  
      User.findOne({
          id: message.author.id
      }).then((currentUser) => {
          if (currentUser) {
              User.findOne({
                  id: message.author.id
              }, function(err, users) {
  
                  setTimeout(function() {
                      for (let i = 0; i < users.serverID.length; i++) {
  
  
                          if (users.serverStatus[i] === `Owner`) {
                              newRoleName = `Владелец - \n${users.serverName[i]}`;
                          }
                          if (users.serverStatus[i] === `Admin`) {
                              newRoleName = `Администратор - \n${users.serverName[i]}`;
                          }
  
                          message.channel.send(`**users.serverName[i]=${users.serverName[i]}**`);
                          message.channel.send(`**newRoleName=${newRoleName}**`);
  
                          let thisGuildIconURL = client.guilds.get(users.serverID[i]).iconURL;
  
                          let colors = getImageColors(thisGuildIconURL).then(color => {
  
                              let c = color.map(col => col.hex());
                              let roleColor = c[0];
                              let guildRoleServer = unitedGuild.roles.find("name", users.serverName[i]);
  
                              if (guildRoleServer) {
                                  member.addRole(guildRoleServer.id);
                              } else {
                                  unitedGuild.createRole({
                                      name: users.serverName[i],
                                      color: roleColor,
                                      mentionable: true,
                                  }).then((role) => {
                                      member.addRole(role);
                                      console.log(`Роль ${users.serverName[i]} создана!`);
                                  });
  
                              }
  
  
  
                              let guildRole = unitedGuild.roles.find("name", newRoleName);
  
                              if (guildRole) {
                                  member.addRole(guildRole.id);
                              } else {
                                  unitedGuild.createRole({
                                      name: newRoleName,
                                      mentionable: true,
                                  }).then((role2) => {
                                      member.addRole(role2);
                                      console.log(`Роль ${newRoleName} создана!`);
                                  });
  
                              }
                          });
  
                      }
                  }, 1000);
  
  
              });
          }
      });
  
  
  
  
  };
  module.exports.help = {
      name: "test"
  };
  