<?php
$strings[] = "http://t.me/tm_factory_bot"; //0
$strings[] = "https://telegram.me/tm_factory_bot"; //1
$strings[] = "https://telegram.me/tm_factory_bot?start=123"; //2
$strings[] = "tg://resolve?domain=buy_this"; //3
$strings[] = "tg://resolve?domain=buy_this&start=123"; //4
$strings[] = "https://t.me/joinchat/AAAAAEOI5lHxvYlMxwHGSA"; //5
$strings[] = "https://web.telegram.org/#/im?tgaddr=tg%3A%2F%2Fjoin%3Finvite%3DAAAAAEOI5lHxvYlMxwH-GSA"; //6
$strings[] = "https://web.telegram.org/#/im?tgaddr=tg%3A%2F%2Fresolve%3Fdomain%3Dbuy_this"; //7
$strings[] = "https://web.telegram.org/#/im?tgaddr=tg%3A%2F%2Fresolve%3Fdomain%3Dtm_factory_bot%26start%3D123"; //8
$strings[] = "https://web.telegram.org/#/im?p=@funny_images"; //9
$strings[] = "@funny_images"; //10
$strings[] = "funny_images"; //11
$strings[] = "tg://join?invite=AAAAAEOI5lHxvYlMxwHGSA"; //12
foreach ($strings as $key=>$string) {
$tgType = true;
if ($tgType) {
$private = "tg://join?invite=";
$public = "tg://resolve?domain=";
$sep = "&";
} else {
$private = "https://t.me/joinchat/";
$public = "https://t.me/";
$sep = "?";
}
$value = urldecode($string);
preg_match('#[^&\?]??([a-z_0-9\-]+)[&\?]??(start=[a-z0-9]*?)?$#i', $value, $preg);
if (preg_match("#(invite=|joinchat/)#i", $value)) {
$link = $private . $preg[1];
} else {
$link = $public . $preg[1];
}
if (isset($preg[2])) {
$link .= $sep . $preg[2];
}
echo "\r\n" . $key . " - " . $link;
}
- Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
-
0 - tg://resolve?domain=tm_factory_bot
1 - tg://resolve?domain=tm_factory_bot
2 - tg://resolve?domain=tm_factory_bot&start=123
3 - tg://resolve?domain=buy_this
4 - tg://resolve?domain=buy_this&start=123
5 - tg://join?invite=AAAAAEOI5lHxvYlMxwHGSA
6 - tg://join?invite=AAAAAEOI5lHxvYlMxwH-GSA
7 - tg://resolve?domain=buy_this
8 - tg://resolve?domain=tm_factory_bot&start=123
9 - tg://resolve?domain=funny_images
10 - tg://resolve?domain=funny_images
11 - tg://resolve?domain=funny_images
12 - tg://join?invite=AAAAAEOI5lHxvYlMxwHGSA
- Output for 8.3.5
- Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
0 - tg://resolve?domain=tm_factory_bot
1 - tg://resolve?domain=tm_factory_bot
2 - tg://resolve?domain=tm_factory_bot&start=123
3 - tg://resolve?domain=buy_this
4 - tg://resolve?domain=buy_this&start=123
5 - tg://join?invite=AAAAAEOI5lHxvYlMxwHGSA
6 - tg://join?invite=AAAAAEOI5lHxvYlMxwH-GSA
7 - tg://resolve?domain=buy_this
8 - tg://resolve?domain=tm_factory_bot&start=123
9 - tg://resolve?domain=funny_images
10 - tg://resolve?domain=funny_images
11 - tg://resolve?domain=funny_images
12 - tg://join?invite=AAAAAEOI5lHxvYlMxwHGSA
preferences:
172.29 ms | 403 KiB | 172 Q