You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fro_ozen edited this page Jul 27, 2015
·
4 revisions
Creating a basic command
frompybotimportplugin_manager, irc@plugin_manager.command("hello")defhello_command(command, server):
# Create the event to be senthello_event=irc.Irc_event("PRIVMSG", command.event.args[0], "Hello.")
# Send the eventserver.send_event(hello_event)
This code creates a command that can be called by writing )hello in the channel.
Creating a basic handler
frompybotimportplugin_manager, irc@plugin_manager.event_handler("JOIN")defon_join(event, server):
# Create the eventhello_event=irc.Irc_event("PRIVMSG", command.event.args[0], "Hello.")
# Send the eventserver.send_event(hello_event)
This code creates a handler that writes Hello. in the channel every time someone joins.