Mention extension

Extensions for the User class.

This extension adds a mention getter to the User class. This getter returns a UserMention object. This can be very helpful when you want to mention a user in a message.

Example: When you want to mention a user in a message, you can use this extension to represent the mention instead of manually creating the mention URL.

bot.start((ctx) {
  final mention = ctx.from.mention;
  ctx.reply("Hello $mention!");
});
on

Properties

mention UserMention
Example: When you want to mention a user in a message, you can use this extension to represent the mention instead of manually creating the mention URL.
no setter

Methods

mentionWith(String text, {ParseMode parseMode = ParseMode.html}) UserMention
Returns a UserMention object with the passed text and parseMode.