telegram_chat_text static method

String telegram_chat_text({
  1. required String chat_username,
  2. required String text,
})

convert messages_api to messages_api_tdlib example:

String telegram_chat_text = TgUtils.telegram_chat_text(chat_username: "azkadev", text: "alow"); // result: https://t.me/azkadev?text=alow

Implementation

static String telegram_chat_text({
  required String chat_username,
  required String text,
}) {
  return Uri.parse("https://t.me/").replace(pathSegments: [
    "${chat_username.toString().replaceAll(RegExp(r"(@)", caseSensitive: false), "").trim()}",
  ], queryParameters: {
    "text": text,
  }).toString();
}