mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-11-18 18:26:27 +01:00
added dall-e, reworked bot, added nip89config
This commit is contained in:
@@ -3,7 +3,7 @@ from threading import Thread
|
||||
|
||||
from utils.admin_utils import AdminConfig
|
||||
from utils.dvmconfig import DVMConfig
|
||||
from utils.nip89_utils import NIP89Announcement
|
||||
from utils.nip89_utils import NIP89Announcement, NIP89Config
|
||||
from dvm import DVM
|
||||
|
||||
|
||||
@@ -17,19 +17,20 @@ class DVMTaskInterface:
|
||||
dvm_config: DVMConfig
|
||||
admin_config: AdminConfig
|
||||
|
||||
def NIP89_announcement(self, d_tag, content):
|
||||
def NIP89_announcement(self, nip89config: NIP89Config):
|
||||
nip89 = NIP89Announcement()
|
||||
nip89.name = self.NAME
|
||||
nip89.kind = self.KIND
|
||||
nip89.pk = self.PK
|
||||
nip89.dtag = d_tag
|
||||
nip89.content = content
|
||||
nip89.dtag = nip89config.DTAG
|
||||
nip89.content = nip89config.CONTENT
|
||||
return nip89
|
||||
|
||||
def run(self):
|
||||
nostr_dvm_thread = Thread(target=self.DVM, args=[self.dvm_config, self.admin_config])
|
||||
nostr_dvm_thread.start()
|
||||
|
||||
|
||||
def is_input_supported(self, input_type, input_content) -> bool:
|
||||
"""Check if input is supported for current Task."""
|
||||
pass
|
||||
@@ -50,12 +51,4 @@ class DVMTaskInterface:
|
||||
opts = json.loads(request_form["options"])
|
||||
print(opts)
|
||||
|
||||
# old format, deprecated, will remove
|
||||
elif request_form.get("optStr"):
|
||||
opts = []
|
||||
for k, v in [option.split("=") for option in request_form["optStr"].split(";")]:
|
||||
t = (k, v)
|
||||
opts.append(t)
|
||||
print("...done.")
|
||||
|
||||
return dict(opts)
|
||||
|
||||
Reference in New Issue
Block a user