Need to try this out
swoosh Build / Check (pull_request) Successful in 36s
Release Tagging / release (pull_request) Successful in 39s
swoosh Build / Rustfmt (pull_request) Successful in 30s
swoosh Build / Test Suite (pull_request) Successful in 35s
swoosh Build / build (pull_request) Successful in 32s
swoosh Build / Clippy (pull_request) Successful in 37s
swoosh Build / Check (pull_request) Successful in 36s
Release Tagging / release (pull_request) Successful in 39s
swoosh Build / Rustfmt (pull_request) Successful in 30s
swoosh Build / Test Suite (pull_request) Successful in 35s
swoosh Build / build (pull_request) Successful in 32s
swoosh Build / Clippy (pull_request) Successful in 37s
This commit is contained in:
+11
-1
@@ -60,7 +60,7 @@ pub async fn send_mssage(
|
|||||||
params.insert("Body", msg.content.as_str());
|
params.insert("Body", msg.content.as_str());
|
||||||
|
|
||||||
let url = format!(
|
let url = format!(
|
||||||
"https://api.twilio.com/2010-04-01/Accounts/ACefa1ef516314c9d1a68cbd657de49277/Messages.json"
|
"https://api.twilio.com/2010-04-01/Accounts/{}/Messages.json", config.account_sid
|
||||||
);
|
);
|
||||||
|
|
||||||
// let client = reqwest::Client::new();
|
// let client = reqwest::Client::new();
|
||||||
@@ -73,6 +73,15 @@ pub async fn send_mssage(
|
|||||||
|
|
||||||
match request.send().await {
|
match request.send().await {
|
||||||
Ok(response) => {
|
Ok(response) => {
|
||||||
|
match response.json::<crate::twilio::api::types::TwilioAPIMessage>().await {
|
||||||
|
Ok(resp) => {
|
||||||
|
Ok(resp)
|
||||||
|
}
|
||||||
|
Err(err) => {
|
||||||
|
Err(std::io::Error::other(err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
match response.text().await {
|
match response.text().await {
|
||||||
Ok(body) => {
|
Ok(body) => {
|
||||||
let mut obj = crate::twilio::api::types::TwilioAPIMessage {
|
let mut obj = crate::twilio::api::types::TwilioAPIMessage {
|
||||||
@@ -85,6 +94,7 @@ pub async fn send_mssage(
|
|||||||
Err(std::io::Error::other(err))
|
Err(std::io::Error::other(err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
Err(err) => Err(std::io::Error::other(err.to_string())),
|
Err(err) => Err(std::io::Error::other(err.to_string())),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user