Made supybot report SyntaxError to the user.

This commit is contained in:
Jeremy Fincher 2003-08-20 07:19:20 +00:00
parent edf695aaad
commit 137f05b2e8

View File

@ -374,9 +374,9 @@ class Privmsg(irclib.IrcCallback):
s = addressed(irc.nick, msg) s = addressed(irc.nick, msg)
try: try:
args = tokenize(s) args = tokenize(s)
self.Proxy(irc, msg, args)
except SyntaxError, e: except SyntaxError, e:
irc.queueMsg(reply(msg, debug.exnToString(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
@ -419,8 +419,11 @@ class Privmsg(irclib.IrcCallback):
self.rateLimiter.put(msg) self.rateLimiter.put(msg)
msg = self.rateLimiter.get() msg = self.rateLimiter.get()
if msg: if msg:
args = tokenize(s) try:
self.Proxy(irc, msg, args) args = tokenize(s)
self.Proxy(irc, msg, args)
except SyntaxError, e:
irc.queueMsg(reply(msg, debug.exnToString(e)))
class IrcObjectProxyRegexp: class IrcObjectProxyRegexp: