update list stuff

This commit is contained in:
muskit
2022-09-25 04:24:04 -07:00
committed by msk
parent 25025de06b
commit f26e29d52a
7 changed files with 79 additions and 8 deletions
+2 -2
View File
@@ -52,6 +52,6 @@ async def run():
# ttweet = tt.TalentTweet.deserialize(serialized_ttweet)
# print(ttweet)
ttweet = tt.TalentAPITweet(1573563417415233536)
ttweet = tt.TalentAPITweet(1557021645331542016)
print(ttweet)
# await TwAPI.instance.create_post(ttweet)
await TwAPI.instance.create_post(ttweet)
+11 -2
View File
@@ -1,7 +1,9 @@
import util
niji_en = dict()
holo_en = dict()
holo_id = dict()
niji_en = dict()
niji_exid = dict()
talents = dict()
def __create_dict(file, _dict):
@@ -14,10 +16,17 @@ def __create_dict(file, _dict):
_dict[int(id)] = name
talents[int(id)] = name
def init():
global niji_en
global holo_en
global holo_id
global niji_en
global niji_exid
# holoEN
__create_dict(f'{util.get_project_dir()}/lists/holoen.txt', holo_en)
# holoID
__create_dict(f'{util.get_project_dir()}/lists/holoid.txt', holo_id)
# nijiEN
__create_dict(f'{util.get_project_dir()}/lists/nijien.txt', niji_en)
# nijiexID
__create_dict(f'{util.get_project_dir()}/lists/nijiexid.txt', niji_exid)
+9 -4
View File
@@ -87,14 +87,19 @@ class TalentTweet:
return s[:-1]
def is_cross_company(self):
# TODO: update for EN/ID
for other_id in self.all_parties:
if self.author_id in talent_lists.niji_en:
if other_id in talent_lists.holo_en:
if self.author_id in talent_lists.holo_en:
if other_id in talent_lists.niji_en or other_id in talent_lists.niji_exid:
return True
elif self.author_id in talent_lists.holo_en:
if self.author_id in talent_lists.niji_en:
if other_id in talent_lists.holo_en or other_id in talent_lists.holo_id:
return True
if self.author_id in talent_lists.holo_id:
if other_id in talent_lists.niji_en:
return True
if self.author_id in talent_lists.niji_exid:
if other_id in talent_lists.holo_en:
return True
return False
def get_all_parties_usernames(self):