mirror of
https://github.com/Sheldan/Sissi.git
synced 2026-01-23 12:05:00 +00:00
updating for Debra 2023 campaign adding internal rest api for debra information adding a debra button to receive information
21 lines
608 B
Python
21 lines
608 B
Python
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
|
|
|