Remove/Disable 'disconnect' command?

I have tried to look around but did not find anything that could answer my question.
I would like to know, is it possible, anyhow, even though it might be a binary module, or lua, to remove/disable the ‘disconnect’ command?
I am working on a bit creepy gamemode, and if the sanity got lower than 20% then the player should not be able to use the disconnect command for around 30 seconds.

If the player wants to disconnect then let him do it.

Nope, blocked.

But there is some kind of exploit when opening the chatbox.

Are you talking about not allowing the player to disconnect or not allowing the player to run the ‘disconnect’ command in console. If it is the latter then I believe you can just use

function GM:PlayerBindPress( ply, bind, pressed )
if string.find( bind, “disconnect” ) then
return true

Although you shouldn’t be stopping a player from disconnecting

You can block the run of any console command in a binary module, but since they can disconnect by many means other than console command, i would just use SW’s hook, and maybe catch quit as well.