The Discussions API is not officially supported. The API may change at any moment, resulting in the script breaking.
Discussions Delete All invokes a button under the Discussions Count if discussions is enabled, and if the user has at least one post or reply. This button will delete all Discussions posts and replies after a confirmation window.
It is possible to remove the confirmation window. To do that, simply add the following code ABOVE the import: