Advertisement
BETAlwrd

admin music

Jun 17th, 2025
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const admin = new Client({
  2.   intents: [
  3.     GatewayIntentBits.Guilds,
  4.     GatewayIntentBits.GuildMessages,
  5.     GatewayIntentBits.MessageContent
  6.   ]
  7. });
  8.  
  9. admin.on(Events.MessageCreate, async (message) => {
  10.   if (!message.guild || message.author.bot) return;
  11.   const args = message.content.trim().split(/ +/);
  12.   const command = args[0]?.toLowerCase();
  13.  
  14.   if (!owners.has(message.author.id)) return;
  15.  
  16.   if (command === "addtoken") {
  17.     const newToken = args[1];
  18.     if (!newToken) return message.reply("ex: addtoken [token_bot]");
  19.     const tokens = loadTokens();
  20.     if (tokens.includes(newToken)) return message.react("❌");
  21.     tokens.push(newToken);
  22.     saveTokens(tokens);
  23.     startBot(newToken);
  24.     message.react("✅");
  25.   }
  26.  
  27.   const failedTokens =[];
  28.   if (command === "info-tokens") {
  29.       const descriptionLines = [];
  30.  
  31.       bots.forEach(bot => {
  32.         const nameTag = bot.user?.tag || "Unknown#0000";
  33.         const _1 = bot.user?.id || "1";
  34.         const tokenPreview = bot.token?.slice(0, 10) || "??????????";
  35.         descriptionLines.push(
  36.           `[${nameTag}](https://discord.com/oauth2/authorize?client_id=${_1}&permissions=0&integration_type=0&scope=bot) [token: ${tokenPreview}...]`
  37.         );
  38.       });
  39.      
  40.       if (failedTokens.length > 0) {
  41.         failedTokens.forEach(t => {
  42.           descriptionLines.push(`[FAILED] [token: ${t.slice(0, 10)}...] ❌`);
  43.         });
  44.       }
  45.      
  46.      
  47.       const MAX_LENGTH = 4000;
  48.       const embeds = [];
  49.       let lines = [];
  50.       let length = 0;
  51.      
  52.       for (const line of descriptionLines) {
  53.         const lineLength = line.length + 1;
  54.         if (length + lineLength > MAX_LENGTH) {
  55.           embeds.push(
  56.             new EmbedBuilder()
  57.               .setTitle("حالة التوكنات")
  58.               .setDescription(lines.join("\n"))
  59.               .setColor("Blue")
  60.           );
  61.           lines = [];
  62.           length = 0;
  63.         }
  64.      
  65.         lines.push(line);
  66.         length += lineLength;
  67.       }
  68.      
  69.       if (lines.length > 0) {
  70.         embeds.push(
  71.           new EmbedBuilder()
  72.             .setTitle("حالة التوكنات")
  73.             .setDescription(lines.join("\n"))
  74.             .setColor("Blue")
  75.         );
  76.       }
  77.      
  78.      
  79.       for (const embed of embeds) {
  80.         await message.channel.send({ embeds: [embed] });
  81.       }
  82.  }
  83.  
  84.    
  85.    
  86. });
  87.  
  88. admin.login(config.main_bot);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement