.. _fbf.plugs.core.echo: echo ~~~~ .. automodule:: fbf.plugs.core.echo :show-inheritance: :members: :undoc-members: CODE ---- :: # fbf/plugs/common/echo.py # # """ echo typed sentences. """ .. _fbf.plugs.core.echo_fbf_imports: fbf imports -------------- :: from fbf.lib.commands import cmnds from fbf.lib.examples import examples from fbf.lib.callbacks import callbacks, first_callbacks, last_callbacks .. _fbf.plugs.core.echo_basic_imports: basic imports ---------------- :: import logging .. _fbf.plugs.core.echo_echo-callback_: echo-callback ---------------- :: def echopre(bot, event): """ test whether we should echo. """ if event.how != "background" and bot.type in ["tornado", "web"] and not event.forwarded and not event.cbtype == "OUTPUT": return True return False def echocb(bot, event): """ do the echo. """ bot.outnocb(event.channel, event.txt, event=event) #first_callbacks.add("TORNADO", echocb, echopre) #first_callbacks.add("DISPATCH", echocb, echopre) .. _fbf.plugs.core.echo_echo_command: echo command --------------- :: def handle_echo(bot, event): """ argumetnts: - echo txt to channel. """ if event.how != "background" and not event.isremote(): if not event.isdcc: bot.saynocb(event.channel, "%s" % event.rest, event=event) cmnds.add("echo", handle_echo, ['OPER', 'USER']) examples.add("echo", "echo input", "echo yoooo dudes")