The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/rocketchat-google-natural-l.../client/index.js

19 lines
416 B

import { Template } from 'meteor/templating';
Template.room.helpers({
sentimentSmile() {
if (!RocketChat.settings.get('GoogleNaturalLanguage_Enabled')) {
return;
}
const room = ChatRoom.findOne(this._id, { fields: { sentiment: 1 } });
if (room.sentiment >= 0.3) {
return ':)';
} else if (room.sentiment >= -0.3) {
return ':|';
} else if (room.sentiment < -0.3) {
return ':(';
}
},
});