You can tell it’s a joke because they stated their intent to keep quiet, but didn’t. The humor comes from the surprising difference between what was stated, and reality.
https://en.wikipedia.org/wiki/Apophasis
- "Apophasis (/əˈpɒfəsɪs/; from Ancient Greek ἀπόφασις (apóphasis), from ἀπόφημι (apóphemi) 'to say no')[1][2] is a rhetorical device wherein the speaker or writer brings up a subject by either denying it, or denying that it should be brought up.[3] Accordingly, it can be seen as a rhetorical relative of irony."