withUploadPhoto<T> method

Future<T> withUploadPhoto<T>(
  1. Future<T> operation()
)

Shows upload photo indicator and executes a function.

Example:

await ctx.withUploadPhoto(() async {
  final photo = await processPhoto();
  await ctx.replyWithPhoto(photo);
});

Implementation

Future<T> withUploadPhoto<T>(Future<T> Function() operation) async {
  await sendUploadPhoto();
  return await operation();
}