autoParseChatId static method
dynamic
autoParseChatId(
- dynamic data
Implementation
static dynamic autoParseChatId(dynamic data) {
try {
try {
return num.parse(data).toInt();
} catch (e) {}
if (data is String) {
if (RegExp("([a-z_0-9]+)", caseSensitive: false).hasMatch(data)) {
return "@${data.replaceAll(RegExp("(@)", caseSensitive: false), "").trim()}";
}
}
} catch (e) {}
return 0;
}