Depends on the IRCd. I'm a +a on my network. In some cases and notably mine there is the ability to use /sajoin command which stops you from getting kicked and makes you immune to gags too.