[SIS-9] adding migration scripts for custom commands and economy

This commit is contained in:
Sheldan
2022-07-22 00:27:59 +02:00
parent 7f8c429a04
commit 249a3e3d19
8 changed files with 171 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import json
from dto import LegacyCredits
def load_all_credits():
with open('settings.json') as warnings:
lines = warnings.read()
credit_obj = json.loads(lines)
user_list = credit_obj['384734293238749']['MEMBER']['297910194841583616']
all_credit_dtos = []
for user in user_list:
user_obj = user_list[user]
dto = LegacyCredits()
dto.credits = user_obj['balance']
dto.user_id = user
all_credit_dtos.append(dto)
print(f'loaded {len(all_credit_dtos)} credit entries.')
return all_credit_dtos