Obfield

Untitled

Aug 20th, 2020
111
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.     }    else if(reaction.message.channel.id === userTickets.get(user.id)){
  55.            if(reaction.emoji.name === '✅'){
  56.             if(admins.includes(user.id)) return reaction.message.channel.send(
  57.  
  58.                 {
  59.                     embed: {
  60.                         color: 0xffcf08,
  61.                         title: `Le client as t'il payer  ?`,
  62.                        fields: [
  63.                            {
  64.                            name: "Si oui",
  65.                            value: '**réagissez avec** :white_check_mark:  ',
  66.                            inline: true
  67.                        },
  68.                        {
  69.                            name: "**Si non**",
  70.                            value: "**réagissez avec** :negative_squared_cross_mark:",
  71.                            inline: true
  72.                        }
  73.                    ],
  74.                    footer: {
  75.                        text: '© Anaros all right reserved',
  76.                        icon_url: 'https://i.imgur.com/dpcP8rA.png',
  77.                     },
  78.            
  79.                     }
  80.                 }
  81.             ).then(function (message) {
  82.                 message.react('✅');
  83.                 message.react('❎')
  84.               })
  85.               else reaction.message.channel.send(`Vous ne pouvez pas Clôturer une commande veuillez contacter un Developpeur !`)
  86.        
  87.            }
  88.        }
  89. })
Add Comment
Please, Sign In to add comment