diff --git a/Cargo.toml b/Cargo.toml index be626fc..dd6eed2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,4 +38,8 @@ features = ["json", "rustls-tls"] [dependencies.diesel] version = "2.1.0" default-features = false -features = ["postgres", "32-column-tables", "serde_json", "r2d2", "with-deprecated"] \ No newline at end of file +features = ["postgres", "32-column-tables", "serde_json", "r2d2", "with-deprecated"] + +[dependencies.pyo3] +version = "0.19.1" +features = ["auto-initialize"] diff --git a/Makefile b/Makefile index 1138d49..7898510 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,9 @@ build: ## Build the docker image test: ## Run the docker app as a container docker run --env-file .env -it --rm --name siren siren:${SIREN_VERSION} +db: ## Start the docker database + docker compose up -d db + up: ## Start the app docker compose up -d diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..3e40437 --- /dev/null +++ b/build.rs @@ -0,0 +1,4 @@ +fn main() { + let home = std::env::var("HOME").expect("${HOME} is missing"); + println!("cargo:rustc-env=LD_LIBRARY_PATH={home}/.pyenv/versions/3.11.4/lib"); +} \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 4d1c851..5ec5ef0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,7 +45,6 @@ impl EventHandler for Handler { } Err(_) => false }; - // let has_bot = msg.channel_id.get_thread_members(&ctx.http).await.unwrap().contains(ctx.cache.current_user_id().0); if mentioned || bot_in_thread { commands::oai::generate_response(&ctx, &msg, oai, &self.pool).await; }