def METHOD_NAME(self, connection, event):
    channel = event.target
    nickname = event.source.nick
    if nickname == 'atbot':
        connection.privmsg(
            channel,
            '{}?{}'.format('!ao http://localhost:8866',
                           random.randint(0, 1000))
        )