'Invites a bot that has been registered with add_bot() to a channel.
Note that you can invite a bot to an empty (new) temporary channel.
It will stay until the first member leaves.'

def _exec_cmd_invite(self, event):

    botname = event.msg.get('bot')
    botclass = self._bots.get(botname)
    channel = event.msg.get('channel')
    new_channel = False
    if (channel is None):
        new_channel = True
        channel = self._gen_channel_name(event.msg.get('prefix', 'temp'))
    chan = self._nexus.get_channel(channel, create=True, temporary=True)
    if (chan is None):
        log.warning(('A    bot    was    invited    to    a    nonexistent    channel    (%s)' % (channel,)))
        return
    if (botclass is None):
        log.warning(('A    nonexistent    bot    (%s)    was    invited    to    a    channel' % (botname,)))
        return
    bot = botclass(channel, self._nexus)
    if new_channel:
        self.reply(event, new_channel=new_channel)
