UserMention class
A class representing a mention.
This class 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 class to represent the mention instead of manually creating the mention URL.
// Create a new UserMention object.
final mention = UserMention(123456789, "Jake");
// And just send the message.
// Make sure to set the parseMode to ParseMode.html or ParseMode.markdown.
bot.api.sendMessage(
chatId,
"Hello $mention!",
parseMode: ParseMode.html,
);
// There we go! The user will be mentioned in the message. :)
Constructors
- UserMention(int id, String text, {ParseMode parseMode = ParseMode.html})
-
Constructs a new UserMention instance.
const
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
Returns a string representation of the mention.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited