<commit_before>'use babel';
'use strict';

import { stripIndents } from 'common-tags';
import Command from '../command';

export default class ListAllowedChannelsCommand extends Command {
	constructor(bot) {
		super(bot, {
			name: 'allowed-channels',
			aliases: ['list-allowed-channels', 'show-allowed-channels', 'allowed-chans'],
			module: 'channels',
			memberName: 'list-allowed',
			description: 'Lists all channels command operation is allowed in.',
			guildOnly: true
		});
	}

	async run(message) {
		const channels = this.bot.storage.allowedChannels.find(message.guild);
		if(channels.length > 0) {
			return stripIndents`
				__**Allowed channels**__
				${channels.map(channel => `**-** <#${channel.id || channel}>`).join('\n')}
			`;
		} else {
			return 'There are no channels specifically allowed, therefore operation is allowed in any channel.';
		}
	}
}<commit_msg>Fixed potential error<commit_after>'use babel';
'use strict';

import { stripIndents } from 'common-tags';
import Command from '../command';

export default class ListAllowedChannelsCommand extends Command {
	constructor(bot) {
		super(bot, {
			name: 'allowed-channels',
			aliases: ['list-allowed-channels', 'show-allowed-channels', 'allowed-chans'],
			module: 'channels',
			memberName: 'list-allowed',
			description: 'Lists all channels command operation is allowed in.',
			guildOnly: true
		});
	}

	async run(message) {
		const channels = this.bot.storage.allowedChannels.find(message.guild);
		if(channels.length > 0) {
			return stripIndents`
				__**Allowed channels**__
				${channels.map(channel => `**-** <#${channel ? channel.id : channel}>`).join('\n')}
			`;
		} else {
			return 'There are no channels specifically allowed, therefore operation is allowed in any channel.';
		}
	}
}
{'fraction_non_alphanumeric': 0.14918676388109928, 'fraction_numerical': 0.0011217049915872126, 'mean_word_length': 4.262536873156342, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '351304', 'n_tokens_mistral': 601, 'n_tokens_neox': 539, 'n_words': 143}