Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- const client = new Discord.Client({ partials: ["MESSAGE", "CHANNEL", "REACTION"]});
- const prefix = "/";
- const admins = '395927058670419973'
- const fs = require("fs");
- client.login('NzQ0NDkzODk4NTUzODg0NzQy.XzkB-Q.LGoGYVYSwZoZX0-47S2nkahBJJI');
- client.commands = new Discord.Collection();
- 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;
- const client = (user.id)
- 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('✅')
- });
- })
- };
- }
- });
- 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 === userTickets.get(user.id)){
- if(reaction.emoji.name === '✅'){
- if(admins.includes(user.id)) return reaction.message.channel.send(
- {
- embed: {
- color: 0xffcf08,
- title: `Le client as t'il payer ?`,
- fields: [
- {
- name: "Si oui",
- value: '**réagissez avec** :white_check_mark: ',
- inline: true
- },
- {
- name: "**Si non**",
- value: "**réagissez avec** :negative_squared_cross_mark:",
- inline: true
- }
- ],
- footer: {
- text: '© Anaros all right reserved',
- icon_url: 'https://i.imgur.com/dpcP8rA.png',
- },
- }
- }
- ).then(function (message) {
- message.react('🇾');
- message.react('🇳')
- })
- else reaction.message.channel.send(`Vous ne pouvez pas Clôturer une commande veuillez contacter un Developpeur !`)
- };
- }
- });
Add Comment
Please, Sign In to add comment