User:JJMC89 bot III/tasks/CFDW
Appearance
This task processes WP:CFD closes that are listed at WP:CFD/W and WP:CFD/W/L.
Process
- The working page must have full (
sysop
) edit protection. - The bot can only recategorize when a page is categorized using category syntax (
[[Category:Foo]]
).
- The bot iterates over each section of the page using the section header to determine the mode.
- Within a section the bot iterates over each line if wikitext.
- Each line consists of three parts: prefix, wikilinks, and suffix. Everything else is ignored.
- All wikilinks on the line
- They must be to a CfD page or a category. The bot will not process the rest of the section if any other wikilink is found.
- If a CfD link does not contain a section, the bot will attempt figure it out based on the linked CfD page.
- The prefix is the plain text at the beginning of the line.
- The prefix on a line with a CfD link applies to all lines until a different CfD link.
- If the prefix contains "NO BOT" (case sensitive), the bot will not process it. (These should be placed on WP:CFD/W/M instead.)
- The suffix is the plain text at the end of the line.
- The suffix on a line with a CfD link applies to all lines until a different CfD link unless that line has a suffix.
- All wikilinks on the line
- Each line consists of three parts: prefix, wikilinks, and suffix. Everything else is ignored.
- If a CfD link was found and there is at least one category link is on the line, the bot will check and process the request.
Empty mode
- The bot removes the category from all pages and deletes the empty category.
- Checks:
- There must be one category on the line.
Merge mode
- The bot merges the category to one or more target categories and deletes the empty category.
- If the prefix contains "REDIRECT" (case sensitive) and there is a single merge target, then the bot will redirect the category to the target using {{category redirect}} instead of deleting it.
- Checks:
- There must be one or more merge targets on the line.
- All merge targets must exist and not be a redirect.
Move mode
- The bot moves the category to a target category without leaving a redirect and removes the {{cfx full}} template.
- If the prefix contains "REDIRECT" (case sensitive), then the bot will leave a redirect.
- Checks:
- There must be one move target on the line.
- If the current category is a redirect, then the target must exist.
- The target must not be a redirect.
Retain mode
- The bot removes the {{cfx full}} template and adds {{old CfD}} to the talk page.
- If the suffix does not contain the discussion action and result for {{old CfD}}, the bot will attempt figure them out based on the linked CfD page.
- On the working page, the action/result must be one of the following.
- no consensus (for|to) action
- not action
- keep (The action is assumed to be delete.)
- Checks:
- There must be one category on the line.
- There must be an action and result (on the line or bot detected).