hasEntityType method

bool hasEntityType(
  1. MessageEntityType type
)

Checks if the message contains entities of the specified type.

Example:

if (ctx.hasEntityType(MessageEntityType.mention)) {
  await ctx.reply("I see you mentioned someone!");
}

Implementation

bool hasEntityType(MessageEntityType type) {
  final entityData = _getEntityData();
  return entityData?.entities.any((e) => e.type == type) ?? false;
}