Jump to content
Main menu
Main menu
move to sidebar
hide
Discord
Discord
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Guidelines & Policy
Community Rules
Wiki Staff
Manual of Style
Syntax and Formatting
Images Policy
Editing Guides
Language Guides
Recent changes
rc-skeleton
Characters
Anima
Eidos
NPCs
More...
The World
Planes
Nexus
Novarchs
Sovereigns
Sundering
Game Systems
Aspect
Trait
Nexus Battle
Abilities
Loading Screens
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Editing
Template
:
Bots/doc
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Once you make an edit, a temporary account will be created for you.
Learn more
.
Log in
or
create an account
to continue receiving notifications after this account expires, and to access other features.
Anti-spam check. Do
not
fill this in!
{{Documentation/Header}} 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 '''<nowiki><now</nowiki><nowiki>iki> ... </now</nowiki><nowiki>iki></nowiki>''' tags. For example, if you are discussing the templates with another editor, please use the {{t|t}} template, e.g. <code><nowiki>{{t|nobots}}</nowiki></code>, which will show {{t|nobots}}, rather than <code><nowiki><no</nowiki><nowiki>wiki>{{nobots}}</now</nowiki><nowiki>iki></nowiki></code>, which will possibly be parsed as intending to ban bots from the page. ==Syntax== '''<nowiki>{{nobots}}</nowiki>''' Ban all compliant bots (shortcut that takes no parameters) '''<nowiki>{{bots}}</nowiki>''' Allow all bots (shortcut that takes no parameters) '''<nowiki>{{bots|allow=<botlist>}}</nowiki>''' Ban all compliant bots not in the list '''<nowiki>{{bots|deny=<botlist>}}</nowiki>''' Ban all compliant bots in the list ''Where <botlist> is a comma-delimited string of bot usernames (AWB can be used for all AWB-based bots):'' '''<nowiki>{{bots|allow=SineBot,Legobot}}</nowiki>''' '''<nowiki>{{bots|deny=AWB}}</nowiki>''' ''<botlist> can also be "none" or "all" as in the following examples:'' '''<nowiki>{{bots|allow=all}}</nowiki>''' Allow all bots '''<nowiki>{{bots|allow=none}}</nowiki>''' Ban all compliant bots '''<nowiki>{{bots|deny=all}}</nowiki>''' Ban all compliant bots '''<nowiki>{{bots|deny=none}}</nowiki>''' 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. ==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. '''<nowiki>{{bots|deny=Bot1|deny=Bot2}}</nowiki>''' INCORRECT Instead, write: '''<nowiki>{{bots|deny=Bot1,Bot2}}</nowiki>''' CORRECT ==Implementation== *[[mw:Pywikibot|Pywikibot]] supports bots and nobots since ''r4096''. The templates may be ignored using a parameter. *Since version 3.2.0.0 {{w|AutoWikiBrowser}} fully supports <nowiki>{{bots}} and {{nobots}}</nowiki>. 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. ===Example implementations=== ====PHP==== <syntaxhighlight lang="php"> function allowBots( $text, $user ) { if (preg_match('/\{\{(nobots|bots\|allow=none|bots\|deny=all|bots\|optout=all|bots\|deny=.*?'.preg_quote($user,'/').'.*?)}}/iS',$text)) return false; if (preg_match('/\{\{(bots\|allow=all|bots\|allow=.*?'.preg_quote($user,'/').'.*?)}}/iS', $text)) return true; if (preg_match('/\{\{(bots\|allow=.*?)}}/iS', $text)) return false; return true; } </syntaxhighlight> ====Perl==== <syntaxhighlight lang="perl"> sub allow_bots { my($text, $user, $opt) = @_; return 0 if $text =~ /{{[nN]obots}}/; return 1 if $text =~ /{{[bB]ots}}/; if($text =~ /\{\{[bB]ots\s*\|\s*allow\s*=\s*(.*?)\s*}}/s){ return 1 if $1 eq 'all'; return 0 if $1 eq 'none'; my @bots = split(/\s*,\s*/, $1); return (grep $_ eq $user, @bots) ? 1 : 0; } if($text =~ /\{\{[bB]ots\s*\|\s*deny\s*=\s*(.*?)\s*}}/s){ return 0 if $1 eq 'all'; return 1 if $1 eq 'none'; my @bots = split(/\s*,\s*/, $1); return (grep $_ eq $user, @bots) ? 0 : 1; } if(defined($opt) && $text =~ /\{\{[bB]ots\s*\|\s*optout\s*=\s*(.*?)\s*}}/s){ return 0 if $1 eq 'all'; my @opt = split(/\s*,\s*/, $1); return (grep $_ eq $opt, @opt) ? 0 : 1; } return 1; } </syntaxhighlight> ====VB.NET==== <syntaxhighlight lang="vbnet"> Public Shared Function AllowBots(ByVal text As String, ByVal user As String) As Boolean Return Not Regex.IsMatch(text, "\{\{(nobots|bots\|(allow=none|deny=(?!none).*(" & user.Normalize() & "|all)|optout=all))\}\}", RegexOptions.IgnoreCase) End Function </syntaxhighlight> ====C#==== <syntaxhighlight lang="csharp"> public static bool AllowBots(string text, string user) { return !Regex.IsMatch(text, @"\{\{(nobots|bots\|(allow=none|deny=(?!none).*(" + user.Normalize() + @".*|all)|optout=all))\}\}", RegexOptions.IgnoreCase); } </syntaxhighlight> ====Java==== <syntaxhighlight lang="java"> public static boolean allowBots(String text, String user) { return !text.matches("(?si).*\\{\\{(nobots|bots\\|(allow=none|deny=([^\\}]*?" + user + "[^\\}]*?|all)|optout=all))\\}\\}.*"); } </syntaxhighlight> ====JavaScript==== <syntaxhighlight lang="javascript"> function allowBots(text, user){ if (!new RegExp("\\{\\{\\s*(nobots|bots[^}]*)\\s*\\}\\}", "i").test(text)) return true; return (new RegExp("\\{\\{\\s*bots\\s*\\|\\s*deny\\s*=\\s*([^}]*,\\s*)*" + user.replace(/([\(\)\*\+\?\.\-\:\!\=\/\^\$])/g, "\\$1") + "\\s*(?=[,\\}])[^}]*\\s*\\}\\}", "i").test(text)) ? false : new RegExp("\\{\\{\\s*((?!nobots)|bots(\\s*\\|\\s*allow\\s*=\\s*((?!none)|([^}]*,\\s*)*" + user.replace(/([\(\)\*\+\?\.\-\:\!\=\/\^\$])/g, "\\$1") + "\\s*(?=[,\\}])[^}]*|all))?|bots\\s*\\|\\s*deny\\s*=\\s*(?!all)[^}]*|bots\\s*\\|\\s*optout=(?!all)[^}]*)\\s*\\}\\}", "i").test(text); } </syntaxhighlight> ====Python==== This code assumes that the [http://pypi.python.org/pypi/mwparserfromhell/ mwparserfromhell] library was installed and imported in the current script. <syntaxhighlight lang="python"> def allow_bots(text, user): user = user.lower().strip() text = mwparserfromhell.parse(text) for tl in text.filter_templates(): if tl.name.matches(['bots', 'nobots']): break else: return True for param in tl.params: bots = [x.lower().strip() for x in param.value.split(",")] if param.name == 'allow': if ''.join(bots) == 'none': return False for bot in bots: if bot in (user, 'all'): return True elif param.name == 'deny': if ''.join(bots) == 'none': return True for bot in bots: if bot in (user, 'all'): return False if (tl.name.matches('nobots') and len(tl.params) == 0): return False return True </syntaxhighlight>
Summary:
Please note that all contributions to Honkai: Nexus Anima Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Honkai Nexus Anima Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Below are commonly used wikitext from
MediaWiki:Edittools
. Click on any to insert them in the edit box.
Dynamic Page List
:
¦
²
«
»
²{¦}²
«»
«/»
«!----»
Array in DPL
:
¹
^2{
}^2
^2{¹}^2
Parser Functions
:
{{#if:||}}
{{#if:<condition>|<result if true>|<result if false>}}
{{#ifeq:|||}}
{{#ifeq:<text1>|<text2>|<result if text1=text2>|<result if text1≠text2>}}
{{#expr:}}
{{#expr:<mathematical expression>}}
{{#switch:||#default=}}
{{#switch:<text1>|<text2>=<result if text1=text2>|<text3>=<result if text1=text3>|#default=<result if no valid match>}}
{{#replace:||}}
{{#replace:<text1>|<plain text to find in text1>|<plain text to insert in place of the text found>}}
{{#titleparts:}}
{{#replace:<page name>}}
{{#tag:|}}
{{#tag:<name of html tag>|<content inside html tag>}}
Markup:
{{}}
|
[]
[[]]
[[Category:]]
#REDIRECT [[]] [[Category:Redirect Pages]]
<code></code>
<includeonly></includeonly>
<noinclude></noinclude>
<nowiki></nowiki>
<!---->
<br>
§
Notices:
{{Stub|}}
{{Stub Dialogue}}
{{Upcoming}}
{{Under Construction}}
{{Placeholder Image|}}
Magic Words
:
{{!}}
{{formatnum:}}
{{lc:}}
{{uc:}}
{{PAGENAME}}
{{FULLPAGENAME}}
{{ROOTPAGENAME}}
{{BASEPAGENAME}}
{{SUBPAGENAME}}
{{DISPLAYTITLE:|noreplace}}
__TOC__
__NOTOC__
__EXPECTUNUSEDCATEGORY__
__HIDDENCAT__
References:
<ref></ref>
{{Reflist}}
{{Ref/Arti|}}
{{Ref/ArtiSet|}}
{{Ref/BB|}}
{{Ref/Book|}}
{{Ref/CS|}}
{{Ref/Companion|}}
{{Ref/Domain|}}
{{Ref/Enemy|}}
{{Ref/Food|}}
{{Ref/Furnishing|}}
{{Ref/HEO|}}
{{Ref/Item|}}
{{Ref/Loading|}}
{{Ref/Location|}}
{{Ref/Manga|}}
{{Ref/NPC|}}
{{Ref/Outfit|}}
{{Ref/Quest|}}
{{Ref/Talent|}}
{{Ref/VO|}}
{{Ref/VP|}}
{{Ref/Weapon|}}
{{Ref/Wildlife|}}
HTML Entities:
—
,
­
Pages included on this page:
Template:Documentation/Header
(
edit
)
Template:T
(
view source
) (fully protected)
Template:W
(
edit
)
Module:Arguments
(
view source
) (fully protected)
Module:Arguments/i18n
(
view source
) (fully protected)
Module:Config
(
view source
) (fully protected)
Module:Documentation
(
view source
) (fully protected)
Module:Documentation/config
(
view source
) (fully protected)
Module:Entrypoint
(
view source
) (fully protected)
Module:Exists
(
view source
) (fully protected)
Module:Fallbacklist
(
view source
) (fully protected)
Module:Feature
(
view source
) (fully protected)
Module:Formatting
(
view source
) (fully protected)
Module:I18n
(
view source
) (fully protected)
Module:TableTools
(
view source
) (fully protected)
Module:Yesno
(
view source
) (fully protected)
Search
Search
Editing
Template
:
Bots/doc
Add topic