(plugin, onion_message, **kwargs)
| 9 | |
| 10 | @plugin.hook("onion_message") |
| 11 | def on_onion_message(plugin, onion_message, **kwargs): |
| 12 | if 'reply_path' not in onion_message: |
| 13 | plugin.log("no reply path") |
| 14 | return |
| 15 | |
| 16 | plugin.rpc.call('sendobsonionmessage', [onion_message['reply_path']]) |
| 17 | plugin.log("Got onion_message invoice '{}'".format(onion_message['invoice'])) |
| 18 | plugin.log("Sent reply via {}".format(onion_message['reply_path'])) |
| 19 | return {"result": "continue"} |
| 20 | |
| 21 | |
| 22 | plugin.run() |