isFromUser method

bool isFromUser(
  1. int userId
)

Checks if the current user is the sender of the message.

Example:

if (ctx.isFromUser(123456789)) {
  await ctx.reply('Hello, specific user!');
}

Implementation

bool isFromUser(int userId) {
  return from?.id == userId;
}