Skip to content

Conversation

@Forden
Copy link

@Forden Forden commented Dec 30, 2022

Simple patch to allow using bot tokens to auth as a bot and use integer ids instead of only strings

Copy link
Owner

@Nekmo Nekmo left a comment

Choose a reason for hiding this comment

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

The code is fine but documentation and tests are needed. Thanks!

to = async_to_sync(interactive_select_dialog(client))
elif to is None:
to = 'me'
elif to is not None:
Copy link
Owner

Choose a reason for hiding this comment

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

This code is now unnecessary. Also, it doesn't follow the Python style rules. You should never use except without defining an exception. It is also preferable to validate numbers without using exceptions. The use of defining the variable _ is not necessary.

try:
return super().start(phone=phone, password=password, bot_token=bot_token, force_sms=force_sms,
first_name=first_name, last_name=last_name, max_attempts=max_attempts)
return super().start(phone=config.get('phone', None), password=config.get('password', None),
Copy link
Owner

Choose a reason for hiding this comment

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

The code must be prepared in case the token bot and the phone were on.

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