chore: sync branch with main
This commit is contained in:
@@ -38,7 +38,7 @@ pub async fn edit_bot(
|
|||||||
&& data.analytics.is_none()
|
&& data.analytics.is_none()
|
||||||
&& data.interactions_url.is_none()
|
&& data.interactions_url.is_none()
|
||||||
&& data.oauth2.is_none()
|
&& data.oauth2.is_none()
|
||||||
&& data.remove.is_none()
|
&& data.remove.is_empty()
|
||||||
{
|
{
|
||||||
return Ok(Json(v0::BotWithUserResponse {
|
return Ok(Json(v0::BotWithUserResponse {
|
||||||
bot: bot.into(),
|
bot: bot.into(),
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ pub async fn auth(
|
|||||||
return Err(create_error!(IsBot));
|
return Err(create_error!(IsBot));
|
||||||
};
|
};
|
||||||
|
|
||||||
let bot = Reference::from_unchecked(info.client_id.clone())
|
let bot = Reference::from_unchecked(&info.client_id)
|
||||||
.as_bot(db)
|
.as_bot(db)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ pub async fn info(
|
|||||||
return Err(create_error!(IsBot));
|
return Err(create_error!(IsBot));
|
||||||
};
|
};
|
||||||
|
|
||||||
let bot = Reference::from_unchecked(info.client_id.to_string()).as_bot(db).await?;
|
let bot = Reference::from_unchecked(&info.client_id).as_bot(db).await?;
|
||||||
let bot_user = Reference::from_unchecked(bot.id.clone()).as_user(db).await?;
|
let bot_user = Reference::from_unchecked(&bot.id).as_user(db).await?;
|
||||||
let public_bot = bot.clone().into_public_bot(bot_user);
|
let public_bot = bot.clone().into_public_bot(bot_user);
|
||||||
|
|
||||||
let Some(oauth2) = &bot.oauth2 else {
|
let Some(oauth2) = &bot.oauth2 else {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ pub async fn token(
|
|||||||
db: &State<Database>,
|
db: &State<Database>,
|
||||||
info: Form<v0::OAuth2TokenExchangeForm>,
|
info: Form<v0::OAuth2TokenExchangeForm>,
|
||||||
) -> Result<Json<v0::OAuth2TokenExchangeResponse>> {
|
) -> Result<Json<v0::OAuth2TokenExchangeResponse>> {
|
||||||
let bot = Reference::from_unchecked(info.client_id.clone())
|
let bot = Reference::from_unchecked(&info.client_id)
|
||||||
.as_bot(db)
|
.as_bot(db)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user