Initial python groundwork

This commit is contained in:
2023-07-27 22:45:53 -04:00
parent dc44c47df1
commit e80ad9680a
4 changed files with 12 additions and 2 deletions

View File

@@ -38,4 +38,8 @@ features = ["json", "rustls-tls"]
[dependencies.diesel] [dependencies.diesel]
version = "2.1.0" version = "2.1.0"
default-features = false default-features = false
features = ["postgres", "32-column-tables", "serde_json", "r2d2", "with-deprecated"] features = ["postgres", "32-column-tables", "serde_json", "r2d2", "with-deprecated"]
[dependencies.pyo3]
version = "0.19.1"
features = ["auto-initialize"]

View File

@@ -21,6 +21,9 @@ build: ## Build the docker image
test: ## Run the docker app as a container test: ## Run the docker app as a container
docker run --env-file .env -it --rm --name siren siren:${SIREN_VERSION} 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 up: ## Start the app
docker compose up -d docker compose up -d

4
build.rs Normal file
View File

@@ -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");
}

View File

@@ -45,7 +45,6 @@ impl EventHandler for Handler {
} }
Err(_) => false 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 { if mentioned || bot_in_thread {
commands::oai::generate_response(&ctx, &msg, oai, &self.pool).await; commands::oai::generate_response(&ctx, &msg, oai, &self.pool).await;
} }