New Version
This commit is contained in:
parent
d5b3f3cff0
commit
a36d88fde1
4 changed files with 68 additions and 24 deletions
21
Dockerfile
Normal file
21
Dockerfile
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# https://www.lpalmieri.com/posts/fast-rust-docker-builds/
|
||||||
|
FROM rust:alpine AS rust
|
||||||
|
RUN apk add musl-dev openssl-dev
|
||||||
|
RUN cargo install cargo-chef
|
||||||
|
WORKDIR app
|
||||||
|
|
||||||
|
FROM rust AS planner
|
||||||
|
COPY . .
|
||||||
|
RUN cargo chef prepare --recipe-path recipe.json
|
||||||
|
|
||||||
|
FROM rust AS builder
|
||||||
|
COPY --from=planner /app/recipe.json recipe.json
|
||||||
|
RUN cargo chef cook --release --recipe-path recipe.json
|
||||||
|
COPY . .
|
||||||
|
RUN cargo build --release --bin obsessed-yanqing
|
||||||
|
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
RUN apk add --no-cache libc6-compat
|
||||||
|
COPY --from=builder /app/target/release/obsessed-yanqing /usr/local/bin
|
||||||
|
ENTRYPOINT [ "/usr/local/bin/obsessed-yanqing" ]
|
|
@ -152,7 +152,7 @@ async fn menu_handler(ctx: Context<'_>, interaction: Arc<MessageComponentInterac
|
||||||
};
|
};
|
||||||
match looping {
|
match looping {
|
||||||
true => {
|
true => {
|
||||||
interaction
|
match interaction
|
||||||
.edit_original_interaction_response(&ctx, |d| {
|
.edit_original_interaction_response(&ctx, |d| {
|
||||||
match character_embed {
|
match character_embed {
|
||||||
None => {}
|
None => {}
|
||||||
|
@ -160,10 +160,13 @@ async fn menu_handler(ctx: Context<'_>, interaction: Arc<MessageComponentInterac
|
||||||
}
|
}
|
||||||
d.content("");
|
d.content("");
|
||||||
d.components(|f| create_character_tabs_button(&mut *f, &character, &tab))
|
d.components(|f| create_character_tabs_button(&mut *f, &character, &tab))
|
||||||
}).await.unwrap();
|
}).await {
|
||||||
|
Ok(_) => {}
|
||||||
|
Err(_) => {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
false => {
|
false => {
|
||||||
interaction
|
match interaction
|
||||||
.create_interaction_response(&ctx, |r| {
|
.create_interaction_response(&ctx, |r| {
|
||||||
r.interaction_response_data(|d| {
|
r.interaction_response_data(|d| {
|
||||||
match character_embed {
|
match character_embed {
|
||||||
|
@ -174,12 +177,19 @@ async fn menu_handler(ctx: Context<'_>, interaction: Arc<MessageComponentInterac
|
||||||
d.ephemeral(true);
|
d.ephemeral(true);
|
||||||
d.components(|f| create_character_tabs_button(&mut *f, &character, &tab))
|
d.components(|f| create_character_tabs_button(&mut *f, &character, &tab))
|
||||||
})
|
})
|
||||||
}).await.unwrap();
|
}).await {
|
||||||
|
Ok(_) => {interaction.delete_followup_message(&ctx, interaction.message.id).await.unwrap();}
|
||||||
|
Err(_) => {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let x = interaction.get_interaction_response(&ctx).await.unwrap().await_component_interaction(&ctx).timeout(Duration::from_secs(10 * 60)).await;
|
let x = match interaction.get_interaction_response(&ctx).await {
|
||||||
|
Ok(x) => {x}
|
||||||
|
Err(_) => return
|
||||||
|
};
|
||||||
|
|
||||||
|
let x = x.await_component_interaction(&ctx).timeout(Duration::from_secs(10 * 60)).await;
|
||||||
|
|
||||||
match x {
|
match x {
|
||||||
None => {}
|
None => {}
|
||||||
|
@ -208,7 +218,6 @@ async fn choice_interaction_handler(ctx: Context<'_>, message: &ReplyHandle<'_>)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let character_string = &interaction.data.values[0];
|
let character_string = &interaction.data.values[0];
|
||||||
let character = get_character_data(character_string.to_string()).await.unwrap();
|
let character = get_character_data(character_string.to_string()).await.unwrap();
|
||||||
menu_handler(ctx, interaction, character, CharacterTab::Home).await;
|
menu_handler(ctx, interaction, character, CharacterTab::Home).await;
|
||||||
|
|
|
@ -352,32 +352,44 @@ pub struct Ratings {
|
||||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct BuildDaum {
|
pub struct BuildDaum {
|
||||||
#[serde(rename = "relic_1")]
|
pub relics: Vec<Relic>,
|
||||||
pub relic_1: String,
|
pub planars: Vec<Planar>,
|
||||||
#[serde(rename = "relic_2")]
|
pub cones: Vec<Cone>,
|
||||||
pub relic_2: String,
|
|
||||||
pub planar: String,
|
|
||||||
#[serde(rename = "cone_1")]
|
|
||||||
pub cone_1: String,
|
|
||||||
#[serde(rename = "cone_2")]
|
|
||||||
pub cone_2: String,
|
|
||||||
#[serde(rename = "cone_3")]
|
|
||||||
pub cone_3: String,
|
|
||||||
#[serde(rename = "cone_4")]
|
|
||||||
pub cone_4: String,
|
|
||||||
#[serde(rename = "cone_5")]
|
|
||||||
pub cone_5: String,
|
|
||||||
#[serde(rename = "cone_6")]
|
|
||||||
pub cone_6: Option<String>,
|
|
||||||
pub body: Vec<Body>,
|
pub body: Vec<Body>,
|
||||||
pub feet: Vec<Foot>,
|
pub feet: Vec<Foot>,
|
||||||
pub rope: Vec<Rope>,
|
pub rope: Vec<Rope>,
|
||||||
pub sphere: Vec<Sphere>,
|
pub sphere: Vec<Sphere>,
|
||||||
pub comments: String,
|
pub comments: String,
|
||||||
pub substats: String,
|
pub substats: String,
|
||||||
|
#[serde(rename = "skill_priority")]
|
||||||
|
pub skill_priority: String,
|
||||||
|
#[serde(rename = "traces_priority")]
|
||||||
|
pub traces_priority: String,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct Relic {
|
||||||
|
pub relic: String,
|
||||||
|
#[serde(rename = "relic_2")]
|
||||||
|
pub relic_2: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct Planar {
|
||||||
|
pub planar: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct Cone {
|
||||||
|
pub cone: String,
|
||||||
|
#[serde(rename = "super")]
|
||||||
|
pub super_field: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct Body {
|
pub struct Body {
|
||||||
|
|
|
@ -2,6 +2,7 @@ mod commands;
|
||||||
mod data;
|
mod data;
|
||||||
mod utils;
|
mod utils;
|
||||||
use poise::serenity_prelude::GatewayIntents;
|
use poise::serenity_prelude::GatewayIntents;
|
||||||
|
use serenity::model::prelude::Activity;
|
||||||
use crate::data::Data;
|
use crate::data::Data;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
@ -18,6 +19,7 @@ async fn main() {
|
||||||
})
|
})
|
||||||
.setup(|ctx, _ready, framework| {
|
.setup(|ctx, _ready, framework| {
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
|
ctx.set_activity(Activity::listening("/character")).await;
|
||||||
poise::builtins::register_globally(ctx, &framework.options().commands).await?;
|
poise::builtins::register_globally(ctx, &framework.options().commands).await?;
|
||||||
Ok(Data {})
|
Ok(Data {})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue