-
Notifications
You must be signed in to change notification settings - Fork 1
Plugin Development
fro_ozen edited this page Jul 27, 2015
·
4 revisions
from pybot import plugin_manager, irc
@plugin_manager.command("hello")
def hello_command(command, server):
# Create the event to be sent
hello_event = irc.Irc_event("PRIVMSG", command.event.args[0], "Hello.")
# Send the event
server.send_event(hello_event)
This code creates a command that can be called by writing )hello
in the channel.
from pybot import plugin_manager, irc
@plugin_manager.event_handler("JOIN")
def on_join(event, server):
# Create the event
hello_event = irc.Irc_event("PRIVMSG", command.event.args[0], "Hello.")
# Send the event
server.send_event(hello_event)
This code creates a handler that writes Hello.
in the channel every time someone joins.