waitForContactMessage method

Future<Context?> waitForContactMessage({
  1. required ID chatId,
  2. Duration? timeout,
  3. bool clearUnfulfilled = true,
})

Wait for a contact message from the user.

Possibly returns null if the listener has been cancelled before it completes. Otherwise, returns a Context object with the incoming update.

Implementation

Future<Context?> waitForContactMessage({
  required ID chatId,
  Duration? timeout,
  bool clearUnfulfilled = true,
}) async {
  return await waitFor(
    chatId: chatId,
    timeout: timeout,
    filter: (up) => up.message?.contact != null,
    handlerName: "contact",
    clearUnfulfilled: clearUnfulfilled,
  );
}