+
+@lib.hook()
+@lib.help(None, 'a command that does nothing but requires you specify a channel')
+def needchan(bot, user, chan, realtarget, *args):
+ bot.msg(user, "You did it!")
+
+@lib.hook(needchan=False, wantchan=True)
+@lib.help(None, 'a command which will consume a channel if given')
+ if chan is not None:
+ bot.msg(user, "Channel provided: %s" % (chan))
+ else:
+ bot.msg(user, "No channel provided")