Template:Bots/doc

The Bots and Nobots templates tell bots and other automated editing tools and scripts that they either should or should not edit a page that has the template. The templates can be used to block most bots (all bots that have implemented this functionality) or specific bots by name or function. For example, this can be used to opt-in or opt-out from user talk bot messages or to cause maintenance bots to avoid certain pages. These templates should be used carefully outside userspace to avoid blocking useful bot edits.

Explicitly opting-in has the advantage of receiving useful changes or targeted posts a bot might otherwise skip by following "opt-out" behavior by default. Users should be aware that by opting-out of bot posts, they will not be notified of matters relating to material they have edited or uploaded, which are tagged or scanned by bots per policy.

In particular, in the encyclopedia spaces:
 * Avoid using the template as a blunt instrument
 * Address the root problem with the bot owner or bot community
 * Remove the template tag once the underlying problem has been resolved.

Important notes
Most bots will NOT understand these templates when they are indirectly transcluded.

Most bots will not disregard the template if it is inside of  ...  tags. For example, if you are discussing the templates with another editor, please use the tl template, e.g., which will show nobots, rather than  , which will possibly be parsed as intending to ban bots from the page.

A list of transclusions is at User:AnomieBOT/Nobots Hall of Shame

Syntax
                 Ban all compliant bots (shortcut that takes no parameters)                    Allow all bots (shortcut that takes no parameters)

   Ban all compliant bots not in the list     Ban all compliant bots in the list

Where is a comma-delimited string of bot usernames (AWB can be used for all AWB-based bots):       

 can also be "none" or "all" as in the following examples:        Allow all bots       Ban all compliant bots

        Ban all compliant bots        Allow all bots

Bots are not bound to observe the nobots template; it will depend on their functionality, their owners and their terms of approval. The bots that currently support exclusion are listed at exclusion compliant bots.

Incorrect syntax
This syntax looks correct, but depending on the individual bot may not have the intended effect. This statement may deny neither Bot1 nor Bot2, only one of the two bots, or both bots as intended.

  INCORRECT

Instead, write:

       CORRECT

Message notification opt out
Another option is to opt out of specific types of messages for users who wish to be notified of certain problems, but not others. Users should be aware that by opting-out of specific notification posts, they will not be notified of matters relating to material they have edited or uploaded, which are tagged per policy. Actions (such as deletion) may be executed without you being notified as a result. By applying this to your own user talk page, you agree to this consequence. Applying this to a user talk page other than your own will be considered vandalism. All bots and scripts that leave messages on a user's talk page are encouraged to add this capability.

By adding this to a user's talk page, a user may still receive these messages by non-compliant bots or scripts, or humans who add the tag manually.

             Opt out of all messages (see limitations below).

        Opt out of no source messages.        Opt out of no license messages.            Opt out of orphaned fair use messages.              Opt out of no permission messages.      Opt out of no rationale messages.      Opt out of replaceable fair use messages.     Opt out of better source request messages.              Opt out of articles for deletion messages or variant forms.              Opt out of images for deletion messages or variant.             Opt out of prod warning.      Opt out of Mass messages.

Items can be combined by putting a comma between options                   Opt out of no source, and no license messages.        Opt out of fair use messages.

Restrictions of messages that can be opted out
Some message notifications are not allowed to be opted out. These include:
 * 1) Copyright violation notifications
 * 2) Vandalism (and other) warning notices.
 * 3) User:SineBot's notices for not signing posts
 * 4) Any message tag that isn't included as a way of opting out above. (Is there one that should be included? Leave a message on the talk page.)
 * 5) Mass messages cannot be opted-out of by using ; users must explicitly opt out with

Implementation

 * Pywikibot supports bots and nobots since r4096. The templates may be ignored using a parameter.
 * Since version 3.2.0.0 AutoWikiBrowser fully supports and  . Additionally, pseudo-username AWB can be specified to ban all AWB-based bots from the page. However, AWB has an option to ignore these templates.
 * Opt out message notification was introduced here April 3, 2008. Individual bot/script implementation will vary and notice above of implementation may not include this feature.

Python
This code assumes that the mwparserfromhell library was installed and imported in the current script.