Skip to content

Instantly share code, notes, and snippets.

@endofline
Created April 21, 2015 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save endofline/03a6318aef18160c2420 to your computer and use it in GitHub Desktop.
Save endofline/03a6318aef18160c2420 to your computer and use it in GitHub Desktop.
functionally-identical hangouts bot plugins (version 2.4 and above)
"""standard plugin
more documentation: __wikilink__
"""
import plugins
def _initialise(bot):
plugins.register_admin_command(["noop_standard"])
plugins.register_handler(_handle_nothing)
def noop_standard(bot, event, *args):
print("i did nothing!")
def _handle_nothing(bot, event, command):
print("i handled nothing, but a message just went by!")
"""decorator-based plugin
pattern is nearly 1-to-1 compatible with original hangupsbot by xmikos
https://github.com/xmikos/hangupsbot
more documentation: __wikilink__
"""
import hangups
from handlers import handler
from commands import command
@command.register(admin=True)
def noop_alternate(bot, event, *args):
print("i did nothing!")
@handler.register(priority=5, event=hangups.ChatMessageEvent)
def _handle_nothing_xmikos(bot, event):
print("i handled nothing, but a message just went by!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment