added old method
gitea/salix/dev This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-01-20 12:57:33 +01:00
parent 6bdabb1848
commit 383f1f2864
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,30 @@
module.exports = Self => {
Self.remoteMethodCtx('sendMessage', {
description: 'Send a RocketChat message',
accessType: 'WRITE',
accepts: [{
arg: 'to',
type: 'String',
required: true,
description: 'user (@) or channel (#) to send the message'
}, {
arg: 'message',
type: 'String',
required: true,
description: 'The message'
}],
returns: {
type: 'Object',
root: true
},
http: {
path: `/sendMessage`,
verb: 'POST'
}
});
// FIXME: Deprecate this method #2019
Self.sendMessage = async(ctx, to, message) => {
return Self.send(ctx, to, message);
};
};

View File

@ -1,4 +1,5 @@
module.exports = Self => {
require('../methods/chat/send')(Self);
require('../methods/chat/sendMessage')(Self);
require('../methods/chat/sendCheckingPresence')(Self);
};