forked from discord/hal-9000
Compare commits
No commits in common. "450aca74c2ab11650c0ac160cc0165553b09bd21" and "47c00d90de0f8d178d656d9a50fd2a6eb9d30ba1" have entirely different histories.
450aca74c2
...
47c00d90de
|
|
@ -1407,7 +1407,6 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "manifold"
|
name = "manifold"
|
||||||
version = "8.0.0"
|
version = "8.0.0"
|
||||||
source = "git+https://code.orbiter-radio.uk/discord/manifold.git#a9fb91c7718a5b21310f2c9a196ee66081d72054"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"built",
|
"built",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|
|
||||||
15
Dockerfile
15
Dockerfile
|
|
@ -1,15 +0,0 @@
|
||||||
FROM rust:latest AS builder
|
|
||||||
WORKDIR /usr/src/hal
|
|
||||||
COPY . .
|
|
||||||
RUN cargo install --path .
|
|
||||||
|
|
||||||
FROM debian:bookworm-slim
|
|
||||||
RUN apt-get update && apt-get install -y libpq5 libssl3 && rm -rf /var/lib/apt/lists/*
|
|
||||||
RUN mkdir -pv /srv/hal
|
|
||||||
COPY --from=builder /usr/local/cargo/bin/hal /srv/hal
|
|
||||||
RUN chmod a+x /srv/hal/hal
|
|
||||||
COPY --from=builder /usr/src/hal/config /srv/hal/config
|
|
||||||
COPY --from=builder /usr/src/hal/txt /srv/hal/txt
|
|
||||||
RUN find /srv/hal/
|
|
||||||
WORKDIR /srv/hal
|
|
||||||
CMD ["./hal", "-e", "development"]
|
|
||||||
17
compose.yaml
17
compose.yaml
|
|
@ -1,17 +0,0 @@
|
||||||
services:
|
|
||||||
hal:
|
|
||||||
depends_on:
|
|
||||||
psql:
|
|
||||||
condition: service_started
|
|
||||||
restart: true
|
|
||||||
build: .
|
|
||||||
environment:
|
|
||||||
- DISCORD_TOKEN=${DISCORD_TOKEN}
|
|
||||||
- RUST_LOG=warn
|
|
||||||
psql:
|
|
||||||
image: postgres
|
|
||||||
restart: always
|
|
||||||
# set shared memory limit when using docker compose
|
|
||||||
shm_size: 128mb
|
|
||||||
environment:
|
|
||||||
POSTGRES_PASSWORD: "7ZhUVzr7sxcPEEDMdxfEryW4NTZX5C2ufzZd3r2s25xULgH7FWXJVts"
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
"prefix": "!",
|
"prefix": "!",
|
||||||
"nickname": "Hal 9000",
|
"nickname": "Hal 9000",
|
||||||
"database": {
|
"database": {
|
||||||
"host": "psql",
|
"host": "127.0.0.1",
|
||||||
"user": "postgres",
|
"user": "badgey_development",
|
||||||
"pass": "7ZhUVzr7sxcPEEDMdxfEryW4NTZX5C2ufzZd3r2s25xULgH7FWXJVts",
|
"pass": "7ZhUVzr7sxcPEEDMdxfEryW4NTZX5C2ufzZd3r2s25xULgH7FWXJVts",
|
||||||
"database_name": "postgres",
|
"database_name": "hal_development",
|
||||||
"port": 5432
|
"port": 5432
|
||||||
},
|
},
|
||||||
"channels": {
|
"channels": {
|
||||||
|
|
|
||||||
|
|
@ -42,26 +42,12 @@ async fn randommk(context: ManifoldContext<'_>, count: u32, balance: bool, insid
|
||||||
|
|
||||||
for combo in combos {
|
for combo in combos {
|
||||||
context.send(|c| {
|
context.send(|c| {
|
||||||
c
|
c.embed(|embed| {
|
||||||
.content(format!("{combo_number}. {0}, {1}, {2}, {3}", combo.character, combo.body, combo.tires, combo.glider))
|
|
||||||
.embed(|embed| {
|
|
||||||
embed
|
embed
|
||||||
.url("https://mkrandomizer.awsxdr.com/")
|
.title(format!("{combo_number}. {0}, {1}, {2}, {3}", combo.character, combo.body, combo.tires, combo.glider))
|
||||||
.image(format!("https://mkrandomizer.awsxdr.com/images/characters/{0}.png", combo.character))
|
.image(format!("https://mkrandomizer.awsxdr.com/images/characters/{0}.png", combo.character))
|
||||||
})
|
|
||||||
.embed(|embed| {
|
|
||||||
embed
|
|
||||||
.url("https://mkrandomizer.awsxdr.com/")
|
|
||||||
.image(format!("https://mkrandomizer.awsxdr.com/images/bodies/{0}.png", combo.body))
|
.image(format!("https://mkrandomizer.awsxdr.com/images/bodies/{0}.png", combo.body))
|
||||||
})
|
|
||||||
.embed(|embed| {
|
|
||||||
embed
|
|
||||||
.url("https://mkrandomizer.awsxdr.com/")
|
|
||||||
.image(format!("https://mkrandomizer.awsxdr.com/images/tires/{0}.png", combo.tires))
|
.image(format!("https://mkrandomizer.awsxdr.com/images/tires/{0}.png", combo.tires))
|
||||||
})
|
|
||||||
.embed(|embed| {
|
|
||||||
embed
|
|
||||||
.url("https://mkrandomizer.awsxdr.com/")
|
|
||||||
.image(format!("https://mkrandomizer.awsxdr.com/images/gliders/{0}.png", combo.glider))
|
.image(format!("https://mkrandomizer.awsxdr.com/images/gliders/{0}.png", combo.glider))
|
||||||
})
|
})
|
||||||
}).await?;
|
}).await?;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ impl MarioKartRandomizer {
|
||||||
|
|
||||||
let selection_slice = &scored_combinations[min as usize..max as usize];
|
let selection_slice = &scored_combinations[min as usize..max as usize];
|
||||||
|
|
||||||
for _ in 0..count {
|
for _ in 1..count {
|
||||||
let combo = selection_slice.choose(&mut random).unwrap();
|
let combo = selection_slice.choose(&mut random).unwrap();
|
||||||
result.push(combo.combination.clone());
|
result.push(combo.combination.clone());
|
||||||
}
|
}
|
||||||
|
|
@ -71,7 +71,7 @@ impl MarioKartRandomizer {
|
||||||
get_kart_combinations()
|
get_kart_combinations()
|
||||||
} else {
|
} else {
|
||||||
let stats = get_item_stats();
|
let stats = get_item_stats();
|
||||||
get_kart_combinations().iter().filter(|k| { !stats.bodies[&k.body].inside_drift }).cloned().collect()
|
get_kart_combinations().iter().filter(|k| { stats.bodies[&k.body].inside_drift }).cloned().collect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,6 @@ pub async fn run(arguments: ArgMatches) {
|
||||||
let git_info: String = built_info::GIT_VERSION.unwrap_or("unknown").to_string();
|
let git_info: String = built_info::GIT_VERSION.unwrap_or("unknown").to_string();
|
||||||
let version_string = format!("Hal 9000 Bot version {ver} built at {time} from revision {rev}", ver=built_info::PKG_VERSION, time=built_info::BUILT_TIME_UTC, rev=git_info).to_string();
|
let version_string = format!("Hal 9000 Bot version {ver} built at {time} from revision {rev}", ver=built_info::PKG_VERSION, time=built_info::BUILT_TIME_UTC, rev=git_info).to_string();
|
||||||
|
|
||||||
warn!("HAL Client initialising...");
|
|
||||||
|
|
||||||
let client = match manifold::prepare_client::<HalHandler>(arguments, GatewayIntents::all(), commands::collect_commands(), version_string, MIGRATIONS).await {
|
let client = match manifold::prepare_client::<HalHandler>(arguments, GatewayIntents::all(), commands::collect_commands(), version_string, MIGRATIONS).await {
|
||||||
Ok(c) => c,
|
Ok(c) => c,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|
@ -26,7 +24,5 @@ pub async fn run(arguments: ArgMatches) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
warn!("HAL Client connecting...");
|
|
||||||
|
|
||||||
let _ = client.build().await.unwrap().start().await;
|
let _ = client.build().await.unwrap().start().await;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue