Skip to content

Commit 65f48e2

Browse files
committed
fix: add action row
1 parent c615ee7 commit 65f48e2

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

api/src/interactions/mod.rs

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ use http::{HeaderMap, StatusCode};
1010
use http_body_util::BodyExt;
1111
use lambda_http::tracing::error;
1212
use once_cell::sync::Lazy;
13+
use reqwest::redirect::Action;
1314
use serde_json::{Value, json};
1415
use tower_http::cors::CorsLayer;
1516
use twilight_model::application::command::CommandType;
1617
use twilight_model::application::interaction::{
1718
Interaction, InteractionContextType, InteractionData, InteractionType,
1819
};
19-
use twilight_model::channel::message::component::{Button, ButtonStyle};
20+
use twilight_model::channel::message::component::{ActionRow, Button, ButtonStyle};
2021
use twilight_model::channel::message::{Component, MessageFlags};
2122
use twilight_model::http::interaction::{
2223
InteractionResponse, InteractionResponseData, InteractionResponseType,
@@ -142,15 +143,17 @@ async fn support() -> Result<Json<Value>, StatusCode> {
142143
kind: InteractionResponseType::ChannelMessageWithSource,
143144
data: Some(InteractionResponseData {
144145
content: Some("Join our support server for more help!".into()),
145-
components: Some(Vec::from([Component::Button(Button {
146-
custom_id: None,
147-
disabled: false,
148-
emoji: None,
149-
label: Some("Koala Support".to_owned()),
150-
style: ButtonStyle::Link,
151-
url: Some("https://discord.gg/5etEjVd".to_owned()),
152-
sku_id: None,
153-
})])),
146+
components: Some(vec![Component::ActionRow(ActionRow {
147+
components: vec![Component::Button(Button {
148+
custom_id: None,
149+
disabled: false,
150+
emoji: None,
151+
label: Some("Koala Support".to_owned()),
152+
style: ButtonStyle::Link,
153+
url: Some("https://discord.gg/5etEjVd".to_owned()),
154+
sku_id: None,
155+
})],
156+
})]),
154157
flags: Some(MessageFlags::EPHEMERAL),
155158
..Default::default()
156159
}),
@@ -173,15 +176,17 @@ async fn verify() -> Result<Json<Value>, StatusCode> {
173176
kind: InteractionResponseType::ChannelMessageWithSource,
174177
data: Some(InteractionResponseData {
175178
content: Some("Verify yourself on our site!".into()),
176-
components: Some(Vec::from([Component::Button(Button {
177-
custom_id: None,
178-
disabled: false,
179-
emoji: None,
180-
label: Some("Koala Verify".to_owned()),
181-
style: ButtonStyle::Link,
182-
url: Some(format!("{url}/verify").to_owned()),
183-
sku_id: None,
184-
})])),
179+
components: Some(vec![Component::ActionRow(ActionRow {
180+
components: vec![Component::Button(Button {
181+
custom_id: None,
182+
disabled: false,
183+
emoji: None,
184+
label: Some("Koala Verify".to_owned()),
185+
style: ButtonStyle::Link,
186+
url: Some(format!("{url}/verify").to_owned()),
187+
sku_id: None,
188+
})],
189+
})]),
185190
flags: Some(MessageFlags::EPHEMERAL),
186191
..Default::default()
187192
}),

0 commit comments

Comments
 (0)