Created
April 21, 2015 09:45
-
-
Save endofline/03a6318aef18160c2420 to your computer and use it in GitHub Desktop.
functionally-identical hangouts bot plugins (version 2.4 and above)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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