def register(loop: asyncio.AbstractEventLoop, backend: Backend) -> None: uuid = backend.util_get_uuid_from_email(BOT_EMAIL) assert uuid is not None bs = backend.login(uuid, CLIENT, BackendEventHandler(loop), option=LoginOption.BootOthers) assert bs is not None
def register(loop: asyncio.AbstractEventLoop, backend: Backend) -> None: for i in range(5): uuid = backend.util_get_uuid_from_email( 'bot{}@bot.log1p.xyz'.format(i)) assert uuid is not None bs = backend.login(uuid, CLIENT, BackendEventHandler(loop), option=LoginOption.BootOthers) assert bs is not None
def yahoo_id_to_uuid(backend: Backend, yahoo_id: Optional[str]) -> Optional[str]: if not yahoo_id: return None email = None # type: Optional[str] # Fun fact about foreign Yahoo! email addresses: they're just relays to the same account name but with # `@yahoo.com` instead of `@yahoo.*`. The server should check the address to add an entry for the `@yahoo.com` # account, then they can be identified. if '@' in yahoo_id: if not yahoo_id.endswith('@yahoo.com'): email = yahoo_id else: return None else: email = '{}@yahoo.com'.format(yahoo_id) return backend.util_get_uuid_from_email(email)