|
|
@@ -134,7 +134,7 @@ class BaseService
|
|
|
* @param {*string} $image 图片
|
|
|
* @return {*}
|
|
|
*/
|
|
|
- public static function bettingGroupNotice($text ,$keyboard = [], $image = '')
|
|
|
+ public static function bettingGroupNotice($text ,$keyboard = [], $image = '' ,$isTop = false)
|
|
|
{
|
|
|
$bettingGroup = Config::where('field', 'betting_group')->first()->val;
|
|
|
|
|
|
@@ -149,10 +149,21 @@ class BaseService
|
|
|
$botMsg['photo'] = InputFile::create($image);
|
|
|
$botMsg['caption'] = $text;
|
|
|
$botMsg['protect_content'] = true; // 防止转发
|
|
|
- self::telegram()->sendPhoto($botMsg);
|
|
|
+ $response = self::telegram()->sendPhoto($botMsg);
|
|
|
}else{
|
|
|
- self::telegram()->sendMessage($botMsg);
|
|
|
+ $response = self::telegram()->sendMessage($botMsg);
|
|
|
}
|
|
|
+
|
|
|
+ if($isTop == true){
|
|
|
+ // 获取消息ID
|
|
|
+ $messageId = $response->get('message_id');
|
|
|
+ // 置顶消息
|
|
|
+ self::telegram()->pinChatMessage([
|
|
|
+ 'chat_id' => "@{$bettingGroup}",
|
|
|
+ 'message_id' => $messageId
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|