mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-09-29 21:53:20 +02:00
shutdown
This commit is contained in:
14
bot.py
14
bot.py
@@ -1,4 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
|
import os
|
||||||
|
import signal
|
||||||
import time
|
import time
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
@@ -88,6 +90,8 @@ class Bot:
|
|||||||
|
|
||||||
if decrypted_text.split(" ")[1].lower() == "info":
|
if decrypted_text.split(" ")[1].lower() == "info":
|
||||||
nip89 = self.dvm_config.SUPPORTED_DVMS[index].dvm_config.NIP89
|
nip89 = self.dvm_config.SUPPORTED_DVMS[index].dvm_config.NIP89
|
||||||
|
|
||||||
|
|
||||||
nip89content = json.loads(nip89.content)
|
nip89content = json.loads(nip89.content)
|
||||||
info = ""
|
info = ""
|
||||||
if nip89content.get("name"):
|
if nip89content.get("name"):
|
||||||
@@ -385,8 +389,14 @@ class Bot:
|
|||||||
print("[" + self.NAME + "] Error during content decryption:" + str(e))
|
print("[" + self.NAME + "] Error during content decryption:" + str(e))
|
||||||
|
|
||||||
self.client.handle_notifications(NotificationHandler())
|
self.client.handle_notifications(NotificationHandler())
|
||||||
while True:
|
|
||||||
time.sleep(1.0)
|
try:
|
||||||
|
while True:
|
||||||
|
time.sleep(1.0)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print('Stay weird!')
|
||||||
|
os.kill(os.getpid(), signal.SIGKILL)
|
||||||
|
exit(1)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
bot = Bot
|
bot = Bot
|
||||||
|
1
main.py
1
main.py
@@ -82,6 +82,7 @@ def run_nostr_dvm_with_local_config():
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print('Stay weird!')
|
print('Stay weird!')
|
||||||
os.kill(os.getpid(), signal.SIGKILL)
|
os.kill(os.getpid(), signal.SIGKILL)
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Reference in New Issue
Block a user