<commit_before>###
# Invite is a named function that will replace /invite commands
# @param {Object} message - The message object
###

class Invite
	constructor: (command, params, item) ->
		if(command == "invite")
			if _.trim params
				user = Meteor.users.findOne({ username: String(params) })
				Meteor.runAsUser user._id, ->
					Meteor.call 'joinRoom', item.rid

RocketChat.slashCommands.add 'invite', Invite<commit_msg>I guess we should make sure the user we're inviting is there<commit_after>###
# Invite is a named function that will replace /invite commands
# @param {Object} message - The message object
###

class Invite
	constructor: (command, params, item) ->
		if(command == "invite")
			if _.trim params
				user = Meteor.users.findOne({ username: String(params) })

				if user?
					Meteor.runAsUser user._id, ->
						Meteor.call 'joinRoom', item.rid

RocketChat.slashCommands.add 'invite', Invite
{'fraction_non_alphanumeric': 0.12213740458015267, 'fraction_numerical': 0.0, 'mean_word_length': 3.962162162162162, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '412154', 'n_tokens_mistral': 322, 'n_tokens_neox': 283, 'n_words': 92}