瀏覽代碼

Merge branch '1353-help-command' into 'master'

Add help command

Closes #1353

See merge request Isleward/isleward!442
tags/v0.4.3^2
Big Bad Waffle 4 年之前
父節點
當前提交
76215eb1dc
共有 1 個文件被更改,包括 14 次插入1 次删除
  1. +14
    -1
      src/server/components/extensions/socialCommands.js

+ 14
- 1
src/server/components/extensions/socialCommands.js 查看文件

@@ -17,6 +17,7 @@ let commandRoles = {
roll: 0,
block: 0,
unblock: 0,
help: 0,

//Mods
ban: 5,
@@ -59,7 +60,8 @@ const localCommands = [
'unblock',
'broadcast',
'saveAll',
'ban'
'ban',
'help'
];

//Actions that should appear when a player is right clicked
@@ -284,6 +286,17 @@ module.exports = {
});
},

help: function () {
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) {
return character.auth.customChannels.some(c => (c === channel));
},


Loading…
取消
儲存