Obfield

Ticket system

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