addCookiesFromCookiesInfo method

String addCookiesFromCookiesInfo(
  1. String cookies,
  2. List<String> cookiesInfo
)

run executable telegram bot api

Implementation

String addCookiesFromCookiesInfo(String cookies, List<String> cookiesInfo) {
  for (String s in cookiesInfo) {
    if (s.split('=').length < 2) {
      continue;
    }
    var name = s.split('=')[0];
    if (!(name.contains("path")) &&
        !(name.contains("samesite")) &&
        !(name.contains("secure")) &&
        !(name.contains("expires"))) {
      s = s.replaceAll('HttpOnly,', '');
      cookies = '$cookies$s;';
    }
  }
  return cookies;
}