use Twilio\Twiml;public function welcome(Request $request) { $twiml = new Twiml(); if(isset($request->Digits)){ switch($request->Digits){ case 1: $twiml->say('thank you calling us'); break; default: $twiml->say('You have entered wrong key'); break; } } else{ $gather = $twiml->gather(array('numDigits' => 1)); $gather->say('Thank you for calling us. Press 1 to continue the call.'); } return $twiml; }當我運行這段代碼時,我收到一個錯誤,指出找不到類 Twlio/Twiml。更多詳細信息,您可以查看錯誤的截圖網址(https://prnt.sc/ryz1zw)。提前致謝。
1 回答

拉丁的傳說
TA貢獻1789條經驗 獲得超8個贊
TwiML 不是一個類,您需要VoiceResponse使用say().
require_once './vendor/autoload.php';
use Twilio\TwiML\VoiceResponse;
$response = new VoiceResponse();
$response->say('Chapeau!', ['voice' => 'woman', 'language' => 'fr-FR']);
更多關于他們的文檔。
- 1 回答
- 0 關注
- 79 瀏覽
添加回答
舉報
0/150
提交
取消