text: import { Meteor } from 'meteor/meteor';
  import { check } from 'meteor/check';
  import { hasPermission } from 'meteor/rocketchat:authorization';
  import { LivechatTrigger } from 'meteor/rocketchat:models';
  
  Meteor.methods({
  	'livechat:removeTrigger'(triggerId) {
  		if (!Meteor.userId() || !hasPermission(Meteor.userId(), 'view-livechat-manager')) {
  			throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'livechat:removeTrigger' });
  		}
  
  		check(triggerId, String);
  
  		return LivechatTrigger.removeById(triggerId);
  	},
  });
  