Przeglądaj źródła

Refactor the help command function

Authored by Waffle ;)
tags/v0.4.3^2
Vildravn 4 lat temu
rodzic
commit
a5680cd36f
1 zmienionych plików z 8 dodań i 5 usunięć
  1. +8
    -5
      src/server/components/extensions/socialCommands.js

+ 8
- 5
src/server/components/extensions/socialCommands.js Wyświetl plik

@@ -287,11 +287,14 @@ module.exports = {
},

help: function () {
this.sendMessage('You can use the following commands:', 'color-yellowB');
Object.keys(commandRoles).forEach(function (command) {
if (this.roleLevel >= commandRoles[command])
this.sendMessage(`/${command}`, 'color-yellowB');
}, this);
const msg = [
'You can use the following commands:',
...Object.keys(commandRoles)
.filter(c => this.roleLevel >= commandRoles[c])
.map(c => `/${c}`)
].join('<br />');
this.sendMessage(msg, 'color-yellowB');
},

isInChannel: function (character, channel) {


Ładowanie…
Anuluj
Zapisz