mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-12-28 17:44:47 +01:00
20 lines
320 B
Python
20 lines
320 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
from pyln.client import Plugin
|
||
|
import time
|
||
|
|
||
|
plugin = Plugin()
|
||
|
|
||
|
|
||
|
@plugin.method("countdown")
|
||
|
def countdown(count, plugin, request):
|
||
|
count = int(count)
|
||
|
for i in range(count):
|
||
|
time.sleep(0.1)
|
||
|
request.notify("{}/{}".format(i, count), "INFO")
|
||
|
|
||
|
return "Done"
|
||
|
|
||
|
|
||
|
plugin.run()
|