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

improved sessionName + NewClient + InMemorySessionName #30

Merged
merged 4 commits into from
Sep 3, 2023
Merged

improved sessionName + NewClient + InMemorySessionName #30

merged 4 commits into from
Sep 3, 2023

Conversation

KoNekoD
Copy link
Contributor

@KoNekoD KoNekoD commented Sep 3, 2023

No description provided.

@KoNekoD
Copy link
Contributor Author

KoNekoD commented Sep 3, 2023

This will fix this problem when I have a Pyrogram session as a string
image

@KoNekoD KoNekoD changed the title improved sessionName improved sessionName + NewClient Sep 3, 2023
@KoNekoD KoNekoD changed the title improved sessionName + NewClient improved sessionName + NewClient + InMemorySessionName Sep 3, 2023
@KoNekoD
Copy link
Contributor Author

KoNekoD commented Sep 3, 2023

A couple more improvements would be just right :)

Copy link
Owner

@celestix celestix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @KoNekoD! Please make the proposed changes before we proceed to merge the PR.

@@ -30,6 +30,8 @@ const (
TelethonSession
// PyrogramSession is used as SessionType when you want to log in through the string session made by pyrogram - a Python MTProto library.
PyrogramSession
// InMemorySessionName is used when it is necessary to indicate that this session is in memory
InMemorySessionName = ":memory:"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to name this constant as "InMemorySession" instead of "InMemorySessionName", following the convention of library.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 0973db5

@@ -42,50 +44,88 @@ func NewSession(sessionName string, sessionType SessionType) *SessionName {
return &s
}

func NewSessionWithoutFiles(sessionValue string, sessionType SessionType) *SessionName {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if you rename this function to NewInMemorySession() to avoid confusions and consider adding function documentations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 0973db5

client.go Outdated Show resolved Hide resolved
@celestix
Copy link
Owner

celestix commented Sep 3, 2023

LGTM!

@KoNekoD
Copy link
Contributor Author

KoNekoD commented Sep 3, 2023

Why lint failed?

@celestix celestix merged commit 90b7499 into celestix:beta Sep 3, 2023
1 of 3 checks passed
@celestix
Copy link
Owner

celestix commented Sep 3, 2023

Thank you for the PR! We can resolve linting issues later.

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

Successfully merging this pull request may close these issues.

2 participants