parent
6b6d5eeef7
commit
b8dbc50610
@ -0,0 +1,4 @@ |
||||
<template name="messagePopupSlashCommand"> |
||||
<strong>/{{_id}}</strong>{{#if params}} {{params}}{{/if}} |
||||
<div class="popup-slash-command-description"><i>{{description}}</i></div> |
||||
</template> |
||||
@ -1,20 +0,0 @@ |
||||
RocketChat.slashCommands = {} |
||||
|
||||
RocketChat.slashCommands.add = (command, callback) -> |
||||
if !RocketChat.slashCommands[command]? |
||||
RocketChat.slashCommands[command] = callback |
||||
return |
||||
|
||||
RocketChat.slashCommands.run = (command, params, item) -> |
||||
if RocketChat.slashCommands[command]? |
||||
callback = RocketChat.slashCommands[command] |
||||
callback command, params, item |
||||
|
||||
|
||||
Meteor.methods |
||||
slashCommand: (command) -> |
||||
if not Meteor.userId() |
||||
throw new Meteor.Error 203, t('User_logged_out') |
||||
|
||||
RocketChat.slashCommands.run command.cmd, command.params, command.msg |
||||
|
||||
@ -0,0 +1,26 @@ |
||||
RocketChat.slashCommands = |
||||
commands: {} |
||||
|
||||
RocketChat.slashCommands.add = (command, callback, options) -> |
||||
if not RocketChat.slashCommands.commands[command]? |
||||
RocketChat.slashCommands.commands[command] = |
||||
command: command |
||||
callback: callback |
||||
params: options?.params |
||||
description: options?.description |
||||
|
||||
return |
||||
|
||||
RocketChat.slashCommands.run = (command, params, item) -> |
||||
if RocketChat.slashCommands.commands[command]?.callback? |
||||
callback = RocketChat.slashCommands.commands[command].callback |
||||
callback command, params, item |
||||
|
||||
|
||||
Meteor.methods |
||||
slashCommand: (command) -> |
||||
if not Meteor.userId() |
||||
throw new Meteor.Error 203, t('User_logged_out') |
||||
|
||||
RocketChat.slashCommands.run command.cmd, command.params, command.msg |
||||
|
||||
@ -1,20 +0,0 @@ |
||||
RocketChat.slashCommands = {} |
||||
|
||||
RocketChat.slashCommands.add = (command, callback) -> |
||||
if !RocketChat.slashCommands[command]? |
||||
RocketChat.slashCommands[command] = callback |
||||
return |
||||
|
||||
RocketChat.slashCommands.run = (command, params, item) -> |
||||
if RocketChat.slashCommands[command]? |
||||
callback = RocketChat.slashCommands[command] |
||||
callback command, params, item |
||||
|
||||
|
||||
Meteor.methods |
||||
slashCommand: (command) -> |
||||
if not Meteor.userId() |
||||
throw new Meteor.Error 203, t('User_logged_out') |
||||
|
||||
RocketChat.slashCommands.run command.cmd, command.params, command.msg |
||||
|
||||
Loading…
Reference in new issue