Obfield

Untitled

Aug 21st, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require('discord.js');
  2. const client = new Discord.Client({ partials: ["MESSAGE", "CHANNEL", "REACTION"]});
  3. const prefix = "/";
  4. const admins = '395927058670419973'
  5.  
  6.  
  7.  
  8. const fs = require("fs");
  9.  
  10. client.login('NzQ0NDkzODk4NTUzODg0NzQy.XzkB-Q.LGoGYVYSwZoZX0-47S2nkahBJJI');
  11.  
  12. client.commands = new Discord.Collection();
  13.  
  14. var userTickets = new Map();
  15. console.log('Le Bot est en ligne')
  16.  
  17. client.on("messageReactionAdd", async (reaction, user, member, message) =>{
  18.     if (reaction.message.partial) await reaction.message.fetch();
  19.     if (reaction.partial) await reaction.fetch();
  20.  
  21.  
  22.     if (user.bot) return;
  23.     if (!reaction.message.guild) return;
  24.  
  25.     if (reaction.message.channel.id === "734705729151434792"){
  26.         if (reaction.emoji.name === '✅'){
  27.             let guild = reaction.message.guild;
  28.             const client = (user.id)
  29.             reaction.message.guild.channels.create(`📎${user.tag}`, {
  30.                 type: 'text',
  31.                 permissionOverwrites: [
  32.                     {
  33.                         allow: 'VIEW_CHANNEL',
  34.                         id: user.id
  35.                     },
  36.                     {
  37.                         deny: 'VIEW_CHANNEL',
  38.                         id: guild.id
  39.                     },
  40.                 ]
  41.             }).then(ch => {
  42.                 userTickets.set(user.id, ch.id);
  43.                 ch.send(
  44.  
  45.                     {
  46.                         embed: {
  47.                             color: 0xffcf08,
  48.                             title: 'Clôturer la commande ?',
  49.                             fields: [
  50.                                 {
  51.                                 name: "Si oui",
  52.                                 value: '**réagissez avec** :white_check_mark:  ',
  53.                                 inline: true
  54.                             }
  55.                         ],
  56.                         footer: {
  57.                             text: '© Anaros all right reserved',
  58.                             icon_url: 'https://i.imgur.com/dpcP8rA.png',
  59.                         },
  60.                
  61.                         }
  62.                     }
  63.                 ).then(function (message) {
  64.                     message.react('✅')
  65.                   });
  66.             })
  67.         };
  68.     }  
  69. });
  70.  
  71. client.on("messageReactionAdd", async (reaction, user, member, message) =>{
  72.     if (reaction.message.partial) await reaction.message.fetch();
  73.     if (reaction.partial) await reaction.fetch();
  74.  
  75.  
  76.     if (user.bot) return;
  77.     if (!reaction.message.guild) return;
  78.  
  79.     if(reaction.message.channel.id === userTickets.get(user.id)){
  80.         if(reaction.emoji.name === '✅'){
  81.          if(admins.includes(user.id)) return reaction.message.channel.send(
  82.  
  83.              {
  84.                  embed: {
  85.                      color: 0xffcf08,
  86.                      title: `Le client as t'il payer  ?`,
  87.                     fields: [
  88.                         {
  89.                         name: "Si oui",
  90.                         value: '**réagissez avec** :white_check_mark:  ',
  91.                         inline: true
  92.                     },
  93.                     {
  94.                         name: "**Si non**",
  95.                         value: "**réagissez avec** :negative_squared_cross_mark:",
  96.                         inline: true
  97.                     }
  98.                 ],
  99.                 footer: {
  100.                     text: '© Anaros all right reserved',
  101.                     icon_url: 'https://i.imgur.com/dpcP8rA.png',
  102.                  },
  103.          
  104.                  }
  105.              }
  106.          ).then(function (message) {
  107.              message.react('🇾');
  108.              message.react('🇳')
  109.            })
  110.            else  reaction.message.channel.send(`Vous ne pouvez pas Clôturer une commande veuillez contacter un Developpeur !`)
  111.    
  112.         };
  113.     }
  114. });
Add Comment
Please, Sign In to add comment