Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var userTickets = new Map();
- console.log('Le Bot est en ligne')
- client.on("messageReactionAdd", async (reaction, user, member, message) =>{
- if (reaction.message.partial) await reaction.message.fetch();
- if (reaction.partial) await reaction.fetch();
- if (user.bot) return;
- if (!reaction.message.guild) return;
- if (reaction.message.channel.id === "734705729151434792"){
- if (reaction.emoji.name === '✅'){
- let guild = reaction.message.guild;
- reaction.message.guild.channels.create(`📎${user.tag}`, {
- type: 'text',
- permissionOverwrites: [
- {
- allow: 'VIEW_CHANNEL',
- id: user.id
- },
- {
- deny: 'VIEW_CHANNEL',
- id: guild.id
- },
- ]
- }).then(ch => {
- userTickets.set(user.id, ch.id);
- ch.send(
- {
- embed: {
- color: 0xffcf08,
- title: 'Clôturer la commande ?',
- fields: [
- {
- name: "Si oui",
- value: '**réagissez avec** :white_check_mark: ',
- inline: true
- }
- ],
- footer: {
- text: '© Anaros all right reserved',
- icon_url: 'https://i.imgur.com/dpcP8rA.png',
- },
- }
- }
- ).then(function (message) {
- message.react('✅')
- });
- })
- };
- } else if(reaction.message.channel.id === userTickets.get(user.id)){
- if(reaction.emoji.name === '✅'){
- if (!reaction.guild.member(user).then(m => m.roles.has("734500346663272598"))) return reaction.message.channel.send("test")
- }
- }
- })
Add Comment
Please, Sign In to add comment