Replying with Media #3

Closed
opened 2025-08-13 23:31:11 +00:00 by XSilverTH · 2 comments
XSilverTH commented 2025-08-13 23:31:11 +00:00 (Migrated from github.com)

This is probably a really stupid question but how do you send/reply a photo or any other media?
in Telegram.Bot this is possible with an easy and obvious Bot.SendPhoto or a Bot.SendVideo etc
here there is just a Reply() or a ResponseText() with no option to make them send media as far as i saw
there are also 0 examples in the Wiki

This is probably a really stupid question but how do you send/reply a photo or any other media? in Telegram.Bot this is possible with an easy and obvious Bot.SendPhoto or a Bot.SendVideo etc here there is just a Reply() or a ResponseText() with no option to make them send media as far as i saw there are also 0 examples in the Wiki
Rikitav commented 2025-08-26 10:11:58 +00:00 (Migrated from github.com)

In any handler you can access bot client using protected property Client or throug container container.Client

public override async Task<Result> Execute(IAbstractHandlerContainer<Message> container, CancellationToken cancellation)
{
    await Client.SendPhoto(...);
}
In any handler you can access bot client using protected property `Client` or throug container `container.Client` ``` public override async Task<Result> Execute(IAbstractHandlerContainer<Message> container, CancellationToken cancellation) { await Client.SendPhoto(...); } ```
Rikitav commented 2025-08-26 10:13:49 +00:00 (Migrated from github.com)

Reply method inside handler is just proxy to extension method IAbstractHandlerContainer<Message>.Reply().
You can apply same logic to your use cases and contribute them to repo if you want! :)

`Reply` method inside handler is just proxy to extension method `IAbstractHandlerContainer<Message>.Reply()`. You can apply same logic to your use cases and contribute them to repo if you want! :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rikitav/Telegrator#3