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

QUESTION: Session problems #71

Open
l1ah1m opened this issue Apr 27, 2024 · 12 comments
Open

QUESTION: Session problems #71

l1ah1m opened this issue Apr 27, 2024 · 12 comments

Comments

@l1ah1m
Copy link

l1ah1m commented Apr 27, 2024

Screenshot 2024-04-27 at 19 46 17

Even when i pass in a string of a session it still tries to send a code and get a code from me. Additionally it creates the session storage files. you see i need to store the session in the mongodb and how do i properly extract it so that when i create a new client next time the server restarts it wont ask me the code that comes to telegram.

P.S i extract the session with client.ExportStringSession() maybe there is a better way

@celestix
Copy link
Owner

Screenshot 2024-04-27 at 19 46 17 Even when i pass in a string of a session it still tries to send a code and get a code from me. Additionally it creates the session storage files. you see i need to store the session in the mongodb and how do i properly extract it so that when i create a new client next time the server restarts it wont ask me the code that comes to telegram.

P.S i extract the session with client.ExportStringSession() maybe there is a better way

GoTGProto currently doesn't support storing session in MongoDB, but you can add it yourself if you want.
Look as https://github.com/celestix/gotgproto/blob/beta/sessionMaker/sessionConstructor.go

You can even make a PR to contribute it for everyone :)

@l1ah1m
Copy link
Author

l1ah1m commented Apr 28, 2024

The question is why can i use the string session extracted by client.ExportStringSession() in the format like here Session: sessionMaker.StringSession() and just save the string however i want

@celestix
Copy link
Owner

What do you mean? Please rephrase your question.

@l1ah1m
Copy link
Author

l1ah1m commented Apr 28, 2024

Screenshot 2024-04-28 at 15 16 06 explained everything here

@celestix
Copy link
Owner

Yeah, you need to use your exported string session as an argument to StringSession function

@l1ah1m
Copy link
Author

l1ah1m commented Apr 28, 2024

Screenshot 2024-04-29 at 00 36 35

but even when i pass in the exported string session it is still asking me the code as below(the session is fake in the example)

Screenshot 2024-04-29 at 00 30 04

and the echo function does not work so the client is not properly set up yet, when using the string session

Screenshot 2024-04-29 at 00 30 16

@celestix
Copy link
Owner

That's strange 🤔 I will check and get back to you.

@l1ah1m
Copy link
Author

l1ah1m commented Apr 29, 2024

Thank you very much, keep me updated once you check
)

@l1ah1m
Copy link
Author

l1ah1m commented Apr 29, 2024

Any updates?

@celestix
Copy link
Owner

Any updates?

Please be patient. I am trying to arrange a telegram account for testing it.

@l1ah1m
Copy link
Author

l1ah1m commented Apr 30, 2024

Just a quick follow up does the string session work?

@celestix
Copy link
Owner

Just a quick follow up does the string session work?

Hi @XT3RM1NATOR, I tried exporting a string session and using it to start the client and it worked completely fine. I think you're doing something wrong at your end, can you show the code you're using to do it?

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