Files
lightning/tests/plugins/custommsg.py
Michael Schmoock 8e71c7a1f1 feat: make custommsg hook chainable
Changelog-Changed: custommsg hook is now chainable
2021-01-29 13:37:42 +10:30

17 lines
328 B
Python
Executable File

#!/usr/bin/env python3
from pyln.client import Plugin
plugin = Plugin()
@plugin.hook('custommsg')
def on_custommsg(peer_id, message, plugin, **kwargs):
plugin.log("Got a custom message {msg} from peer {peer_id}".format(
msg=message,
peer_id=peer_id
))
return {'result': 'continue'}
plugin.run()