def sendChatMessage(self, text, id=None, user=None, group=None, channel=None, parse='none', link_names=True, unfurl_links=True, unfurl_media=False, send_with_api=False, icon_emoji=None, icon_url=None, username=None, attachments=None, thread_ts=None, reply_broadcast=False):
		"""
		Sends a chat message to a given id, user, group or channel.

		If the API token is not a bot token (xoxb), ``send_with_api`` may be set
		to True.  This will send messages using ``chat.postMessage`` in the Slack
		API, instead of using the WebSockets channel.

		This makes the message sending process a little bit slower, however
		permits writing of messages containing hyperlinks, like what can be done
		with Incoming and Outgoing Webhooks integrations.

		Bots are not permitted by Slack to use ``chat.postMessage`` so this will
		result in an error.

		Note: channel names must **not** be preceeded with ``#``.
		"""
		if id is not None:
			assert user is None, 'id and user cannot both be set.'
			assert group is None, 'id and group cannot both be set.'
			assert channel is None, 'id and channel cannot both be set.'
		elif user is not None:
			assert group is None, 'user and group cannot both be set.'
			assert channel is None, 'user and channel cannot both be set.'

			# Private message to user, get the IM name
			id = self.meta.find_im_by_user_name(user, auto_create=True)[0]
		elif group is not None:
			assert channel is None, 'group and channel cannot both be set.'

			# Message to private group, get the group name.
			id = self.meta.find_group_by_name(group)[0]
		elif channel is not None:
			# Message sent to a channel
			id = self.meta.find_channel_by_name(channel)[0]
		else:
			raise Exception, 'Should not reach here.'

		if send_with_api:
			return self.meta.api.chat.postMessage(
				token=self.meta.token,
				channel=id,
				text=text,
				parse=parse,
				link_names=link_names,
				unfurl_links=unfurl_links,
				unfurl_media=unfurl_media,
				icon_url=icon_url,
				icon_emoji=icon_emoji,
				username=username,
				attachments=attachments,
				thread_ts=thread_ts,
				reply_broadcast=reply_broadcast,
			)
		else:
			assert icon_url is None, 'icon_url can only be set if send_with_api is True'
			assert icon_emoji is None, 'icon_emoji can only be set if send_with_api is True'
			assert username is None, 'username can only be set if send_with_api is True'

			return self.sendCommand(
				type='message',
				channel=id,
				text=text,
				parse=parse,
				link_names=link_names,
				unfurl_links=unfurl_links,
				unfurl_media=unfurl_media,
				thread_ts=thread_ts,
				reply_broadcast=reply_broadcast,
			)
Sends a chat message to a given id, user, group or channel.

		If the API token is not a bot token (xoxb), ``send_with_api`` may be set
		to True.  This will send messages using ``chat.postMessage`` in the Slack
		API, instead of using the WebSockets channel.

		This makes the message sending process a little bit slower, however
		permits writing of messages containing hyperlinks, like what can be done
		with Incoming and Outgoing Webhooks integrations.

		Bots are not permitted by Slack to use ``chat.postMessage`` so this will
		result in an error.

		Note: channel names must **not** be preceeded with ``#``.