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
-
Available on User, provided by the Mention extension
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 -
Available on User, provided by the Mention extension
Returns a UserMention object with the passedtextandparseMode.