Obfield

Untitled

Aug 31st, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var userTickets = new Map();
  2. console.log('Le Bot est en ligne')
  3.  
  4. client.on("messageReactionAdd", async (reaction, user, member, message) =>{
  5.     if (reaction.message.partial) await reaction.message.fetch();
  6.     if (reaction.partial) await reaction.fetch();
  7.    
  8.  
  9.     if (user.bot) return;
  10.     if (!reaction.message.guild) return;
  11.  
  12.     if (reaction.message.channel.id === "734705729151434792"){
  13.         if (reaction.emoji.name === '✅'){
  14.             let guild = reaction.message.guild;
  15.             reaction.message.guild.channels.create(`📎${user.tag}`, {
  16.                 type: 'text',
  17.                 permissionOverwrites: [
  18.                     {
  19.                         allow: 'VIEW_CHANNEL',
  20.                         id: user.id
  21.                     },
  22.                     {
  23.                         deny: 'VIEW_CHANNEL',
  24.                         id: guild.id
  25.                     },
  26.                 ]
  27.             }).then(ch => {
  28.                 userTickets.set(user.id, ch.id);
  29.                 ch.send(
  30.  
  31.                     {
  32.                         embed: {
  33.                             color: 0xffcf08,
  34.                             title: 'Clôturer la commande ?',
  35.                             fields: [
  36.                                 {
  37.                                 name: "Si oui",
  38.                                 value: '**réagissez avec** :white_check_mark:  ',
  39.                                 inline: true
  40.                             }
  41.                         ],
  42.                         footer: {
  43.                             text: '© Anaros all right reserved',
  44.                             icon_url: 'https://i.imgur.com/dpcP8rA.png',
  45.                         },
  46.                
  47.                         }
  48.                     }
  49.                 ).then(function (message) {
  50.                     message.react('✅')
  51.                   });
  52.             })
  53.         };
  54.        
  55.     }    else if(reaction.message.channel.id === userTickets.get(user.id)){
  56.            if(reaction.emoji.name === '✅'){
  57.            
  58.             if (admins.includes(user.id)) return reaction.message.channel.send("Le ticket sera férmer"); else reaction.message.channel.send("Tu ne peux pas cloturer une commande !")
  59.        
  60.          
  61.             }
  62.        }
Add Comment
Please, Sign In to add comment