Force AFK spectators to go into spectate

Hi I was wondering if anyone could help:

People tend to go AFK whilst in my server which I don’t mind because then it looks more populated but I have it to go into spectate after 180 seconds and I was wondering if there is a command to force the player into spectate or if there is a plugin for it.

Thanks in advance.

ScriptFodder got such an addon.