添加whatshub工单

This commit is contained in:
root
2026-06-20 04:47:34 +08:00
parent a6c87e8e25
commit d5a0ffa6db
271 changed files with 9377 additions and 303 deletions
+13 -7
View File
@@ -12,13 +12,13 @@ class SplitFriendUrlBuilder
/**
* 构建跳转 URL;无法构建时返回空字符串
*
* @param string $whatsAppReplyText WhatsApp 类型使用,预填消息文案(urlencode 在内部处理
* @param string $replyText WhatsApp / Telegram 预填消息文案(内部 rawurlencode
*/
public static function build(
string $numberType,
string $number,
string $numberTypeCustom = '',
string $whatsAppReplyText = ''
string $replyText = ''
): string {
$number = trim($number);
if ($number === '') {
@@ -27,9 +27,9 @@ class SplitFriendUrlBuilder
switch ($numberType) {
case 'whatsapp':
return self::buildWhatsApp($number, $whatsAppReplyText);
return self::buildWhatsApp($number, $replyText);
case 'telegram':
return self::buildTelegram($number);
return self::buildTelegram($number, $replyText);
case 'line':
return self::buildLine($number);
case 'custom':
@@ -59,16 +59,22 @@ class SplitFriendUrlBuilder
}
/**
* Telegramhttps://t.me/+ 号码(去掉前导 +
* Telegramhttps://t.me/+ 号码(去掉前导 +,可选 ?text= 预填消息(须 URL 编码)
*/
private static function buildTelegram(string $number): string
private static function buildTelegram(string $number, string $replyText = ''): string
{
$id = ltrim($number, '+');
if ($id === '') {
return '';
}
return 'https://t.me/+' . $id;
$url = 'https://t.me/+' . $id;
$replyText = trim($replyText);
if ($replyText !== '') {
$url .= '?text=' . rawurlencode($replyText);
}
return $url;
}
/**