.. _fbf.plugs.extra.tour: tour ~~~~ .. automodule:: fbf.plugs.extra.tour :show-inheritance: :members: :undoc-members: CODE ---- :: # fbf/plugs/common/tour.py # # """ do a tour of the bot. """ .. _fbf.plugs.extra.tour_fbf_imports: fbf imports -------------- :: from fbf.lib.commands import cmnds from fbf.lib.examples import examples .. _fbf.plugs.extra.tour_basic_imports: basic imports ---------------- :: import time .. _fbf.plugs.extra.tour_defines_: defines ---------- :: eventlist = ["!welcome", "FBFBOT provides functionality through the use of plugins, you can use the !list comamnd to see what plugins are available =>", "!list"] .. _fbf.plugs.extra.tour_tour_command: tour command --------------- :: def handle_dotour(bot, event): if event.user.state.data.notour: event.reply("the tour is disabled for %s" % event.userhost) ; return event.untildone = True event.reply("will say something every 5 seconds. you can disable this tour by typing !set notour 1") time.sleep(5) for txt in eventlist: if event.user.state.data.notour: break if txt.startswith("!"): e = bot.make_event(event.userhost, event.channel, txt[1:], 0, event) e.execute() else: event.reply(txt) time.sleep(5) event.done() cmnds.add("tour", handle_dotour, ["OPER", "USER", "GUEST"], threaded=True) examples.add("tour", "show a tour of the bot", "tour")