28 lines
831 B
Python
Executable File
28 lines
831 B
Python
Executable File
from src.discord_helper import send_message
|
|
from src.mail.mail_confirmation import read_mails_and_find_confirmation_contacts
|
|
from src.pojo import ReserveResultPojo
|
|
|
|
|
|
def create_message_from_item(item: ReserveResultPojo):
|
|
return f"约会信息\n" \
|
|
f"电话: {item.phone}\n" \
|
|
f"链接: {item.url}\n" \
|
|
f"护照: {item.passport}\n" \
|
|
f"Email: {item.mail}\n" \
|
|
f"First Name: {item.first_name}\n" \
|
|
f"Last Name: {item.last_name}\n"
|
|
|
|
|
|
def main():
|
|
# initialize discord
|
|
print("init discord done")
|
|
# wait for discord to start up
|
|
# time.sleep(10)
|
|
_accepted_appointments = read_mails_and_find_confirmation_contacts()
|
|
for item in _accepted_appointments:
|
|
send_message(create_message_from_item(item))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|