mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-12-29 10:04:41 +01:00
22 lines
422 B
Python
22 lines
422 B
Python
|
#!/usr/bin/env python3
|
||
|
from pyln.client import Plugin
|
||
|
|
||
|
|
||
|
plugin = Plugin()
|
||
|
|
||
|
|
||
|
@plugin.subscribe("custom")
|
||
|
def on_custom_notification(val, plugin, **kwargs):
|
||
|
plugin.log("Got a custom notification {}".format(val))
|
||
|
|
||
|
|
||
|
@plugin.method("emit")
|
||
|
def emit(plugin):
|
||
|
"""Emit a simple string notification to topic "custom"
|
||
|
"""
|
||
|
plugin.notify("custom", "Hello world")
|
||
|
|
||
|
|
||
|
plugin.add_notification_topic("custom")
|
||
|
plugin.run()
|