Skip to content

Instantly share code, notes, and snippets.

@davelnewton
Created September 28, 2020 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davelnewton/e23264cfab46beb7a4e899f71e363bf0 to your computer and use it in GitHub Desktop.
Save davelnewton/e23264cfab46beb7a4e899f71e363bf0 to your computer and use it in GitHub Desktop.
Indentation helps find structural issues
client.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot) return
let user = message.mentions.users.first()
const args = message.content.slice(prefix.length).split(/ +/)
const command = args.shift().toLowerCase()
if (command === 'marry') {
if (!user) return
const aEmbed = new Discord.MessageEmbed()
.setColor(0xff0000)
.setTitle('Error')
.addField('You need to mention a user you dummy!')
message.channel.send(aEmbed)
} else {
message.channel.send('You are now married to: ' + "<@" + user + ">")
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment