Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js")
  2. let db = require("quick.db")
  3.  
  4. module.exports.run = async (bot, message, args) => {
  5.  
  6.   let pUser = message.author.id
  7.   let sUser = message.mentions.users.first()
  8.  
  9.   if (!sUser) {
  10.     return message.channel.send(`You need to specify who you want to pay! Proper command usage: \`${prefix}propose @user\``)
  11.   }
  12.  
  13.   const filter = m => m.author.id === sUser.id
  14.   message.channel.send(`<@${sUser.id}>, <@${pUser}> wants to marry you? Type \`I do\` to accept!`)
  15.  
  16.   message.channel.awaitMessages(filter, {max: 1, time: 10000}).then(collected => {
  17.  
  18.     let check = collected.first().content
  19.     console.log()
  20.  
  21.     if (check === "I do" || check === "i do") {
  22.       db.set(`spouse_${pUser.id}`, sUser.id)
  23.       db.set(`spouse_${sUser.id}`, pUser.id)
  24.  
  25.       return message.channel.send(`🎉 Congratulations! 🎉\n${pUser} and <@${sUser.id}> are now married!`)
  26.     } else {
  27.       return message.channel.send(`@${sUser.id}, that wasn't the right thing to say...`)
  28.    }
  29.  
  30.  }).catch(err => {
  31.    console.log(err)
  32.  })
  33.  
  34. } //End of module.
  35.  
  36. module.exports.help = {
  37.  name: "propose",
  38.  alias: ["marry"]
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement