Actually, that message is sent to people who both dc and afk. However if you afk you close the game/cut off your connection so you don't see it.
As far as internet connection is concerned there is no difference between ending the program establishing the connection, having the internet break somewhere along the line, or the player turning off their internet. It just isn't something that is knowable from an outside perspective. My whole career is based around computers and programming and I am telling you, there is just no way to know.
That automated message? It is just a "If connection is false, show this message" Riot isn't actually sending it, it is coded into the launcher and it can only detect if you aren't connected through any means because there is no way to tell the cause.