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[