# module code
@lib.hook('test', needchan=False)
def cmd_gtest(bot, user, chan, realtarget, *args):
- if chan is not None: replyto = chan
+ if realtarget == chan.name: replyto = chan
else: replyto = user
bot.msg(replyto, "You said: %s" % (' '.join([str(arg) for arg in args])))