"""Example plugin demonstrating the derp plugin API.""" from derp.plugin import command, event @command("echo", help="Echo back text") async def cmd_echo(bot, message): """Repeat everything after the command. Usage: !echo """ parts = message.text.split(None, 1) if len(parts) > 1: await bot.reply(message, parts[1]) else: await bot.reply(message, "Usage: !echo ") @event("JOIN") async def on_join(bot, message): """Greet users joining a channel (skip self).""" if message.nick and message.nick != bot.nick: await bot.send(message.target, f"Hey {message.nick}")