Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to support handling photo messages in addition to document messages. The changes include registering new types, modifying existing functions to handle photos, and updating file location handling. Here are the most important changes:
Support for Photo Messages:
internal/cache/cache.go
: Registeredtg.InputPhotoFileLocation
to support photo messages.internal/commands/stream.go
: UpdatedsupportedMediaFilter
to return true fortg.MessageMediaPhoto
and adjustedsendLink
function to remove redundant error handling. [1] [2]internal/routes/stream.go
: Added logic to handle photo messages ingetStreamRoute
, including fetching the file and setting appropriate headers. [1] [2]internal/utils/helpers.go
: Implemented support for photo media inFileFromMedia
and updatedFileFromMessage
to handle photos. [1] [2]File Location Handling:
internal/types/file.go
: ChangedLocation
field inFile
struct to usetg.InputFileLocationClass
instead oftg.InputDocumentFileLocation
.internal/utils/reader.go
: UpdatedtelegramReader
to usetg.InputFileLocationClass
forlocation
field. [1] [2]These changes collectively enhance the system's capability to handle photo messages, ensuring proper registration, filtering, and processing of photo files.