Facebook
From Bistre Sheep, 2 Years ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 58
  1. var discord = require("discord.js")
  2. module.exports = {
  3.     config: {
  4.         name: "new",
  5.         aliases: []
  6.     },
  7.     run: async(reaction, user) => {
  8.         try {
  9.             reaction.message.guild.channels.create(`Sollicitatie ` + `${user.username}`, {
  10.                 type: 'text'
  11.             }).then(
  12.                 (chan) => {
  13.                     const chw = chan;
  14.                     const complete = new discord.MessageEmbed()
  15.                         .setTitle("..")
  16.                         .setColor("#3286ed")
  17.                         .setDescription("Je sollicitatie ticket is succesvol aangemaakt!")
  18.                         .addField("Ticket", `<#${chan.id}>`)
  19.                         .setThumbnail(`${user.displayAvatarURL()}`)
  20.                         .setTimestamp()
  21.                         .setFooter('', '');
  22.                     user.send(complete)
  23.                     chan.setParent("800674875743928380").then(
  24.                         (chan2) => {
  25.  
  26.                             chan2.overwritePermissions([{
  27.                                     id: reaction.message.guild.id,
  28.                                     deny: ['VIEW_CHANNEL', "SEND_MESSAGES"],
  29.                                 },
  30.                                 {
  31.                                     id: user.id,
  32.                                     allow: ['VIEW_CHANNEL', "SEND_MESSAGES"],
  33.                                 },
  34.                                 {
  35.                                     id: "769487453739810817",
  36.                                     allow: ['VIEW_CHANNEL', "SEND_MESSAGES"],
  37.                                 },
  38.                             ]);
  39.                             let embed = new discord.MessageEmbed()
  40.                                 .setTitle("Myt")
  41.                                 .setColor("#3286ed")
  42.                                 .setDescription("Hallo, " + `${user}` + "!\n\n")
  43.                                 .setTimestamp()
  44.                                 .setThumbnail(`${user.displayAvatarURL()}`)
  45.                             chan2.send(embed)
  46.                         })
  47.                 })
  48.         } catch (error) {
  49.  
  50.             return reaction.message.channel.send("error:" + error)
  51.  
  52.         }
  53.     }
  54. }