# This file is released into the public domain; see http://unlicense.org/
import sys
+from functools import wraps
if sys.version_info.major < 3:
stringbase = basestring
def argsEQ(self, num):
def realhook(func):
+ @wraps(func)
def checkargs(bot, user, chan, realtarget, *args):
if len(args) == num:
return func(bot, user, chan, realtarget, *args)
else:
bot.msg(user, self.WRONGARGS)
- checkargs.__name__ = func.__name__
- checkargs.__module__ = func.__module__
return checkargs
return realhook
def argsGE(self, num):
def realhook(func):
+ @wraps(func)
def checkargs(bot, user, chan, realtarget, *args):
if len(args) >= num:
return func(bot, user, chan, realtarget, *args)
else:
bot.msg(user, self.WRONGARGS)
- checkargs.__name__ = func.__name__
- checkargs.__module__ = func.__module__
return checkargs
return realhook