X Tutup
Skip to content

stripping token of whitespaces before starting bot#303

Closed
Eldinnie wants to merge 2 commits intopython-telegram-bot:masterfrom
Eldinnie:master
Closed

stripping token of whitespaces before starting bot#303
Eldinnie wants to merge 2 commits intopython-telegram-bot:masterfrom
Eldinnie:master

Conversation

@Eldinnie
Copy link
Copy Markdown
Member

If tokens get read in with trailing or leading whitespaces bot will not start.
Added code to check and warn the user if token contains whitespaces and strip them.
Moved logger setup for this purpose

@leandrotoledo leandrotoledo added the 📋 pending-review work status: pending-review label May 22, 2016
@rahiel rahiel assigned rahiel and tsnoam and unassigned rahiel May 22, 2016
@leandrotoledo
Copy link
Copy Markdown
Member

Please consider to add a test for this case. something like:

    def testInvalidToken4(self):
        self._test_invalid_token('1234:abcd1234\n')

@Eldinnie
Copy link
Copy Markdown
Member Author

@leandrotoledo I see you already did that?

@leandrotoledo
Copy link
Copy Markdown
Member

Hi @Eldinnie, thanks for your good work here, but we've decided to reflect API errors and raise InvalidToken, as described on #306. So I'll close this one.

@Eldinnie
Copy link
Copy Markdown
Member Author

NP

@github-actions github-actions bot locked and limited conversation to collaborators Aug 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

📋 pending-review work status: pending-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

X Tutup