echo typed sentences.
do the echo.
test whether we should echo.
argumetnts: <txt> - echo txt to channel.
# fbf/plugs/common/echo.py # # """ echo typed sentences. """
from fbf.lib.commands import cmnds from fbf.lib.examples import examples from fbf.lib.callbacks import callbacks, first_callbacks, last_callbacks
import logging
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)
def handle_echo(bot, event): """ argumetnts: <txt> - 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")