<commit_before>/*
 * Copyright (c) 2014, <NAME>, https://bitbucket.org/sgt-kabukiman/
 *
 * This file is released under the terms of the MIT license. You can find the
 * complete text in the attached LICENSE file or online at:
 *
 * http://www.opensource.org/licenses/mit-license.php
 */

var TextMessage = function(channel, user, message) {
	this.channel = channel;
	this.user    = user;
	this.message = message;
};

TextMessage.prototype = {
	getChannel: function() {
		return this.channel;
	},

	getUser: function() {
		return this.user;
	},

	getUsername: function() {
		return this.user.getName();
	},

	getMessage: function() {
		return this.message;
	},

	equals: function(text) {
		return text === this.getMessage();
	},

	isOnChannel: function(channel) {
		return this.channel.equals(channel);
	},

	isFrom: function(user) {
		return this.user.equals(user);
	},

	respond: function(text) {
		return this.channel.say(text);
	}<commit_msg>follow Nightbot's good example of addressing the sender of a message<commit_after>/*
 * Copyright (c) 2014, <NAME>, https://bitbucket.org/sgt-kabukiman/
 *
 * This file is released under the terms of the MIT license. You can find the
 * complete text in the attached LICENSE file or online at:
 *
 * http://www.opensource.org/licenses/mit-license.php
 */

var TextMessage = function(channel, user, message) {
	this.channel = channel;
	this.user    = user;
	this.message = message;
};

TextMessage.prototype = {
	getChannel: function() {
		return this.channel;
	},

	getUser: function() {
		return this.user;
	},

	getUsername: function() {
		return this.user.getName();
	},

	getMessage: function() {
		return this.message;
	},

	equals: function(text) {
		return text === this.getMessage();
	},

	isOnChannel: function(channel) {
		return this.channel.equals(channel);
	},

	isFrom: function(user) {
		return this.user.equals(user);
	},

	respond: function(text) {
		return this.channel.say(this.getUsername() + ': ' + text);
	}
{'fraction_non_alphanumeric': 0.14329113924050632, 'fraction_numerical': 0.004050632911392405, 'mean_word_length': 3.8550368550368552, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4467819', 'n_tokens_mistral': 674, 'n_tokens_neox': 636, 'n_words': 165}