To prevent a message from being sent to your IRC client, the IRC server would have to support such a feature on the server side. Some IRC networks, such as Undernet, support a
/silence command which may be what you are looking for. If you are on a different IRC network, you would need to join their help channel to ask if they support such a feature.