Advertisement
ninja-gen

Opt in

Oct 19th, 2019
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     const command = 'opt-in'
  2.     const command2 = 'opt-out'
  3.     const command3 = 'opt-in -y'
  4.     let user = message.author
  5.     let dataLog = client.guilds.find("id", "586817026522218507").channels.find("name","data-collection-logs")
  6.     let optEmbed = new Discord.RichEmbed()
  7.     .setTitle("Data Collection Opt-In")
  8.     .setColor(0xFF0000)
  9.     .setTimestamp()
  10.     .setDescription(`Hey there <@${user.id}>, I see you've found my latest update! As per the new Discord Developer Terms of Service, I now have to get your permission to collect your data. Now, before you get concerned, you should know the only data I collect on you is your account creation date, the day you joined the server, and your username and ID when you run the /userinfo command. These pieces of information are all publicly accessable with the Discord API and SDK. That being said, you now have a choice.`)
  11.    .addField("Agree To Opt-In", `nb/${command} -y`)
  12.    .addField("Disagree To Opt-In", `nb/${command2} -y`)
  13.    .addField("Please Note", "If you choose no We **WILL NOT** Store and use your data")
  14.    .setFooter(`© Ninja Bot v1.00`);
  15.    message.delete().catch()
  16.  
  17.    if(!args[0]) return message.channel.send(optEmbed)
  18. let optEmbed2 = new Discord.RichEmbed()
  19.    .setTitle("Opt-In Successful :white_check_mark:")
  20.    .setColor(0xFF0000)
  21.    .setTimestamp()
  22.    .setDescription(`<@${message.author.id}> Thanks for Opting in!!`)
  23.    .setFooter(`© Ninja Bot v1.00`);
  24.  
  25. let optEmbed3 = new Discord.RichEmbed()
  26.    .setTitle("Data Collection Log")
  27.    .setColor(0xFF0000)
  28.    .setTimestamp()
  29.    .setDescription("A user has Opted in to Data Collection")
  30.    .addField("User Opted", `<@${user.id}>#${user.discriminator}`)
  31.    .addField("User Tag", `${user.username}#${user.discriminator}`)
  32.    .addField("Opted Server", `${message.channel.guild}`)
  33.    .setFooter(`© Ninja Bot v1.00`);
  34.    //dataLog.send(`@${user.username} has just opted into data collection`)  //OutDated Causes Duplicate
  35.    dataLog.send(optEmbed3)  //OutDated Causes Duplicate
  36.    message.delete().catch()
  37.    if(args[0] === "-y") return message.channel.send(optEmbed2).then(console.log(`${user.username} has just opted into data collection.`))
  38.    //if(args[0] === "-y") return message.channel.send(optEmbed3);
  39. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement