Skip to content

Commit

Permalink
return if message does not start with guild prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-taxiera committed Mar 31, 2018
1 parent bd5f82d commit 1871897
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ bot.on('ready', () => {
bot.on('messageCreate', async (msg) => {
if (!msg.member || msg.member.id === bot.user.id) return
const { prefix } = await database.getClient(msg.channel.guild.id)
if (!msg.content.startsWith(prefix)) return
let params = msg.content.substring(prefix.length).split(' ')
let command = commands[params.splice(0, 1)[0]]; if (!command) return

Expand Down

0 comments on commit 1871897

Please sign in to comment.