Pulgin: go clientless

Hello, i working on a plugin to terminate bot on incoming private chat.
but the problem is:
if i use that code to kill the bot process:

the client will not be killed even if it hidden.
so i need to do something like (go clientless then kill the bot process)

os.kill(get_client()['pid'], signal.SIGTERM)