Untitled

 avatar
unknown
plain_text
2 years ago
5.0 kB
11
Indexable
const Discord = require('discord.js-selfbot-v13');
const client = new Discord.Client({
  readyStatus: false,
  checkUpdate: false
});

const keepAlive = require('./server.js');
keepAlive();

function formatTime() {
  const date = new Date();
  const options = {
    timeZone: 'America/New_York',
    hour12: true,
    hour: 'numeric',
    minute: 'numeric'
  };
  return new Intl.DateTimeFormat('en-US', options).format(date);
}
const prefix = '!';

client.on('ready', async () => {
  console.clear();
  console.log(`${client.user.tag} - rich presence started!`);

  const r = new Discord.RichPresence()
    .setApplicationId('') /////////هنا بتحط اي دي حسابك-
    .setType('STREAMING')
    .setURL('https://youtube.com/@QuranC5959?si=2rnRHTilalshKCyq')
    .setState('.Def')
    .setName('.Def')
    .setDetails(`.Def`)
    .setStartTimestamp(Date.now())
 .setAssetsLargeImage('https://cdn.discordapp.com/attachments/975074794598977576/1146402830257770607/static.png') //You can put links in tenor or discord and etc.
    .setAssetsLargeText('Unrecognized nationality') //Text when you hover the Large image
    .setAssetsSmallImage('https://cdn.discordapp.com/attachments/975074794598977576/1146402830257770607/static.png') //You can put links in tenor or discord and etc.
    .setAssetsSmallText('https://cdn.discordapp.com/attachments/975074794598977576/1146402830257770607/static.png') //Text when you hover the Small image
    .addButton('Youtube', 'https://youtube.com/@QuranC5959?si=2rnRHTilalshKCyq')
    .addButton('Paypal', 'https://www.paypal.com/paypalme/Midleg');

  client.user.setActivity(r);
  client.user.setPresence({ status: "STREAMING" }); //dnd, online, idle, offline

  let prevTime = null;
  setInterval(() => {
    const newTime = formatTime();
    if (newTime !== prevTime) {
      const newDetails = `.Def`;
      r.setDetails(newDetails);
      client.user.setActivity(r);
      prevTime = newTime;
    }
  }, 1000); // Update every second
});

client.on('messageCreate', async (message) => {
  if (message.content.startsWith('!count-tokens')) {
    // استخراج أيدي السيرفر من الرسالة
    const serverId = message.content.split(' ')[1];
    const guild = client.guilds.cache.get(serverId);

    if (guild) {
      // قم بالحصول على قائمة الأعضاء في السيرفر
      const members = await guild.members.fetch();

      // قم بعد الحصول على الأعضاء بفحص عدد التوكنات
      let tokenCount = 0;
      members.forEach((member) => {
        if (member.user.bot) {
          tokenCount++;
        }
      });

      message.channel.send(`عدد التوكنات في السيرفر: ${tokenCount}`);
    } else {
      message.channel.send('لم يتم العثور على السيرفر.');
    }
  }
});

client.on('messageCreate', async (message) => {
  if (message.content.startsWith(prefix + 'dm')) {
    // احصل على المستخدم الذي تريد إرسال الرسالة له
    const userToDM = message.mentions.users.first();
    
    if (userToDM) {
      // احصل على نص الرسالة بعد الأمر !dm
      const messageContent = message.content.slice((prefix + 'dm').length).trim();

      // أرسل الرسالة إلى الخاص بالمستخدم بصورة مُنسقة واحترافية
      try {
        const dmChannel = await userToDM.createDM();
        const embed = {
          color: 0x0099ff, // لون الإمبد
          title: 'رسالة جديدة',
          description: `**الرسالة:** ${messageContent}`,
          footer: {
            text: `من ${message.author.tag}`,
            icon_url: message.author.displayAvatarURL({ format: 'png', dynamic: true })
          }
        };
        
        await dmChannel.send({ embeds: [embed] });
        message.reply(`تم إرسال رسالتك بنجاح إلى ${userToDM.tag}`);
      } catch (error) {
        console.error(`حدث خطأ أثناء محاولة إرسال الرسالة: ${error}`);
        message.reply('حدث خطأ أثناء محاولة إرسال الرسالة.');
      }
    } else {
      message.reply('الرجاء منشن الشخص الذي تريد إرسال الرسالة له.');
    }
  }
});

const responses = [
  'تفضل',
  'شو',
  'هلا',
  'مشغول',
  'عندي مدرسة',
  'امتحانات',
  'ولا',
  'تمنشنش',
  'باجي بفعصك',
  'ولااااااااا',
  'خلص',
  'يا الله',
  'لا تمنشن',
  'بقلك لا تمنشن'
];

client.on('message', (message) => {
  // التحقق مما إذا كانت الرسالة تحتوي على منشن للبوت
  if (message.mentions.has(client.user)) {
    // اختيار رد عشوائي وإرساله
    const randomResponse = responses[Math.floor(Math.random() * responses.length)];
    message.channel.send(randomResponse);
  }
});

const mySecret = process.env['mySecret'];
client.login(mySecret);
Editor is loading...