Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0d6cb00
ci: remove shuttle job
c-git Feb 1, 2026
b61cca8
docs: save todo for future improvement
c-git Feb 1, 2026
0e37dbc
feat: decrease heartbeat frequency
c-git Feb 1, 2026
56fa173
refactor: pull out database code
c-git Feb 1, 2026
ffe84f9
feat: impl save to file
c-git Feb 1, 2026
7a746b3
feat: remove env file from sqlx
c-git Feb 1, 2026
cbcbf07
chore: add ignore for .env
c-git Feb 1, 2026
17ff9aa
feat: replace secret store
c-git Feb 1, 2026
2652aa7
feat: remove shuttlers dependencies
Feb 2, 2026
9f3f716
refactor: reduce tokio to only needed features
c-git Feb 3, 2026
ca65fd5
ci: update to run on pull requests
c-git Feb 3, 2026
3beebf6
style: apply rustfmt
c-git Feb 3, 2026
c8c3809
refactor: upgrade version of clap
c-git Feb 4, 2026
65788b4
Merge pull request #10 from mxttc/develop
c-git Feb 4, 2026
94b405e
Release prep (#11)
c-git Feb 4, 2026
7dfe3ac
docs: remove shuttle specific tasks
c-git Feb 4, 2026
adf10a5
chore: version bump
c-git Feb 4, 2026
ff090d7
Merge branch 'main' into develop
c-git Feb 4, 2026
5dae418
chore: update resolved issues
c-git Feb 4, 2026
6dba914
chore: add todo to remove the expect and unwraps
c-git Feb 4, 2026
ddcfe5b
chore: remove old shuttle config file
c-git Feb 4, 2026
ba1d477
fix: make registration_guild_id optional
c-git Feb 4, 2026
d28a91d
chore: add todo for new way to determine prod
c-git Feb 4, 2026
1e2927e
feat: add new way to detect production run
c-git Feb 4, 2026
f6f73b3
feat: remove unnecessary panics
c-git Feb 4, 2026
1a2615a
chore: version bump
c-git Feb 4, 2026
bf38b08
chore: Merge branch 'main' into develop
c-git Feb 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bazooka-bot"
version = "0.7.0"
version = "0.7.1"
edition = "2024"
publish = false

Expand Down
1 change: 0 additions & 1 deletion Shuttle.toml

This file was deleted.

1 change: 0 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ ignore = [
# "RUSTSEC-0000-0000",
# { id = "RUSTSEC-0000-0000", reason = "you can specify a reason the advisory is ignored" },
{ id = "RUSTSEC-2024-0388", reason = "Tracking issue https://github.com/serenity-rs/poise/issues/334" },
{ id = "RUSTSEC-2025-0057", reason = "Tracking issue https://github.com/serenity-rs/serenity/issues/3420" },
]
13 changes: 7 additions & 6 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ impl StartupConfig {
pub fn try_new(clap_config: &ClapConfig) -> anyhow::Result<Self> {
let guild_id = clap_config
.registration_guild_id
.parse::<u64>()
.context("failed to parse guild id")
.map(GuildId::new)?;
.as_ref()
.map(|x| x.parse::<u64>().map(GuildId::new))
.transpose()
.context("failed to parse guild id")?;

// TODO 4 - See if we can split this in clap
// TODO 5 - See if we can split this in clap
let owners: HashSet<UserId> = clap_config
.owners
.split(',')
Expand All @@ -41,10 +42,10 @@ impl StartupConfig {
})
.collect::<anyhow::Result<HashSet<UserId>>>()?;

let is_production = std::env::var("SHUTTLE").is_ok();
let is_production = std::env::var("IS_PROD").is_ok();

Ok(Self {
registration_guild_id: Some(guild_id),
registration_guild_id: guild_id,
owners,
is_production,
})
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub struct ClapConfig {

/// Used mostly for testing to register the commands directly for the guild
#[arg(long, env = "REGISTRATION_GUILD_ID")]
pub registration_guild_id: String,
pub registration_guild_id: Option<String>,

/// The RoleId of the role that can run privileged commands
#[arg(long, env = "AUTH_ROLE_ID")]
Expand Down
22 changes: 13 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use anyhow::Context as _;
use anyhow::{Context as _, bail};
use bazooka_bot::{ClapConfig, Data, SharedConfig, StartupConfig, commands_list, heartbeat};
use poise::serenity_prelude::{ClientBuilder, GatewayIntents};
use secrecy::ExposeSecret;
Expand All @@ -14,7 +14,7 @@ use version::version;
use clap::Parser;

#[tokio::main]
async fn main() {
async fn main() -> anyhow::Result<()> {
tracing_subscriber::registry()
.with(fmt::layer().with_span_events(FmtSpan::NEW | FmtSpan::CLOSE))
.with(
Expand All @@ -27,14 +27,17 @@ async fn main() {

// Load setup values
info!("Loading environment variables");
loadenv::load().expect("failed to load .env file");
match loadenv::load() {
Ok(was_found) => debug!(".env file was found: {was_found}"),
Err(err_msg) => bail!("failed to load .env file: {err_msg:?}"),
}
let clap_config = ClapConfig::parse();
debug!("ClapConfig: {:?}", clap_config);

let startup_config =
StartupConfig::try_new(&clap_config).expect("failed to create setup config");
StartupConfig::try_new(&clap_config).context("failed to create setup config")?;
let shared_config =
SharedConfig::try_new(&clap_config).expect("failed to created shared_config");
SharedConfig::try_new(&clap_config).context("failed to created shared_config")?;
let discord_token = clap_config.discord_token;

let framework = poise::Framework::builder()
Expand Down Expand Up @@ -101,9 +104,10 @@ async fn main() {
)
.framework(framework)
.await
.expect("Error creating client");
.context("Error creating client")?;

if let Err(why) = client.start().await {
error!("Client error: {why:?}");
}
client
.start()
.await
.context("failed to start discord client")
}