<?php
namespace App\Services;

class TgMsg
{

    public static function MakeMsg($data){
        $MsgTxt['url'] = "https://api.telegram.org/bot" . $data['token'] . "/sendMessage";
//        $keyb['inline_keyboard'][0][0]['text'] = '点击查询账单';
//        $keyb['inline_keyboard'][0][0]['url'] = 'https://'.$BotUrl.'/bill/' . $data['message_from_id'] . '/' . $data['message_chat_id'] . '/T/Inquiry';
//        $keyb = json_encode($keyb);

        $MsgTxt['text']= self::{'comm_' . $data['comm']}($data);
        return $MsgTxt;

    }

    public static function Comm_1($data) {

    }

    public static function Comm_2($data) {
        $Msg['chat_id'] = $data['chat_id'];
        $Msg['text'] = $data['username'].'-你已经成功充值 '.$data['amount'];

        $Msg['reply_markup'] = json_encode([
            'inline_keyboard' => [[[
                'text' => '查看余额及详情',
                'url' => 'https://test.com'
            ]]]
        ]);
;
        return $Msg;
    }
}
