Advertisement
Seb

Untitled

Seb
Aug 26th, 2023
1,002
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const {
  2.   Client,
  3.   GatewayIntentBits,
  4.   Events,
  5.   Collection,
  6.   ActivityType,
  7.   EmbedBuilder,
  8. } = require("discord.js");
  9. require("../../slash");
  10. const config = require("../../config.json");
  11.  
  12. const client = new Client({
  13.   intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers],
  14. });
  15.  
  16. client.commands = new Collection();
  17.  
  18. ["events", "Slash"].forEach((el) => {
  19.   require(`../../handlers/${el}`)(client);
  20. });
  21.  
  22. let status = [
  23.   {
  24.     name: "👽 Jte watch!",
  25.     type: ActivityType.Custom,
  26.   },
  27. ];
  28.  
  29. client.on("ready", (c) => {
  30.   console.log(`⌛ ${c.user.tag} démarre...`);
  31.   console.log(`✅ ${c.user.tag} a démarré!`);
  32.  
  33.   setInterval(() => {
  34.     let random = Math.floor(Math.random() * status.length);
  35.     client.user.setActivity(status[random]);
  36.   }, 10000);
  37. });
  38.  
  39. client.on("interactionCreate", (interaction) => {
  40.   if (!interaction.isChatInputCommand()) return;
  41.   if (!interaction.member.roles.cache.has("1072309575480508426")) {
  42.     const aide = new EmbedBuilder()
  43.       //figure out how to prevent people from seeing this command
  44.       .setColor("#fcba03")
  45.       .setTitle("Bot status")
  46.       .setDescription("Ta pas accès a cette commande");
  47.     return;
  48.   }
  49.  
  50.   if (interaction.commandName === "aide") {
  51.     const aide = new EmbedBuilder()
  52.       //.setTitle('Je viens de start!')
  53.       .setColor("#fcba03")
  54.       .setTitle("Bot status")
  55.       .setURL("https://discord.gg/secretlife")
  56.       .setAuthor({
  57.         name: "Informations",
  58.         iconURL: "https://i.imgur.com/iTvSZG3.png",
  59.         url: "https://discord.js.org",
  60.       })
  61.       .setDescription(
  62.         `Date de création du projet: <t:${parseInt(
  63.           client.user.createdAt / 1000
  64.         )}:R>`
  65.       )
  66.       .setThumbnail("https://i.imgur.com/f7BPrrA.png")
  67.       .addFields(
  68.         {
  69.           name: "Liste des commandes pour le staff",
  70.           value:
  71.             "Dans la liste, vous pouvez cliquer sur les commandes pour les utiliser directement",
  72.         },
  73.         //{ name: "\u200B", value: "\u200B" },
  74.         {
  75.           name: "</douane:1144800275576668200>",
  76.           value: "Donnez la douane",
  77.           inline: true,
  78.         },
  79.         {
  80.           name: "</immigrant:1144799934164504618>",
  81.           value: "Retirez la douane",
  82.           inline: true,
  83.         }
  84.       )
  85.       .addFields({
  86.         name: "</aide:1144865046627889292>",
  87.         value: "Panneau d'aide",
  88.         inline: true,
  89.       })
  90.       //.setImage("https://i.imgur.com/AfFp7pu.png")
  91.       .setTimestamp()
  92.       .setFooter({
  93.         text: "Pour plus de support /soutien",
  94.         iconURL: "https://i.imgur.com/0rQTkIk.png",
  95.       });
  96.  
  97.     interaction.reply({ embeds: [aide], ephemeral: true });
  98.   }
  99. });
  100.  
  101. client.on("messageCreate", (message) => {
  102.   if (message.content === "aide") {
  103.     const aide = new EmbedBuilder()
  104.       //.setTitle('Je viens de start!')
  105.       .setColor("#fcba03")
  106.       .setTitle("Bot status")
  107.       .setURL("https://discord.gg/secretlife")
  108.       .setAuthor({
  109.         name: "Informations",
  110.         iconURL: "https://i.imgur.com/iTvSZG3.png",
  111.         url: "https://discord.js.org",
  112.       })
  113.       .setDescription(
  114.         `Date de création du projet: <t:${parseInt(c.user.createdAt / 1000)}:R>`
  115.       )
  116.       .setThumbnail("https://i.imgur.com/f7BPrrA.png")
  117.       .addFields(
  118.         {
  119.           name: "Liste des commandes pour le staff",
  120.           value:
  121.             "Dans la liste, vous pouvez cliquer sur les commandes pour les utiliser directement",
  122.         },
  123.         //{ name: "\u200B", value: "\u200B" },
  124.         {
  125.           name: "</douane:1144800275576668200>",
  126.           value: "Donnez la douane",
  127.           inline: true,
  128.         },
  129.         {
  130.           name: "</immigrant:1144799934164504618>",
  131.           value: "Retirez la douane",
  132.           inline: true,
  133.         }
  134.       )
  135.       .addFields({
  136.         name: "</aide:1144476548779483186>",
  137.         value: "Panneau d'aide",
  138.         inline: true,
  139.       })
  140.       //.setImage("https://i.imgur.com/AfFp7pu.png")
  141.       .setTimestamp()
  142.       .setFooter({
  143.         text: "Pour plus de support /soutien",
  144.         iconURL: "https://i.imgur.com/0rQTkIk.png",
  145.       });
  146.  
  147.     channel
  148.       .send({ embeds: [embed] })
  149.       .then(() => console.log("👍 confirmation envoyé"))
  150.       .catch(console.error);
  151.   } else {
  152.     console.error("Channel not found.");
  153.  
  154.     message.channel.send({ embeds: [aide] });
  155.   }
  156. });
  157. client.login(config.token);
  158.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement