AFAIK, archivebot currently only checks threads under level 2 headings.
But for some pages, such as [[ https://en.wikipedia.org/wiki/Wikipedia:Requests_for_page_protection | WP:RFP ]], it's needed to only archive level 3 headings.
Provide some option to restrict the archiving only to a certain level.
Since this looks like a rather complex request, here is an attempt to recap.
* The bot should recognize a new template argument in the form of "level=3" which tells the bot to archive threads starting with "=== Title ===", and keep headings in higher levels intact.
* The bot should replicate the higher thread structure from the original page into the archive page. The bot should parse the archive page to determine the locations where threads should be archived. See [[https://phabricator.wikimedia.org/T119791#1879710 | Dalba's comment]] for an example.
** In an archive page, threads of the target level should probably be ordered within a parent thread by last timestamps (consistent with the current state).
* The bot archives level-2 threads (starting with "== Title ==") only. If a level-2 thread has level-3 threads such as "=== Sub topic 1 ===" and "=== Sub topic 2 ===" in it, those will stay together if one of the two is old enough.
* The bot doesn't (have to) parse archive pages. Threads newly archived are always appended at the bottom. This effectively reorders threads by the last message's timestamp.