I usually ask them to stop repeatedly, nicely at first, and threaten them with reports.
OR...
If you're the carry or at least a valuable member of the team that's doing ok, you can always threaten them with inting. I once told a flamer "If you don't shut up right now, I'll just AFK walk right into their fountain repeatedly until you stop. Do you want to play a 3v7? I don't care if I'm 10/1, I'll do it. I don't mind losing this game." He stopped. It won't work with everyone, and not in every game, but if you sound serious enough and they actually care about winning, they'll at least think twice about typing anything. I don't advice actually inting if they get bold and cocky after threatening with that, though. Good people would just laugh their failed bluff out, mute the guy and maybe try to type some positivity into your most reasonable teammates. I'd just keep my word and int hard, though. I'm a weak asshole.