Compare commits

...

4 Commits

Author SHA1 Message Date
c5cb4eb524 don't serialize empty vecs
All checks were successful
Test Rust project / test (ubuntu-latest, stable) (push) Successful in 2m47s
2024-07-29 12:27:22 -06:00
620b855f1d update deps 2024-07-29 12:27:10 -06:00
da7de4a19e not going to dockerize this 2024-07-29 12:09:39 -06:00
3f3159ba23 git settings updates 2024-07-29 12:09:24 -06:00
6 changed files with 8 additions and 46 deletions

View File

@ -6,7 +6,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable, nightly]
rust: [stable]
steps:
- uses: https://git.oliveratkinson.net/Oliver/setup-rust-action@master

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/target
/.vscode
.env
server.json

2
Cargo.lock generated
View File

@ -935,6 +935,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "poise"
version = "0.6.1"
source = "git+https://github.com/Rushmore75/poise.git?rev=6afaf44a791cd3ff590c89fda26c94b4411b3266#6afaf44a791cd3ff590c89fda26c94b4411b3266"
dependencies = [
"async-trait",
"derivative",
@ -952,6 +953,7 @@ dependencies = [
[[package]]
name = "poise_macros"
version = "0.6.1"
source = "git+https://github.com/Rushmore75/poise.git?rev=6afaf44a791cd3ff590c89fda26c94b4411b3266#6afaf44a791cd3ff590c89fda26c94b4411b3266"
dependencies = [
"darling",
"proc-macro2",

View File

@ -1,15 +0,0 @@
# Build the execuitible
FROM rustlang/rust:nightly as builder
ENV RUSTFLAGS=""
WORKDIR /bot
COPY . .
RUN cargo build --release
# Now make the runtime container
FROM debian:bookworm-slim
COPY --from=builder /bot/target/release/discord_egress /usr/local/bin/discord_egress
COPY Cargo.lock /
CMD ["/usr/local/bin/discord_egress"]

View File

@ -1,30 +0,0 @@
version: '3.1'
name: discord-egress
services:
bot:
container_name: discord-egress_bot
build: https://git.oliveratkinson.net/Oliver/discord-egress.git
restart: always
environment:
# These will read from the .env file
DISCORD_INTENTS: ${DISCORD_INTENTS}
DISCORD_TOKEN: ${DISCORD_TOKEN}
DISCORD_ID: ${DISCORD_ID}
networks:
- external
- internal
redis:
container_name: discord-egress_redis
image: redis
restart: always
ports:
- 6379:6379
networks:
- internal
networks:
internal:
driver: bridge
internal: true
external:
driver: bridge

View File

@ -10,14 +10,18 @@ use tracing::{debug, error, info, trace};
#[derive(Serialize)]
struct Server {
channels: Vec<Channel>,
#[serde(skip_serializing_if = "Vec::is_empty")]
orphanage: Vec<GuildChannel>,
#[serde(skip_serializing)]
needs_clean: bool,
}
#[derive(Serialize)]
struct Channel {
this: GuildChannel,
#[serde(skip_serializing_if = "Vec::is_empty")]
children: Vec<Channel>,
#[serde(skip_serializing_if = "Vec::is_empty")]
messages: Vec<Message>,
}