How to mute an entire channel?

So i am in a server and they want me to create a bot so they can type a command and have the voice channel they are in be muted. like everyone in the voice channel gets server muted. I tried to use the edit channel permissions block to remove speaking permissions but it didn’t seem to work. is there a way to just get the users in the channel and mute them?

my current method does work however it only works for people who join AFTER the command is run, but i need it for people currently in the vc

you could get all the roles and then update the permissions for the roles

no reply for 1 month, closing