@internationalizeDocstring
    def lart(self, irc, msg, args, channel, id, text):
        if ' for ' in text:
            (target, reason) = list(map(str.strip, text.split(' for ', 1)))
        else:
            (target, reason) = (text, '')
        if id is not None:
            try:
                lart = self.db.get(channel, id)
            except KeyError:
                irc.error(format(_('There is no lart with id #%i.'), id))
                return
        else:
            lart = self.db.random(channel)
            if not lart:
                irc.error(format(_('There are no larts in my database '
                                 'for %s.'), channel))
                return
        text = lart.text
        if ircutils.strEqual(target, irc.nick):
            target = msg.nick
            reason = self._replaceFirstPerson(_('trying to dis me'), irc.nick)
        else:
            target = self._replaceFirstPerson(target, msg.nick)
            reason = self._replaceFirstPerson(reason, msg.nick)
        if target.endswith('.'):
            target = target.rstrip('.')
        text = text.replace('$who', target)
        if reason:
            text += _(' for ') + reason
        if self.registryValue('showIds', channel):
            text += format(' (#%i)', lart.id)
        irc.reply(text, action=True)
[<channel>] [<id>] <who|what> [for <reason>]
dataset/ETHPy150Open ProgVal/Limnoria/plugins/Lart/plugin.py/Lart.lart