Asalamualikum sheikh, my friend has a big group chat where many muslims and "students of knowledge" sadly use the n word and the likes of it, even the moderators. Is it a sin upon my friend for not adding any rules of not swearing and taking necessary actions? He has the ability to do so.

Ustadh AbdulAziz al-Haqqan
Changing with the hand is obliged upon whoever has the authority to change it, as Imam Ibn Baz put it, each within the limits of what he is responsible for, so if your friend is able to stop this and leaves it, a share of the sin reaches him. He should set the rule, warn them, and remove the one who insists.