Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. ```js
  2. const client = new Discord.Client()
  3. module.exports.run = (client, message, args) => {
  4. message.delete(500);
  5. function newChannel() {
  6. return message.id;
  7. }
  8. message.guild.createChannel(`${message.id}`, "text")
  9. .then(newChannel => newChannel.setParent("405360701138403338"))
  10. .then(newChannel => newChannel.overwritePermissions(message.author, {VIEW_CHANNEL: true, SEND_MESSAGES: true, EMBED_LINKS: true, ATTACH_FILES: true, READ_MESSAGE_HISTORY: true, MENTION_EVERYONE: true, USE_EXTERNAL_EMOJIS: true, ADD_REACTIONS: true, SEND_TTS_MESSAGE: true}))
  11. .then(newChannel => newChannel.overwritePermissions(message.guild.defaultRole, {VIEW_CHANNEL: false}))
  12. .then(newChannel => newChannel.overwritePermissions(message.guild.roles.find("name", "Support Team"), {VIEW_CHANNEL: true, SEND_MESSAGES: true, EMBED_LINKS: true, ATTACH_FILES: true, READ_MESSAGE_HISTORY: true, MENTION_EVERYONE: true, USE_EXTERNAL_EMOJIS: true, ADD_REACTIONS: true, SEND_TTS_MESSAGE: true}))
  13. .then(newChannel => newChannel.overwritePermissions(message.guild.roles.find("name", "Artion Bots"), {VIEW_CHANNEL: true, SEND_MESSAGES: true, EMBED_LINKS: true, ATTACH_FILES: true, READ_MESSAGE_HISTORY: true, MENTION_EVERYONE: true, USE_EXTERNAL_EMOJIS: true, ADD_REACTIONS: true, SEND_TTS_MESSAGE: true}))
  14. .then(newChannel => newChannel.send(`Hello ${message.author}.\n\nThank you for requesting our support. We will respond to you once our staff members are online and we will get back to you as soon as possible.\n\nPlease be patient while waiting.`));
  15. message.reply(`your ticket has been created at ${newChannel.channel.name}.`);
  16. };
  17.  
  18. module.exports.help = {
  19. name: "new"
  20. };
  21. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement