mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-20 07:30:54 +01:00
Made sure the bot responds with uneven quotations or brackets.
This commit is contained in:
parent
d4d81f09dc
commit
29effdf8cc
@ -200,7 +200,10 @@ class Tokenizer:
|
|||||||
return args
|
return args
|
||||||
|
|
||||||
def tokenize(s):
|
def tokenize(s):
|
||||||
return Tokenizer().tokenize(s)
|
try:
|
||||||
|
return Tokenizer().tokenize(s)
|
||||||
|
except ValueError, e:
|
||||||
|
raise SyntaxError, str(e)
|
||||||
|
|
||||||
class IrcObjectProxy:
|
class IrcObjectProxy:
|
||||||
def __init__(self, irc, msg, args):
|
def __init__(self, irc, msg, args):
|
||||||
@ -323,7 +326,11 @@ class Privmsg(irclib.IrcCallback):
|
|||||||
msg = self.rateLimiter.get()
|
msg = self.rateLimiter.get()
|
||||||
if msg:
|
if msg:
|
||||||
s = addressed(irc.nick, msg)
|
s = addressed(irc.nick, msg)
|
||||||
self.Proxy(irc, msg, tokenize(s))
|
try:
|
||||||
|
args = tokenize(s)
|
||||||
|
except SyntaxError, e:
|
||||||
|
irc.queueMsg(reply(msg, debug.exnToString(e)))
|
||||||
|
self.Proxy(irc, msg, args)
|
||||||
|
|
||||||
def isCommand(self, methodName):
|
def isCommand(self, methodName):
|
||||||
# This function is ugly, but I don't want users to call methods like
|
# This function is ugly, but I don't want users to call methods like
|
||||||
|
Loading…
x
Reference in New Issue
Block a user