withUploadDocument<T> method

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

Shows upload document indicator and executes a function.

Example:

await ctx.withUploadDocument(() async {
  final document = await generateReport();
  await ctx.replyWithDocument(document);
});

Implementation

Future<T> withUploadDocument<T>(Future<T> Function() operation) async {
  await sendUploadDocument();
  return await operation();
}