Skip to content

Commit

Permalink
0.6.32: .spod: show a fixed number of results
Browse files Browse the repository at this point in the history
While .spod is spooted to list the "top users" of a certain category,
it was showing all of them. This is now changed, and it only shows a
fixed number of the top results (currently hard-coded at 20).

Closes: #40
Closes: #108
  • Loading branch information
marado committed Apr 23, 2021
1 parent 698b7ca commit add5c53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion commands/spod.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ exports.command = {
var chalk = require('chalk');
var formatters = require('../utils/formatters.js');
var userlist;
var spodlength = 20; // default length of the spod results

// the usertime is found in a different way, depending on if they're online or not
// TODO: consider moving this into an helper function that can be used on .exa and elsewhere
Expand All @@ -32,7 +33,7 @@ exports.command = {
command_access.sendData(socket, "Invalid argument. Check .help " + this.name + " for usage instructions.\r\n");
return;
}
for (let index = 0; index < userList.length; index++) {
for (let index = 0; index < ((userList.length < spodlength) ? userList.length : spodlength); index++) {
const userObject = userList[index];

if(socket.username == userObject.username) { // hey, it's me!
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "TalkerNode",
"version": "0.6.31",
"version": "0.6.32",
"description": "TalkerNode is a Talker base, written in Node.js.",
"main": "TalkerNode.js",
"repository": {
Expand Down

0 comments on commit add5c53

Please sign in to comment.