Skip to content

Commit 005c428

Browse files
committed
chore: update the /verify command with more details how to
1 parent 5c1f04b commit 005c428

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

api/src/guilds/verify/controllers.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::AppState;
44
use axum::{Extension, Json};
55
use axum::routing::{post, put};
66
use http::StatusCode;
7-
use lambda_http::tracing::info;
87
use serde::{Deserialize, Serialize};
98
use serde_json::{Value, json};
109
use tower_http::cors::CorsLayer;

api/src/interactions/mod.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use twilight_model::application::interaction::{
1717
Interaction, InteractionContextType, InteractionData, InteractionType,
1818
};
1919
use twilight_model::channel::message::component::{ActionRow, Button, ButtonStyle};
20-
use twilight_model::channel::message::{Component, MessageFlags};
20+
use twilight_model::channel::message::{Component, EmojiReactionType, MessageFlags};
2121
use twilight_model::http::interaction::{
2222
InteractionResponse, InteractionResponseData, InteractionResponseType,
2323
};
@@ -184,19 +184,25 @@ async fn verify() -> Result<Json<Value>, StatusCode> {
184184
Ok(Json(json!(InteractionResponse {
185185
kind: InteractionResponseType::ChannelMessageWithSource,
186186
data: Some(InteractionResponseData {
187-
content: Some("Verify yourself on our site!".into()),
187+
content: Some("# How To
188+
1. Go to Koala Verify with the link below and log in with your discord account
189+
2. Click `+ Add` and choose between the email linking options
190+
3. Click to enable a link with a server
191+
192+
# FAQ
193+
**Q: Continue with Microsoft 'Required Approval'**
194+
A: Koala requires approval from some IT administrators, you can use the `other` option and enter your email manually instead.".into()),
188195
components: Some(vec![Component::ActionRow(ActionRow {
189196
components: vec![Component::Button(Button {
190197
custom_id: None,
191198
disabled: false,
192-
emoji: None,
199+
emoji: Some(EmojiReactionType::Unicode {name: "🔗".to_owned()}),
193200
label: Some("Koala Verify".to_owned()),
194201
style: ButtonStyle::Link,
195202
url: Some(format!("{url}/verify").to_owned()),
196203
sku_id: None,
197204
})],
198205
})]),
199-
flags: Some(MessageFlags::EPHEMERAL),
200206
..Default::default()
201207
}),
202208
})))

api/src/users/link_guilds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async fn put_link_guilds_id(
3434
let new_link_guild = LinkGuild {guild_id,enabled: true};
3535

3636
let mut user = User::from_db(&user_id.to_string(), &app_state.dynamo).await.unwrap();
37-
if user.link_guilds.iter().any(|g| g.guild_id == guild_id && g.enabled == false) {
37+
if user.link_guilds.iter().any(|g| g.guild_id == guild_id && !g.enabled) {
3838
// Already exists
3939
return Ok(Json(json!(new_link_guild)));
4040
}

api/src/users/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use regex::Regex;
22
use crate::users::models::Link;
33

4-
pub fn link_arr_match(links: &Vec<Link>, pattern: &str) -> bool {
4+
pub fn link_arr_match(links: &[Link], pattern: &str) -> bool {
55
let regex = Regex::new(pattern).unwrap();
66
links.iter().any(|l| l.active && regex.is_match(&l.link_address))
77
}

0 commit comments

Comments
 (0)