Files
NijiHolo_EN_ID_Bot/src/talent_lists.py
T

36 lines
1.0 KiB
Python
Raw Normal View History

2022-09-24 17:56:58 -07:00
import util
holo_en = dict()
2022-09-25 04:24:04 -07:00
holo_id = dict()
niji_en = dict()
niji_exid = dict()
2022-09-24 17:56:58 -07:00
talents = dict()
def __create_dict(file, _dict):
2022-09-25 18:31:50 -07:00
print(f'Initializing talents\' account list from {file}...')
2022-09-24 17:56:58 -07:00
global talents
with open(file, 'r') as f:
for line in f:
words = line.split()
if len(words) == 2 and line[0] != '#':
name, id = line.split()
talents[int(id)] = name
# name = util.get_username_online(id) # attempt to get updated name
2022-09-25 18:31:50 -07:00
talents[int(id)] = name
_dict[int(id)] = name
2022-09-24 17:56:58 -07:00
def init():
global holo_en
2022-09-25 04:24:04 -07:00
global holo_id
global niji_en
global niji_exid
2022-09-24 17:56:58 -07:00
# holoEN
__create_dict(f'{util.get_project_dir()}/lists/holoen.txt', holo_en)
2022-09-25 04:24:04 -07:00
# holoID
__create_dict(f'{util.get_project_dir()}/lists/holoid.txt', holo_id)
2022-09-24 17:56:58 -07:00
# nijiEN
__create_dict(f'{util.get_project_dir()}/lists/nijien.txt', niji_en)
2022-09-25 04:24:04 -07:00
# nijiexID
__create_dict(f'{util.get_project_dir()}/lists/nijiexid.txt', niji_exid)