Skip to content

Bot token in error messages #770

@UdinSemen

Description

@UdinSemen

Hello!
Today I have face the problem of showing API bot token is exposed in error messages.
For example, here’s a snippet from the log:

telebot: Post \"https://api.telegram.org/bot<BOT_TOKEN>/getFile\": http2: server sent GOAWAY and closed the connection; LastStreamID=1999, ErrCode=NO_ERROR, debug=""

I replaced the real bot token with <BOT_TOKEN> for security reasons.
I believe this behavior is problematic and suggest that the bot token should always be masked (e.g., replaced with <BOT_TOKEN>) in error messages or logs to prevent unintentional exposure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions