|
|
@@ -188,7 +188,7 @@ class BaseService
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
- public static function bettingGroupNotice2($text, $keyboard = [], $image = '', $isTop = false): array
|
|
|
+ public static function bettingGroupNotice2($text, $keyboard = [], $image = '', $isTop = false): void
|
|
|
{
|
|
|
|
|
|
$bettingGroup = Config::where('field', 'betting_group')->first()->val;
|
|
|
@@ -203,7 +203,6 @@ class BaseService
|
|
|
$texts[] = $item;
|
|
|
}
|
|
|
}
|
|
|
- $res = [];
|
|
|
foreach ($texts as $index => $item) {
|
|
|
$botMsg = [
|
|
|
'chat_id' => "@{$bettingGroup}",
|
|
|
@@ -220,17 +219,21 @@ class BaseService
|
|
|
$botMsg['photo'] = $image;
|
|
|
$botMsg['caption'] = $item;
|
|
|
$botMsg['protect_content'] = true; // 防止转发
|
|
|
-
|
|
|
+ $response = self::telegram()->sendPhoto($botMsg);
|
|
|
} else {
|
|
|
-// $res[] = $botMsg;
|
|
|
+ $response = self::telegram()->sendMessage($botMsg);
|
|
|
}
|
|
|
|
|
|
- if ($index == 0 && $isTop) {
|
|
|
- $botMsg['is_top'] = $isTop;
|
|
|
+ if ($index == 0 && $isTop === true) {
|
|
|
+ // 获取消息ID
|
|
|
+ $messageId = $response->get('message_id');
|
|
|
+ // 置顶消息
|
|
|
+ self::telegram()->pinChatMessage([
|
|
|
+ 'chat_id' => "@{$bettingGroup}",
|
|
|
+ 'message_id' => $messageId
|
|
|
+ ]);
|
|
|
}
|
|
|
- $res[] = $botMsg;
|
|
|
}
|
|
|
- return $res;
|
|
|
}
|
|
|
|
|
|
/**
|