General structure of the filter rules is taken from discourse-slack-official, but re-written to be more robust and easier to understand.