UNPKG

849 BJavaScriptView Raw
1exports.command = {
2 name: "ranks",
3 autoload: true,
4 unloadable: false,
5 min_rank: 0,
6 display: "list the talker's ranks, and points out which one is yours",
7 help: "List the talker's ranks, and points out which one is yours.",
8 usage: ".ranks",
9
10 execute: function(socket, command, command_access) {
11 var chalk = require('chalk');
12 var ranks = command_access.ranks;
13 socket.write(chalk.green("+----------------------------------------------------------------------------+\r\n"));
14 for (var r = 0 ; r < ranks.list.length; r++) {
15 var text = (" " + r).slice(-3) + "\t: " + (ranks.list[r] + " ").substr(0,11);
16 if (socket.db.rank == r) text += chalk.yellow.bold("\t<- you");
17 socket.write(text+"\r\n");
18 }
19 socket.write(chalk.green("+----------------------------------------------------------------------------+\r\n"));
20 }
21}