Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
Fix: Discrim command gets amount of users.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aceheliflyer committed Apr 8, 2018
1 parent 0ad90cd commit 5b289b2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/commands/information/discrim.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ module.exports = class DiscrimCommand extends Command {

run (message, args) {
var availableUsers = this.client.users.findAll('discriminator', args.discriminator)
var messageStore = []
var userStore = []
var users = []
availableUsers.forEach(user => {
users.push(`**${escapeMarkdown(user.tag)}**`)
userStore.push(`**${escapeMarkdown(user.tag)}**`)
})

while (users.length > 0) {
userStore.push(users.splice(0, 4).join(' | '))
while (userStore.length > 0) {
messageStore.push(userStore.splice(0, 4).join(' | '))
}

if (userStore.length > 0) {
if (messageStore.length > 0) {
return message.say({
content: stripIndents`
${oneLine`There is
**${userStore.length.toLocaleString()}
${pluralize('user', userStore.length, false)}**
**${availableUsers.length.toLocaleString()}
${pluralize('user', availableUsers.length, false)}**
with the discriminator **${args.discriminator}**.`}
${userStore.join('\n')}
${messageStore.join('\n')}
`,
split: true
})
Expand Down

0 comments on commit 5b289b2

Please sign in to comment.