commit
cbbab28f70
@ -1,5 +1,5 @@ |
||||
Package.describe({ |
||||
name: 'rocketchat:me', |
||||
name: 'rocketchat:slashcommands-me', |
||||
version: '0.0.1', |
||||
summary: 'Message pre-processor that will translate /me commands', |
||||
git: '' |
||||
@ -0,0 +1,18 @@ |
||||
Package.describe({ |
||||
name: 'rocketchat:slashcommands-shrug', |
||||
version: '0.0.1', |
||||
summary: 'Message pre-processor that will translate /shrug commands', |
||||
git: '' |
||||
}); |
||||
|
||||
Package.onUse(function(api) { |
||||
api.versionsFrom('1.0'); |
||||
|
||||
api.use([ |
||||
'rocketchat:lib' |
||||
]); |
||||
|
||||
api.use('ecmascript'); |
||||
|
||||
api.addFiles('shrug.js', ['server', 'client']); |
||||
}); |
||||
@ -0,0 +1,20 @@ |
||||
/* |
||||
* Shrug is a named function that will replace /shrug commands |
||||
* @param {Object} message - The message object |
||||
*/ |
||||
|
||||
|
||||
function Shrug(command, params, item) { |
||||
if (command === 'shrug') { |
||||
var msg; |
||||
|
||||
msg = item; |
||||
msg.msg = params + ' ¯\\_(ツ)_/¯'; |
||||
Meteor.call('sendMessage', msg); |
||||
} |
||||
} |
||||
|
||||
RocketChat.slashCommands.add('shrug', Shrug, { |
||||
description: 'Slash_Shrug_Description', |
||||
params: 'your message (optional)' |
||||
}); |
||||
Loading…
Reference in new issue