SHARE
TWEET

Untitled

a guest Nov 14th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const sug = JSON.parse(fs.readFileSync('./sug.json' , 'utf8'));
  2.  
  3. client.on('message', message => {
  4.            if (!message.channel.guild) return;
  5.  
  6.     let room = message.content.split(" ").slice(1);
  7.     let findroom = message.guild.channels.find('name', `${room}`)
  8.     if(message.content.startsWith(prefix + "setSug")) {
  9.         if(!message.channel.guild) return message.reply('**This Command Only For Servers**');
  10.         if(!message.member.hasPermission('MANAGE_GUILD')) return message.channel.send('**Sorry But You Dont Have Permission** <a:admins:642505360699031563>``MANAGE_GUILD``<a:admins:642505360699031563>' );
  11. if(!room) return message.channel.send('<a:mic:642515476874002432> Please Type The Channel Name')
  12. if(!findroom) return message.channel.send('<a:mic:642515476874002432> Cant Find This Channel')
  13. let embed = new Discord.RichEmbed()
  14. .setTitle('**<a:yes:643037581222739978> Done The Suggest Code Has Been Setup**')
  15. .addField('Channel:', `${room}`)
  16. .addField('Requested By:', `${message.author}`)
  17. .setThumbnail(message.author.avatarURL)
  18. .setFooter(`${client.user.username}`)
  19. message.channel.sendEmbed(embed)
  20. sug[message.guild.id] = {
  21. channel: room,
  22. }
  23. fs.writeFile("./sug.json", JSON.stringify(sug), (err) => {
  24. if (err) console.error(err)
  25. })
  26.    client.on('message', message => {
  27.  
  28.  
  29.     if(message.content.startsWith(`${prefix}suggest`)) {
  30.       if(!message.channel.guild) return message.reply('**This Command Only For Servers**');
  31.       let suggest = message.content.split(" ").slice(1);
  32.       if(!suggest) return message.reply(`**Please Type The Suggest**`)
  33.     let findchannel = (message.guild.channels.find('name', `${sug[message.guild.id].channel}`))
  34.     if(!findchannel) return message.channel.send(`Error 404: The Suggest Channel Cant Find Or Not Set To Set The Suggest Channel Type: ${prefix}setSug`)
  35.     message.channel.send(`Done Your Suggest Will Be Seen By The Staffs`)
  36.     let sugembed = new Discord.RichEmbed()
  37.     .setTitle('New Suggest !')
  38.     .addField('Suggest By:', `${message.author}`)
  39.     .addField('Suggest:', `${suggest}`)
  40.     .setFooter(client.user.username)
  41.     findchannel.sendEmbed(sugembed)
  42.         .then(function (message) {
  43.           message.react('✅')
  44.           message.react('❌')
  45.         })
  46.         .catch(err => {
  47.             message.reply(`Error 404: The Suggest Channel Cant Find Or Not Set To Set The Suggest Channel Type: ${prefix}setSug`)
  48.             console.error(err);
  49.         });
  50.         }
  51.       })
  52.     }})
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top