parent
d27138da31
commit
7dd7924c76
@ -0,0 +1,21 @@ |
||||
### |
||||
# Leave is a named function that will replace /leave commands |
||||
# @param {Object} message - The message object |
||||
### |
||||
|
||||
if Meteor.isClient |
||||
RocketChat.slashCommands.add 'leave', undefined, |
||||
description: 'Leave the current channel' |
||||
params: '' |
||||
|
||||
RocketChat.slashCommands.add 'part', undefined, |
||||
description: 'Leave the current channel' |
||||
params: '' |
||||
else |
||||
class Leave |
||||
constructor: (command, params, item) -> |
||||
if(command == "leave" || command == "part") |
||||
Meteor.call 'leaveRoom', item.rid |
||||
|
||||
RocketChat.slashCommands.add 'leave', Leave |
||||
RocketChat.slashCommands.add 'part', Leave |
||||
@ -0,0 +1,20 @@ |
||||
Package.describe({ |
||||
name: 'rocketchat:slashcommands-leave', |
||||
version: '0.0.1', |
||||
summary: 'Message pre-processor that will translate /leave commands', |
||||
git: '' |
||||
}); |
||||
|
||||
Package.onUse(function(api) { |
||||
api.versionsFrom('1.0'); |
||||
|
||||
api.use([ |
||||
'coffeescript', |
||||
'rocketchat:lib@0.0.1' |
||||
]); |
||||
api.addFiles('leave.coffee'); |
||||
}); |
||||
|
||||
Package.onTest(function(api) { |
||||
|
||||
}); |
||||
Loading…
Reference in new issue