This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 |
I'm pleased to announce that HagermanBot now recognizes the syntax for this template. Although the previous <!--Disable HagermanBot--> tag is still supported for legacy talk pages, the preferred and documented method to disable the bot for a specific page is to use this template. Thanks! Hagerman( talk) 04:27, 18 December 2006 (UTC)
Is there any consensus on the appropriate use of these templates? If someone wants to put them on their User: or User talk: page, fine, since that's a personal page. I would propose, however, that they should not be allowed at all on main namespace pages -- no Wikipedia editor has the right to dictate who else may or may not edit an article. And their use should be highly discouraged in any other namespace, unless a consensus is first developed that they are appropriate in a particular context. -- Russ (talk) 20:00, 20 December 2006 (UTC)
I like the changes RM made to the syntax with the "all" and "none" settings. However, looking at the code {{nobots|allow=all}} in plain english seems like it might confuse an end-user. Your average Wikipedian will see "don't let any bots make changes except everything." Maybe we should call the template "bots" and drop the support for a null parameter to mean deny all bots? Then the code would be {{bots|allow=all}} which looks a bit better to me. What do you think? Hagerman( talk) 17:34, 18 December 2006 (UTC)
I just want to clarify how I believe bots uses this template. The bot downloads the wiki source to each page it wants to edit. The bot then checks if the source has this template in the source. If so, it checks the parameters passed to the template. The template does not generate anything on the resulting html page of the pages it is included in. To summarize, the presence of the template include is what makes it work.-- Henke37 18:24, 8 May 2007 (UTC)
Is there a sectional form of these tags? I would love to be able to tag just a single section to be ignored, not the entire page. — RevRagnarok Talk Contrib 18:31, 1 April 2007 (UTC)
"Another option is to opt out of specific types of messages for users that do not wish to be notified of certain problems, but perhaps still other problems." ? -- Dweller ( talk) 14:08, 24 April 2008 (UTC)
I have just expanded the template to include the capability for users to select to opt out of specific types of messages (or all available types). Bot and script owners are encouraged to implement this feature as well as all of Template:Bots features if they had not previously done so. This will eliminate users needing to know what bots are leaving them messages, and just select not to receive messages in general (at least from bots/scripts). If you have any questions or comments (or a item that should be included on the opt out list (excluding the limitations)), then let me know or post on the talk page. MECU≈ talk 16:43, 3 April 2008 (UTC)
{{ editprotected}}
Please add interwiki link [[ja:Template:Bots]], thanks. -- 219.164.57.180 ( talk) 21:28, 25 April 2008 (UTC)
List of some interwiki bots: SieBot,A4Bot,AlleborgoBot,Thijs!bot,YurikBot,Tsca.bot,Eskimbot – if this is intended as a help to disallow interwikibots, its not much use - there's just too many of them. Instead, interwiki.py should be taught to respect an "interwiki" opt-out switch. (Or, even better, another template that directs it to the right place – usually the problem with interwiki bots is that they make a mess of pages which have iw-links transcluded from another page, eg. a template documentation subpage.) -- Tgr ( talk) 13:15, 25 April 2008 (UTC)
According to the documentation, it's as simple as adding : <!--User:CSDWarnBot--> to the page. Why not add this to the nobots part of the template??? ηoian ‡orever ηew ‡rontiers 03:16, 21 January 2009 (UTC)
Can someone tell me why User:BetacommandBot was able to make this edit to my talkpage even though I had both {{bots|deny=BetacommandBot}} and {{nobots}} on the page? Skomorokh incite 21:39, 15 December 2007 (UTC)
"Avoid using the template as a blunt instrument" — Does this mean I should avoid tagging an article {{ nobots}} while working? I tend to work in a list-like order, and this means sometimes there will be orphaned citations and similar things for several minutes while I'm working on something else. I've had problems in the past where a bot will disturb the article edit trying to fix something that's purposely left in error, simply because it's an "I'll be getting to it later" situation. I can't have bots on my mind while I'm reading through articles and trying to make edits. So, is using this tag for this purpose (and temporarily) considered "blunt instrument"? - Kerαunoςcopia◁ galaxies 19:15, 12 June 2010 (UTC)
Currently there are approximately:
I have cleaned up a bunch of old ones, and will revisit, USER space is fine but it should only be used as a sticking plaster on project space, per the above section, until either the article is brought into line with the ideal or the bot or bots are improved to avoid that particular change. Any help reducing the number of uses is appreciated. Rich Farmbrough, 23:49, 22 September 2010 (UTC).
Light python version improvement: if (re.search(r'(?im)\{\{\s*(nobots|bots\|(allow=none|deny=.*?' + user + r'.*?|optout=all|deny=all))\s*\}\}', text)):
For spaces between {{ }} and the template name. Is it OK? emijrp ( talk) 17:43, 21 April 2011 (UTC)
Would I add {{bots|allow=SineBot,ClueBot,ClueBot NG}} without any space after the comma or {{bots|allow=SineBot, ClueBot, ClueBot NG}} with a space after the comma? Crazymonkey1123 (Jacob) T or M/ Sign mine 16:49, 8 May 2011 (UTC)
On Talk:Climatic Research Unit email controversy, something about
{{bots|allow=HBC Archive Indexerbot,MiszaBot I}}
was stopping the
MiszaBot archiver from acting since it was added in May. (The indexerbot has run.) I tried fiddling with it, without figuring out what was wrong. Any suggestions?
—WWoods (
talk)
17:10, 5 July 2011 (UTC)
What ever happened to the idea that Wikipedia was free for all to work with, create and edit pages etc? More and more we ordinary users are being blocked and 'reverted' by automatic editors just like this one, either that or by people who consider themselves more equal than the rest of us. Wikipedia might just as well call itself the Encyclopaedia Britannia mark 2.0 i.e. free to no one! 90.193.238.129 ( talk) 21:09, 19 August 2011 (UTC)
The link in the end of the "Syntax" section goes to an empty category. It should go to Category:Wikipedia bots which are exclusion compliant instead. -- Aspiriniks ( talk) 09:45, 29 September 2011 (UTC)
Does this template still work if placed on a subpage of my user talk? That is, will it still block bot messages on my talk page if it's transcluded from a subpage of my talk page? -- œ ™ 10:42, 20 December 2011 (UTC)
The docs don't explicitly mentioned whether there should be at most one occurrence of {{ Bots}} on a page, or if several are allowed. Bots that look for a match with regexes will probably handle this with no problem, yet bots that parse the page and its templates have to make a choice. Consider,
{{Bots |deny=bot1}} {{Bots |deny=bot2}}
According to the documentation, a bot that is not in the |deny=
list is allowed. Should bot2 interpret this as (i) bot2 is allowed, because not explicitly denied by the first occurrence, or (ii) bot2 is denied? I think it's pretty clear that the user wants the second interpretation, but this case doesn't match the template documentation. A bot that parses the page needs to interpret the first {{
Bots}} differently depending on whether there are other occurrences.
The simplest resolution might be to say that only one occurrence is allowed. Blevintron ( talk) 14:22, 28 April 2012 (UTC)
Lots of bots perform a whole range of functions, and lots of functions are performed by many bots alike. I guess many entries on the Nobots Hall of Shame are there because of just one unwanted function. This is too blunt an instrument, so I propose to give functions performed by more than one bot a canonical name to be used as an argument in this template. I'd expect bot programmers to be anxious to get their bots off the HoS list by allowing a bit of fine-tuning. -- Mkratz ( talk) 21:28, 18 July 2013 (UTC)
I regularly use the "{{nobots}}
" template on my user pages at wikis that don't "have" the template, to try cut down on "useless" edits by bots. To prevent a redlink from showing up on the page, I wrap the call in a '<span style="display:none">
' element. Unfortunately, this results in the template showing up at
Special:WantedTemplates on those wikis. Some admins don't like this, so they remove the template call from my user page.
Based on the example code shown on this page, it seems that many bots will just check for the literal text "{{bots…" or "{{nobots…" on the page, while some bots will use a "real" parser ("mwparserfromhell") that looks for "real" template calls. I assume this means that the following two forms will not be recognized by the latter type of bot:
<!-- {{nobots}} -->
<span style="display:none"><nowiki>{{nobots}}</nowiki></span>
Right?
(BTW: whether what I'm doing is effective in the first place is another matter entirely, since it seems likely that a bot preparing to make an unwanted edit to a user page will likely not respect a "nobots" directive, anyway. But whatever.) - dcljr ( talk) 05:08, 19 September 2013 (UTC)
Extended content
|
---|
/// <summary>
/// This function will remove commented uses of the {{nobots}} or {{bots}} template so that they are
/// not considered in the BotEditPermitted() function.
/// </summary>
/// <param name="PageText"></param>
/// <param name="CommentStart"></param>
/// <param name="CommentEnd"></param>
/// <returns></returns>
private static String RemoveComment(String PageText, String CommentStart, String CommentEnd)
{
// Remove anything that is inside of <nowiki> ... <nowiki> or <!-- ... -->
for (int nowiki = PageText.IndexOf(CommentStart, StringComparison.CurrentCultureIgnoreCase); 0 <= nowiki; nowiki = PageText.IndexOf(CommentStart, StringComparison.CurrentCultureIgnoreCase))
{
int endnowiki = PageText.IndexOf(CommentEnd, nowiki, StringComparison.CurrentCultureIgnoreCase);
if (0 <= endnowiki)
{
String NewText = "";
if (0 < nowiki)
{
NewText = PageText.Substring(0, nowiki);
}
if (endnowiki + CommentEnd.Length < PageText.Length)
{
NewText += PageText.Substring(endnowiki + CommentEnd.Length);
}
PageText = NewText;
}
else
{
// If the comment doesn't end, then we're done
return PageText;
}
}
return PageText;
}
/// <summary>
/// This function attempts to parse the page text for the {{bots}} and {{nobots}} templates.
///
/// {{nobots}} will be checked for allow=BotUserName or optin=BotNotificationType
/// {{nobots}} can also be superseded by a {{bots|allow=BotUserName}} or {{bots|optin=BotNotificationType}}
///
/// {{bots|allow=Bot1,Bot2}} is interpreted as disallowing everything but Bot1 and Bot2 unless another {{bots}} statement is found
/// </summary>
/// <param name="PageText">The page text to be parsed.</param>
/// <param name="BotUserName">This bot's username, this function will check for it in "allow" or "deny". IMPORTANT: </param>
/// <param name="BotNotificationType">The type of notification this bot is sending, e.g. nosource, nolicense, orfud.</param>
/// <returns>Returns true if this bot is permitted to edit the page and false if it is not.</returns>
public static bool BotEditPermitted(string PageText, string BotUserName, string BotNotificationType)
{
try
{
// Remove comments from consideration
PageText = RemoveComment(PageText, "<nowiki>", "</nowiki>");
PageText = RemoveComment(PageText, "<!--", "-->");
// Find all of the bots or nobots tags
MatchCollection matches = Regex.Matches(PageText, @"\{\{\s*(nobots|bots|deceased wikipedian)[^\}\{]*\}\}", RegexOptions.IgnoreCase);
if (null != matches && matches.Count > 0)
{
List<string> commands = new List<string>();
foreach (Match m in matches)
{
if (0 < m.Length)
{
// This is an individual bots tag to process
commands.Add(PageText.Substring(m.Index, m.Length).Trim());
}
}
// Rule #1: if any command denies this bot by name, then disallow the edit
if (!String.IsNullOrWhiteSpace(BotUserName))
{
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*deny\s*\=\s*([^\|]*\,|)\s*" + Regex.Escape(BotUserName) + @"\s*(\,[^\|]*|)(\|.*|)\s*\}\}", RegexOptions.IgnoreCase))
{
return false;
}
}
}
// Rule #2 - if any command opts out of this notification type by name, then disallow the edit
if (!String.IsNullOrWhiteSpace(BotNotificationType))
{
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*optout\s*\=\s*([^\|]*\,|)\s*" + Regex.Escape(BotNotificationType) + @"\s*(\,[^\|]*|)(\|.*|)\s*\}\}", RegexOptions.IgnoreCase))
{
return false;
}
}
}
// Rule #3 - if any command allows this bot by name, then allow the edit
if (!String.IsNullOrWhiteSpace(BotUserName))
{
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*allow\s*\=\s*([^\|]*\,|)\s*" + Regex.Escape(BotUserName) + @"\s*(\,[^\|]*|)(\|.*|)\s*\}\}", RegexOptions.IgnoreCase))
{
return true;
}
}
}
// Rule #4 - if any command opts in to this notification type by name, then allow the edit
if (!String.IsNullOrWhiteSpace(BotNotificationType))
{
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*optin\s*\=\s*([^\|]*\,|)\s*" + Regex.Escape(BotNotificationType) + @"\s*(\,[^\|]*|)(\|.*|)\s*\}\}", RegexOptions.IgnoreCase))
{
return true;
}
}
}
// Rule #5 - if we have a {{bots|allow=all}} or {{nobots|allow=all}}, then allow the edit (does anyone do this?)
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*allow\s*\=\s*([^\|]*\,|)\s*all\s*(\,[^\|]*|)(\|.*|)\s*\}\}", RegexOptions.IgnoreCase))
{
return true;
}
}
// Rule #6 - if we have a {{(no)bots|allow=none}} or {{(no)bots|deny=all}}, then disallow the edit
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*(allow\s*\=\s*([^\|]*\,|)\s*none|deny\s*\=\s*([^\|]*\,|)\s*all)\s*(\,[^\|]*|)(\|.*|)\s*\}\}", RegexOptions.IgnoreCase))
{
return false;
}
}
// Rule #7 - if we have a {{nobots}} of any sort or a {{deceased wikipedian}} and we haven't found one of the exemptions above, then disallow the edit
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|deceased wikipedian).*\}\}", RegexOptions.IgnoreCase))
{
return false;
}
}
// Rule #8 - if we have a {{bots|allow=anything}} and we are not mentioned by name, then disallow the edit
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*allow\s*\=\s*.*\}\}", RegexOptions.IgnoreCase))
{
return false;
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
return true;
}
|
@ Stefan2 and Magioladitis: I think this is probably a discussion worth bringing here that has been occurring a couple of places. There are several problems we have observed with the code samples. (1) They do not support indirect transclusions from other templates. This is highly impractical to support, and I'm sure it's not going to happen any time soon, but very notably the {{ deceased Wikipedian}} template attempts to transclude {{ nobots}}. Out of respect, I think that {{ deceased Wikipedian}} should be treated like a {{ nobots}} template. (2) They don't handle the possibility that the template might be inside of a nowiki segment or an html comment. It is not especially uncommon to find someone use nowiki blocks around the bots or nobots template on a talk page and they obviously don't intend for those templates to have an effect. (3) Many of the code segments are not going to support {{ bots}}. (4) None of them will have consistent behavior if you have multiple bots templates on the page. (5) Few of them properly support the allow tag as it is defined in the spec. If you have {{ bots}} and you're not one of those bots, then you're supposed to be disallowed. I have come up with C# code that handles all of these things cases. It's long. I have pasted it above. It would be great if someone who is far more of a regex guru than I could collapse this all into one giant regex that would properly handle the order of precedence I have laid out. -- B ( talk) 03:20, 27 April 2015 (UTC)
{{bots |this is an invalid parameter = ignore this parameter |allow = Bot 1 |deny = Bot 2 }}
Truth is that this template isn't all that well designed (e.g. no consideration for multiple instances, conflicting instructions, bots with names containing commas, etc.), and we could do better especially now that we have Scribunto (I'd probably go for hidden urn links that bots could check with prop=extlinks, like Template:Edit protected uses). The problem would be all the existing code that uses things as they are now. Anomie ⚔ 14:55, 28 April 2015 (UTC)
Please respect the nobots template. I've no patience for spam. Can we ban bots that ignore it? — Preceding unsigned comment added by 84.93.60.82 ( talk)
Maybe [[:Category:Opted-out of message delivery]]
should be added to {{
nobots}}?
Catnip the Elder (
talk)
03:30, 24 November 2015 (UTC)
Yobot replaced this line:
with this:
here. Is there a way to stop it from doing this or an alternative way to maintain a double line break? What I really need is to vertically align the four columns produced by {{col-4}}? — Kpalion (talk) 16:21, 31 January 2016 (UTC)
Some of the code examples like the python one seem to say that bots should not edit articles with just {{bots}} but the template seems to claim that this means they can be edited.
return True
. −
Pintoch (
talk)
21:03, 26 October 2016 (UTC)
Tavix and I were discussing the editing of WP:RFD. Somehow, there was trouble making the template work to prevent dumbBOT from editing the page. Therefore, I wonder whether someone here can create a better tool at the Template:Bots/sandbox page. -- George Ho ( talk) 03:17, 5 February 2017 (UTC)
Just wondering whether it makes sense for this template to have a hidden tracking category. Apparently there was one briefly but it was removed with the justification "unnecessary, can get this more directly" which isn't obvious at all. Jo-Jo Eumerus ( talk, contributions) 16:51, 5 April 2017 (UTC)
This
edit request to
Template:Bots has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please add the following line to this template (or copy the sandbox, which has the line):
{{#if:{{{optout|}}}|{{#invoke:Bots|check_mass_message|{{{optout}}}}}}}
This calls on Module:Bots. What it does is, if the optout parameter includes "MassMessage", the page which has the template is added to Category:Wikipedians who opt out of message delivery. See the testcases page (remove the invocations of the sandbox, and you'll see that the page is no longer in the category; add them back, and it is). This should have no affect on the functioning of the template with regard to other parameters.
Thanks, -- DannyS712 ( talk) 21:43, 9 February 2019 (UTC)
I think it would be useful for either a spec (e.g. a syntax which is simpler than the full wikicode 'syntax') and/or a test suite to be created, somewhere, that includes usages that are supported, and where possible it should be simple for a bot to use the spec or test suite to verify conformance. We could then test each bot client and mark which tests they do not yet support.
For example, one rule I would like to suggest is the template must not be appear within parserfunctions or other templates, or some other similar restriction that ensures it can provably not be affected by phabricator:T101596. John Vandenberg ( chat) 05:34, 6 June 2015 (UTC)
{{#ifeq:{{CURRENTYEAR}}|2015|{{nobots}}}}
and it becomes a new year), then bots would be required to purge all pages with the forcelinkupdate
parameter before checking if they are allowed to edit, wouldn't they? How would this affect performance? --
Stefan2 (
talk)
12:52, 14 June 2015 (UTC)date=
parameter with the date in a commonly accepted machine readable format, and wikitext around the template isnt the right choice for widespread adoption.
John Vandenberg (
chat)
08:17, 17 June 2015 (UTC)[true, '{{nobots}} bla'],
[true, '{{bots|deny=Bob,CodexBot}} bla', 'CodexBot'],
[false, '<!-- {{bots|deny=Bob,CodexBot}} --> bla', 'CodexBot'],
[false, '{{bots|deny=Bob,FuBot}} bla', 'CodexBot'],
Mine. Irønie ( talk) 14:43, 28 September 2020 (UTC)
This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 |
I'm pleased to announce that HagermanBot now recognizes the syntax for this template. Although the previous <!--Disable HagermanBot--> tag is still supported for legacy talk pages, the preferred and documented method to disable the bot for a specific page is to use this template. Thanks! Hagerman( talk) 04:27, 18 December 2006 (UTC)
Is there any consensus on the appropriate use of these templates? If someone wants to put them on their User: or User talk: page, fine, since that's a personal page. I would propose, however, that they should not be allowed at all on main namespace pages -- no Wikipedia editor has the right to dictate who else may or may not edit an article. And their use should be highly discouraged in any other namespace, unless a consensus is first developed that they are appropriate in a particular context. -- Russ (talk) 20:00, 20 December 2006 (UTC)
I like the changes RM made to the syntax with the "all" and "none" settings. However, looking at the code {{nobots|allow=all}} in plain english seems like it might confuse an end-user. Your average Wikipedian will see "don't let any bots make changes except everything." Maybe we should call the template "bots" and drop the support for a null parameter to mean deny all bots? Then the code would be {{bots|allow=all}} which looks a bit better to me. What do you think? Hagerman( talk) 17:34, 18 December 2006 (UTC)
I just want to clarify how I believe bots uses this template. The bot downloads the wiki source to each page it wants to edit. The bot then checks if the source has this template in the source. If so, it checks the parameters passed to the template. The template does not generate anything on the resulting html page of the pages it is included in. To summarize, the presence of the template include is what makes it work.-- Henke37 18:24, 8 May 2007 (UTC)
Is there a sectional form of these tags? I would love to be able to tag just a single section to be ignored, not the entire page. — RevRagnarok Talk Contrib 18:31, 1 April 2007 (UTC)
"Another option is to opt out of specific types of messages for users that do not wish to be notified of certain problems, but perhaps still other problems." ? -- Dweller ( talk) 14:08, 24 April 2008 (UTC)
I have just expanded the template to include the capability for users to select to opt out of specific types of messages (or all available types). Bot and script owners are encouraged to implement this feature as well as all of Template:Bots features if they had not previously done so. This will eliminate users needing to know what bots are leaving them messages, and just select not to receive messages in general (at least from bots/scripts). If you have any questions or comments (or a item that should be included on the opt out list (excluding the limitations)), then let me know or post on the talk page. MECU≈ talk 16:43, 3 April 2008 (UTC)
{{ editprotected}}
Please add interwiki link [[ja:Template:Bots]], thanks. -- 219.164.57.180 ( talk) 21:28, 25 April 2008 (UTC)
List of some interwiki bots: SieBot,A4Bot,AlleborgoBot,Thijs!bot,YurikBot,Tsca.bot,Eskimbot – if this is intended as a help to disallow interwikibots, its not much use - there's just too many of them. Instead, interwiki.py should be taught to respect an "interwiki" opt-out switch. (Or, even better, another template that directs it to the right place – usually the problem with interwiki bots is that they make a mess of pages which have iw-links transcluded from another page, eg. a template documentation subpage.) -- Tgr ( talk) 13:15, 25 April 2008 (UTC)
According to the documentation, it's as simple as adding : <!--User:CSDWarnBot--> to the page. Why not add this to the nobots part of the template??? ηoian ‡orever ηew ‡rontiers 03:16, 21 January 2009 (UTC)
Can someone tell me why User:BetacommandBot was able to make this edit to my talkpage even though I had both {{bots|deny=BetacommandBot}} and {{nobots}} on the page? Skomorokh incite 21:39, 15 December 2007 (UTC)
"Avoid using the template as a blunt instrument" — Does this mean I should avoid tagging an article {{ nobots}} while working? I tend to work in a list-like order, and this means sometimes there will be orphaned citations and similar things for several minutes while I'm working on something else. I've had problems in the past where a bot will disturb the article edit trying to fix something that's purposely left in error, simply because it's an "I'll be getting to it later" situation. I can't have bots on my mind while I'm reading through articles and trying to make edits. So, is using this tag for this purpose (and temporarily) considered "blunt instrument"? - Kerαunoςcopia◁ galaxies 19:15, 12 June 2010 (UTC)
Currently there are approximately:
I have cleaned up a bunch of old ones, and will revisit, USER space is fine but it should only be used as a sticking plaster on project space, per the above section, until either the article is brought into line with the ideal or the bot or bots are improved to avoid that particular change. Any help reducing the number of uses is appreciated. Rich Farmbrough, 23:49, 22 September 2010 (UTC).
Light python version improvement: if (re.search(r'(?im)\{\{\s*(nobots|bots\|(allow=none|deny=.*?' + user + r'.*?|optout=all|deny=all))\s*\}\}', text)):
For spaces between {{ }} and the template name. Is it OK? emijrp ( talk) 17:43, 21 April 2011 (UTC)
Would I add {{bots|allow=SineBot,ClueBot,ClueBot NG}} without any space after the comma or {{bots|allow=SineBot, ClueBot, ClueBot NG}} with a space after the comma? Crazymonkey1123 (Jacob) T or M/ Sign mine 16:49, 8 May 2011 (UTC)
On Talk:Climatic Research Unit email controversy, something about
{{bots|allow=HBC Archive Indexerbot,MiszaBot I}}
was stopping the
MiszaBot archiver from acting since it was added in May. (The indexerbot has run.) I tried fiddling with it, without figuring out what was wrong. Any suggestions?
—WWoods (
talk)
17:10, 5 July 2011 (UTC)
What ever happened to the idea that Wikipedia was free for all to work with, create and edit pages etc? More and more we ordinary users are being blocked and 'reverted' by automatic editors just like this one, either that or by people who consider themselves more equal than the rest of us. Wikipedia might just as well call itself the Encyclopaedia Britannia mark 2.0 i.e. free to no one! 90.193.238.129 ( talk) 21:09, 19 August 2011 (UTC)
The link in the end of the "Syntax" section goes to an empty category. It should go to Category:Wikipedia bots which are exclusion compliant instead. -- Aspiriniks ( talk) 09:45, 29 September 2011 (UTC)
Does this template still work if placed on a subpage of my user talk? That is, will it still block bot messages on my talk page if it's transcluded from a subpage of my talk page? -- œ ™ 10:42, 20 December 2011 (UTC)
The docs don't explicitly mentioned whether there should be at most one occurrence of {{ Bots}} on a page, or if several are allowed. Bots that look for a match with regexes will probably handle this with no problem, yet bots that parse the page and its templates have to make a choice. Consider,
{{Bots |deny=bot1}} {{Bots |deny=bot2}}
According to the documentation, a bot that is not in the |deny=
list is allowed. Should bot2 interpret this as (i) bot2 is allowed, because not explicitly denied by the first occurrence, or (ii) bot2 is denied? I think it's pretty clear that the user wants the second interpretation, but this case doesn't match the template documentation. A bot that parses the page needs to interpret the first {{
Bots}} differently depending on whether there are other occurrences.
The simplest resolution might be to say that only one occurrence is allowed. Blevintron ( talk) 14:22, 28 April 2012 (UTC)
Lots of bots perform a whole range of functions, and lots of functions are performed by many bots alike. I guess many entries on the Nobots Hall of Shame are there because of just one unwanted function. This is too blunt an instrument, so I propose to give functions performed by more than one bot a canonical name to be used as an argument in this template. I'd expect bot programmers to be anxious to get their bots off the HoS list by allowing a bit of fine-tuning. -- Mkratz ( talk) 21:28, 18 July 2013 (UTC)
I regularly use the "{{nobots}}
" template on my user pages at wikis that don't "have" the template, to try cut down on "useless" edits by bots. To prevent a redlink from showing up on the page, I wrap the call in a '<span style="display:none">
' element. Unfortunately, this results in the template showing up at
Special:WantedTemplates on those wikis. Some admins don't like this, so they remove the template call from my user page.
Based on the example code shown on this page, it seems that many bots will just check for the literal text "{{bots…" or "{{nobots…" on the page, while some bots will use a "real" parser ("mwparserfromhell") that looks for "real" template calls. I assume this means that the following two forms will not be recognized by the latter type of bot:
<!-- {{nobots}} -->
<span style="display:none"><nowiki>{{nobots}}</nowiki></span>
Right?
(BTW: whether what I'm doing is effective in the first place is another matter entirely, since it seems likely that a bot preparing to make an unwanted edit to a user page will likely not respect a "nobots" directive, anyway. But whatever.) - dcljr ( talk) 05:08, 19 September 2013 (UTC)
Extended content
|
---|
/// <summary>
/// This function will remove commented uses of the {{nobots}} or {{bots}} template so that they are
/// not considered in the BotEditPermitted() function.
/// </summary>
/// <param name="PageText"></param>
/// <param name="CommentStart"></param>
/// <param name="CommentEnd"></param>
/// <returns></returns>
private static String RemoveComment(String PageText, String CommentStart, String CommentEnd)
{
// Remove anything that is inside of <nowiki> ... <nowiki> or <!-- ... -->
for (int nowiki = PageText.IndexOf(CommentStart, StringComparison.CurrentCultureIgnoreCase); 0 <= nowiki; nowiki = PageText.IndexOf(CommentStart, StringComparison.CurrentCultureIgnoreCase))
{
int endnowiki = PageText.IndexOf(CommentEnd, nowiki, StringComparison.CurrentCultureIgnoreCase);
if (0 <= endnowiki)
{
String NewText = "";
if (0 < nowiki)
{
NewText = PageText.Substring(0, nowiki);
}
if (endnowiki + CommentEnd.Length < PageText.Length)
{
NewText += PageText.Substring(endnowiki + CommentEnd.Length);
}
PageText = NewText;
}
else
{
// If the comment doesn't end, then we're done
return PageText;
}
}
return PageText;
}
/// <summary>
/// This function attempts to parse the page text for the {{bots}} and {{nobots}} templates.
///
/// {{nobots}} will be checked for allow=BotUserName or optin=BotNotificationType
/// {{nobots}} can also be superseded by a {{bots|allow=BotUserName}} or {{bots|optin=BotNotificationType}}
///
/// {{bots|allow=Bot1,Bot2}} is interpreted as disallowing everything but Bot1 and Bot2 unless another {{bots}} statement is found
/// </summary>
/// <param name="PageText">The page text to be parsed.</param>
/// <param name="BotUserName">This bot's username, this function will check for it in "allow" or "deny". IMPORTANT: </param>
/// <param name="BotNotificationType">The type of notification this bot is sending, e.g. nosource, nolicense, orfud.</param>
/// <returns>Returns true if this bot is permitted to edit the page and false if it is not.</returns>
public static bool BotEditPermitted(string PageText, string BotUserName, string BotNotificationType)
{
try
{
// Remove comments from consideration
PageText = RemoveComment(PageText, "<nowiki>", "</nowiki>");
PageText = RemoveComment(PageText, "<!--", "-->");
// Find all of the bots or nobots tags
MatchCollection matches = Regex.Matches(PageText, @"\{\{\s*(nobots|bots|deceased wikipedian)[^\}\{]*\}\}", RegexOptions.IgnoreCase);
if (null != matches && matches.Count > 0)
{
List<string> commands = new List<string>();
foreach (Match m in matches)
{
if (0 < m.Length)
{
// This is an individual bots tag to process
commands.Add(PageText.Substring(m.Index, m.Length).Trim());
}
}
// Rule #1: if any command denies this bot by name, then disallow the edit
if (!String.IsNullOrWhiteSpace(BotUserName))
{
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*deny\s*\=\s*([^\|]*\,|)\s*" + Regex.Escape(BotUserName) + @"\s*(\,[^\|]*|)(\|.*|)\s*\}\}", RegexOptions.IgnoreCase))
{
return false;
}
}
}
// Rule #2 - if any command opts out of this notification type by name, then disallow the edit
if (!String.IsNullOrWhiteSpace(BotNotificationType))
{
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*optout\s*\=\s*([^\|]*\,|)\s*" + Regex.Escape(BotNotificationType) + @"\s*(\,[^\|]*|)(\|.*|)\s*\}\}", RegexOptions.IgnoreCase))
{
return false;
}
}
}
// Rule #3 - if any command allows this bot by name, then allow the edit
if (!String.IsNullOrWhiteSpace(BotUserName))
{
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*allow\s*\=\s*([^\|]*\,|)\s*" + Regex.Escape(BotUserName) + @"\s*(\,[^\|]*|)(\|.*|)\s*\}\}", RegexOptions.IgnoreCase))
{
return true;
}
}
}
// Rule #4 - if any command opts in to this notification type by name, then allow the edit
if (!String.IsNullOrWhiteSpace(BotNotificationType))
{
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*optin\s*\=\s*([^\|]*\,|)\s*" + Regex.Escape(BotNotificationType) + @"\s*(\,[^\|]*|)(\|.*|)\s*\}\}", RegexOptions.IgnoreCase))
{
return true;
}
}
}
// Rule #5 - if we have a {{bots|allow=all}} or {{nobots|allow=all}}, then allow the edit (does anyone do this?)
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*allow\s*\=\s*([^\|]*\,|)\s*all\s*(\,[^\|]*|)(\|.*|)\s*\}\}", RegexOptions.IgnoreCase))
{
return true;
}
}
// Rule #6 - if we have a {{(no)bots|allow=none}} or {{(no)bots|deny=all}}, then disallow the edit
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*(allow\s*\=\s*([^\|]*\,|)\s*none|deny\s*\=\s*([^\|]*\,|)\s*all)\s*(\,[^\|]*|)(\|.*|)\s*\}\}", RegexOptions.IgnoreCase))
{
return false;
}
}
// Rule #7 - if we have a {{nobots}} of any sort or a {{deceased wikipedian}} and we haven't found one of the exemptions above, then disallow the edit
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|deceased wikipedian).*\}\}", RegexOptions.IgnoreCase))
{
return false;
}
}
// Rule #8 - if we have a {{bots|allow=anything}} and we are not mentioned by name, then disallow the edit
foreach (String str in commands)
{
if (Regex.IsMatch(str, @"\{\{\s*(nobots|bots).*allow\s*\=\s*.*\}\}", RegexOptions.IgnoreCase))
{
return false;
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
return true;
}
|
@ Stefan2 and Magioladitis: I think this is probably a discussion worth bringing here that has been occurring a couple of places. There are several problems we have observed with the code samples. (1) They do not support indirect transclusions from other templates. This is highly impractical to support, and I'm sure it's not going to happen any time soon, but very notably the {{ deceased Wikipedian}} template attempts to transclude {{ nobots}}. Out of respect, I think that {{ deceased Wikipedian}} should be treated like a {{ nobots}} template. (2) They don't handle the possibility that the template might be inside of a nowiki segment or an html comment. It is not especially uncommon to find someone use nowiki blocks around the bots or nobots template on a talk page and they obviously don't intend for those templates to have an effect. (3) Many of the code segments are not going to support {{ bots}}. (4) None of them will have consistent behavior if you have multiple bots templates on the page. (5) Few of them properly support the allow tag as it is defined in the spec. If you have {{ bots}} and you're not one of those bots, then you're supposed to be disallowed. I have come up with C# code that handles all of these things cases. It's long. I have pasted it above. It would be great if someone who is far more of a regex guru than I could collapse this all into one giant regex that would properly handle the order of precedence I have laid out. -- B ( talk) 03:20, 27 April 2015 (UTC)
{{bots |this is an invalid parameter = ignore this parameter |allow = Bot 1 |deny = Bot 2 }}
Truth is that this template isn't all that well designed (e.g. no consideration for multiple instances, conflicting instructions, bots with names containing commas, etc.), and we could do better especially now that we have Scribunto (I'd probably go for hidden urn links that bots could check with prop=extlinks, like Template:Edit protected uses). The problem would be all the existing code that uses things as they are now. Anomie ⚔ 14:55, 28 April 2015 (UTC)
Please respect the nobots template. I've no patience for spam. Can we ban bots that ignore it? — Preceding unsigned comment added by 84.93.60.82 ( talk)
Maybe [[:Category:Opted-out of message delivery]]
should be added to {{
nobots}}?
Catnip the Elder (
talk)
03:30, 24 November 2015 (UTC)
Yobot replaced this line:
with this:
here. Is there a way to stop it from doing this or an alternative way to maintain a double line break? What I really need is to vertically align the four columns produced by {{col-4}}? — Kpalion (talk) 16:21, 31 January 2016 (UTC)
Some of the code examples like the python one seem to say that bots should not edit articles with just {{bots}} but the template seems to claim that this means they can be edited.
return True
. −
Pintoch (
talk)
21:03, 26 October 2016 (UTC)
Tavix and I were discussing the editing of WP:RFD. Somehow, there was trouble making the template work to prevent dumbBOT from editing the page. Therefore, I wonder whether someone here can create a better tool at the Template:Bots/sandbox page. -- George Ho ( talk) 03:17, 5 February 2017 (UTC)
Just wondering whether it makes sense for this template to have a hidden tracking category. Apparently there was one briefly but it was removed with the justification "unnecessary, can get this more directly" which isn't obvious at all. Jo-Jo Eumerus ( talk, contributions) 16:51, 5 April 2017 (UTC)
This
edit request to
Template:Bots has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please add the following line to this template (or copy the sandbox, which has the line):
{{#if:{{{optout|}}}|{{#invoke:Bots|check_mass_message|{{{optout}}}}}}}
This calls on Module:Bots. What it does is, if the optout parameter includes "MassMessage", the page which has the template is added to Category:Wikipedians who opt out of message delivery. See the testcases page (remove the invocations of the sandbox, and you'll see that the page is no longer in the category; add them back, and it is). This should have no affect on the functioning of the template with regard to other parameters.
Thanks, -- DannyS712 ( talk) 21:43, 9 February 2019 (UTC)
I think it would be useful for either a spec (e.g. a syntax which is simpler than the full wikicode 'syntax') and/or a test suite to be created, somewhere, that includes usages that are supported, and where possible it should be simple for a bot to use the spec or test suite to verify conformance. We could then test each bot client and mark which tests they do not yet support.
For example, one rule I would like to suggest is the template must not be appear within parserfunctions or other templates, or some other similar restriction that ensures it can provably not be affected by phabricator:T101596. John Vandenberg ( chat) 05:34, 6 June 2015 (UTC)
{{#ifeq:{{CURRENTYEAR}}|2015|{{nobots}}}}
and it becomes a new year), then bots would be required to purge all pages with the forcelinkupdate
parameter before checking if they are allowed to edit, wouldn't they? How would this affect performance? --
Stefan2 (
talk)
12:52, 14 June 2015 (UTC)date=
parameter with the date in a commonly accepted machine readable format, and wikitext around the template isnt the right choice for widespread adoption.
John Vandenberg (
chat)
08:17, 17 June 2015 (UTC)[true, '{{nobots}} bla'],
[true, '{{bots|deny=Bob,CodexBot}} bla', 'CodexBot'],
[false, '<!-- {{bots|deny=Bob,CodexBot}} --> bla', 'CodexBot'],
[false, '{{bots|deny=Bob,FuBot}} bla', 'CodexBot'],
Mine. Irønie ( talk) 14:43, 28 September 2020 (UTC)