def send_msg(self, text, channel, confirm=True):
self._send_id += <NUM_LIT:1><EOL>msg = SlackMsg(self._send_id, channel.id, text)<EOL>self.ws.send(msg.json)<EOL>self._stats['<STR_LIT>'] += <NUM_LIT:1><EOL>if confirm:<EOL><INDENT>for e in self.events():<EOL><INDENT>if e.get('<STR_LIT>') == self._send_id:<EOL><INDENT>msg.sent = True<EOL>msg.ts = e.ts<EOL>return msg<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>return msg<EOL><DEDENT>
Send a message to a channel or group via Slack RTM socket, returning
the resulting message object

params:
 - text(str): Message text to send
 - channel(Channel): Target channel
 - confirm(bool): If True, wait for a reply-to confirmation before returning.