This commit is contained in:
Believethehype 2023-11-29 10:46:51 +01:00
parent 8225478a24
commit 9f495f50fd
2 changed files with 13 additions and 2 deletions

14
bot.py
View File

@ -1,4 +1,6 @@
import json
import os
import signal
import time
from datetime import timedelta
from threading import Thread
@ -88,6 +90,8 @@ class Bot:
if decrypted_text.split(" ")[1].lower() == "info":
nip89 = self.dvm_config.SUPPORTED_DVMS[index].dvm_config.NIP89
nip89content = json.loads(nip89.content)
info = ""
if nip89content.get("name"):
@ -385,8 +389,14 @@ class Bot:
print("[" + self.NAME + "] Error during content decryption:" + str(e))
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):
bot = Bot

View File

@ -82,6 +82,7 @@ def run_nostr_dvm_with_local_config():
except KeyboardInterrupt:
print('Stay weird!')
os.kill(os.getpid(), signal.SIGKILL)
exit(1)
if __name__ == '__main__':