added info command to bot, added fix_cost and per_unit_cost

This commit is contained in:
Believethehype
2023-11-28 20:33:30 +01:00
parent bb2ab9e2c7
commit bd2f48cc2f
12 changed files with 107 additions and 80 deletions

View File

@@ -144,12 +144,10 @@ def check_url_is_readable(url):
def get_amount_per_task(task, dvm_config, duration=1):
# duration is either static 1 (for images etc) or in seconds
if duration == 0:
duration = 1
# duration is either static 1 (for images etc) or in seconds by default (e.g. audio/video)
for dvm in dvm_config.SUPPORTED_DVMS: # this is currently just one
if dvm.TASK == task:
amount = dvm.COST * duration
amount = dvm.FIX_COST + (dvm.PER_UNIT_COST * duration)
return amount
else:
print("[" + dvm_config.SUPPORTED_DVMS[

View File

@@ -9,7 +9,8 @@ class DVMConfig:
SUPPORTED_DVMS= []
PRIVATE_KEY: str = ""
PUBLIC_KEY: str = ""
COST: int = None
FIX_COST: float = None
PER_UNIT_COST: float = None
RELAY_LIST = ["wss://relay.damus.io", "wss://nostr-pub.wellorder.net", "wss://nos.lol", "wss://nostr.wine",
"wss://relay.nostfiles.dev", "wss://nostr.mom", "wss://nostr.oxtr.dev", "wss://relay.nostr.bg",