hasText method
Checks if the message contains a specific text.
Example:
if (ctx.hasText('hello')) {
await ctx.reply('Hi there!');
}
Implementation
bool hasText(String text, {bool caseSensitive = false}) {
final messageText = this.text;
if (messageText == null) return false;
if (caseSensitive) {
return messageText.contains(text);
} else {
return messageText.toLowerCase().contains(text.toLowerCase());
}
}