Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to register Telegram API on MadelineProto ? #353

Closed
uisleiselee opened this issue Mar 22, 2018 · 4 comments
Closed

how to register Telegram API on MadelineProto ? #353

uisleiselee opened this issue Mar 22, 2018 · 4 comments

Comments

@uisleiselee
Copy link

Dear Daniil:
how to register a Telegram API from MadelineProto?

could you write some code for it?

https://my.telegram.org/auth/send_password?phone=9888888
after get it, use
https://my.telegram.org/auth/login?phone=9999999&random_hash=iiiiii&password=-iiiiiiii
and obtain api key,

or have a way from MadelineProto?

@danog
Copy link
Owner

danog commented Mar 22, 2018

The latest version now has an interactive login cli+web UI that automatically logs in to my.telegram.org to get the API id, if you haven't provided one in the settings.

@danog danog closed this as completed Mar 22, 2018
@uisleiselee
Copy link
Author

if not setting api, php notice:
Notice: Undefined variable: settings in /Telegram/test.php on line 11
You did not define a valid API ID/API hash. Do you want to define it now manually, or automatically? (m/a):

but if a press a, response a error:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function danog\MadelineProto\MyTelegramOrgWrapper::__construct(), 0 passed in /Telegram/src/danog/MadelineProto/Wrappers/ApiStart.php on line 49 and exactly 1 expected in /Telegram/src/danog/MadelineProto/MyTelegramOrgWrapper.php:21
Stack trace:
#0 /Telegram/src/danog/MadelineProto/Wrappers/ApiStart.php(49): danog\MadelineProto\MyTelegramOrgWrapper->__construct()
#1 /Telegram/src/danog/MadelineProto/API.php(91): danog\MadelineProto\API->api_start()
#2 /Telegram/vendor/danog/magicalserializer/src/danog/Serializable.php(35): danog\MadelineProto\API->__magic_construct(NULL)
#3 /Telegram/test.php(11): danog\MadelineProto\API->__construct(NULL)
#4 {main}
thrown in /Telegram/src/danog/MadelineProto/MyTelegramOrgWrapper.php on line 21

is your means is set
appid = 0
at first?

@uisleiselee
Copy link
Author

ok, I know, not load it.

@danog
Copy link
Owner

danog commented Mar 23, 2018

Fixed in the latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants