Refactor if statement without else
Assign prefix to globalPrefix first, so there is no need for an else statement.
This commit is contained in:
parent
a2b8660735
commit
f884b9bd14
1 changed files with 3 additions and 4 deletions
|
@ -1,9 +1,8 @@
|
|||
module.exports = function(client, owners, message, globalPrefix){
|
||||
let prefix;
|
||||
let prefix = globalPrefix;
|
||||
if (client.serverPrefixes.get(message.guild.id)) {
|
||||
prefix = client.serverPrefixes.get(message.guild.id)
|
||||
} else
|
||||
prefix = globalPrefix
|
||||
}
|
||||
|
||||
let args = message.content.slice(prefix.length).split(" ")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue