<commit_before>exports.mod = function(context, server)
{
	this.topics = {};
	
	this.$loaded = function(name)
	{
		server.fire('register^' + name);
	}

	this._loaded = function()
	{
		server.fire('register');
	}

	this._register = function(topic, $sender, $name)
	{
		this.topics[topic] = $name;
	}

	this.$unloaded = function(name)
	{
		if(this.topics[name] !== undefined) delete this.topics[name];
	}

	this.core$cmd = function(prefix, target, cmd, params, $core)
	{
		switch(cmd)
		{
			case 'help':
				var syntax = 'Syntax: help <topic>';
				var topic = params[0];

				if(topic === undefined)
				{
					$core._privmsg(target, syntax);
					$core._privmsg(target, 'Topics: ' + Object.keys(this.topics).join(', '));
					break;
				}

				if(this.topics[topic] === undefined)
				{
					$core._privmsg(target, 'No help available for \'' + topic + '\'');
					break;
				}

				var h = server.do(this.topics[topic] + '$help', topic, params.slice(1));

				if(h === undefined)
				{
					$core._privmsg(target, 'No help available for \'' + topic + '\'');
					break;
				}

				if(typeof h === 'string')
				{
					$core._privmsg(target, topic + ': ' + h);
					break;
				}
				else if(typeof h === 'object')
				{
					if(h.text !== undefined)
					{
						$core._privmsg(target, topic + ': ' + h.text);
					}

					if(h.sub !== undefined)
					{
						$core._privmsg(target, 'Sub-topics: ' + h.sub.join(', '));
					}
				}

				break;
		}
	}
}<commit_msg>Fixed help output to show entire help topic.<commit_after>exports.mod = function(context, server)
{
	this.topics = {};
	
	this.$loaded = function(name)
	{
		server.fire('register^' + name);
	}

	this._loaded = function()
	{
		server.fire('register');
	}

	this._register = function(topic, $sender, $name)
	{
		this.topics[topic] = $name;
	}

	this.$unloaded = function(name)
	{
		if(this.topics[name] !== undefined) delete this.topics[name];
	}

	this.core$cmd = function(prefix, target, cmd, params, $core)
	{
		switch(cmd)
		{
			case 'help':
				var syntax = 'Syntax: help <topic>';
				var topic = params[0];
				var topic_all = params.join(' ');

				if(topic === undefined)
				{
					$core._privmsg(target, syntax);
					$core._privmsg(target, 'Topics: ' + Object.keys(this.topics).join(', '));
					break;
				}

				if(this.topics[topic] === undefined)
				{
					$core._privmsg(target, 'No help available for \'' + topic + '\'');
					break;
				}

				var h = server.do(this.topics[topic] + '$help', topic, params.slice(1));

				if(h === undefined)
				{
					$core._privmsg(target, 'No help available for \'' + topic + '\'');
					break;
				}

				if(typeof h === 'string')
				{
					$core._privmsg(target, topic_all + ': ' + h);
					break;
				}
				else if(typeof h === 'object')
				{
					if(h.text !== undefined)
					{
						$core._privmsg(target, topic_all + ': ' + h.text);
					}

					if(h.sub !== undefined)
					{
						$core._privmsg(target, 'Sub-topics: ' + h.sub.join(', '));
					}
				}

				break;
		}
	}
}
{'fraction_non_alphanumeric': 0.19314019314019315, 'fraction_numerical': 0.001332001332001332, 'mean_word_length': 2.5804529201430273, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7437832', 'n_tokens_mistral': 1394, 'n_tokens_neox': 1087, 'n_words': 198}