mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Restricted the characters that a prefix character can be.
This commit is contained in:
parent
7642def926
commit
877d376988
@ -439,7 +439,12 @@ def main():
|
||||
import callbacks
|
||||
conf.prefixChars = anything('What would you like your bot\'s '
|
||||
'prefix character(s) to be?')
|
||||
while callbacks.canonicalName(conf.prefixChars) != conf.prefixChars:
|
||||
invalidPrefixChar = True
|
||||
while invalidPrefixChar:
|
||||
for c in conf.prefixChars:
|
||||
if c not in conf.validPrefixChars:
|
||||
invalidPrefixChar = True
|
||||
myPrint('%r is not a valid prefixChar.' % c)
|
||||
conf.prefixChars = anything('That includes one or more invalid '
|
||||
'prefix characters. What would you'
|
||||
'like your bot\'s prefix character(s)'
|
||||
|
@ -244,8 +244,10 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
||||
Sets the prefix chars by which the bot can be addressed.
|
||||
"""
|
||||
s = privmsgs.getArgs(args)
|
||||
if s.translate(string.ascii, string.ascii_letters) == '':
|
||||
irc.error(msg, 'Prefixes cannot contain letters.')
|
||||
for c in s:
|
||||
if c not in conf.validPrefixChars:
|
||||
s = 'PrefixChars must be something in %r'%conf.validPrefixChars
|
||||
irc.error(msg, s)
|
||||
else:
|
||||
conf.prefixChars = s
|
||||
irc.reply(msg, conf.replySuccess)
|
||||
|
@ -222,6 +222,12 @@ ignores = []
|
||||
###
|
||||
prefixChars = '@'
|
||||
|
||||
###
|
||||
# validPrefixChars: A string of chars that are allowed to be used as
|
||||
# prefixChars.
|
||||
###
|
||||
validPrefixChars = '`~!@#$%^&*()_-+=[{}]\\|\'";:,<.>/?'
|
||||
|
||||
###
|
||||
# detailedTracebacks: A boolean describing whether or not the bot will give
|
||||
# *extremely* detailed tracebacks. Be cautioned, this eats
|
||||
|
Loading…
Reference in New Issue
Block a user