How to setup a command on a keybind

I don’t remember if it needs to be threaded or not, I’m sure someone will correct me if I’m wrong but you should just be able to yoink that thread out , one line it basically as I wrote it but as a function with arguments. And it should work.