Compare commits

...

7 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
c4b68a130e add clippy
All checks were successful
Test Rust project / test (ubuntu-latest, nightly) (push) Successful in 2m47s
Test Rust project / test (ubuntu-latest, stable) (push) Successful in 2m44s
2024-07-29 08:57:47 -06:00
f74cca0083 Merge branch 'main' of https://git.oliveratkinson.net/Oliver/discord-egress 2024-07-29 08:56:28 -06:00
88dff426b1 use custom poise fork until it gets updated 2024-07-29 08:55:56 -06:00
7 changed files with 12 additions and 54 deletions

View File

@@ -6,18 +6,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable, nightly]
rust: [stable]
steps:
- uses: https://git.oliveratkinson.net/Oliver/setup-rust-action@master
with:
rust-version: ${{ matrix.rust }}
- name: var
run: echo $GITEA_PATH
- uses: actions/checkout@master
- name: Env display
run: echo $PATH
- name: which
run: which cargo
- name: Run tests
run: cargo test --verbose
- name: Clippy
run: cargo clippy

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

@@ -10,8 +10,7 @@ edition = "2021"
[dependencies]
tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread"] }
# songbird = { version = "0.3.2", features = ["yt-dlp"] }
poise = { version = "0.6", features = ["cache"], path="../poise" }
poise = { features = ["cache"], git="https://github.com/Rushmore75/poise.git", rev="6afaf44a791cd3ff590c89fda26c94b4411b3266" }
dotenv = "0.15.0"
anyhow = "1.0.75"
once_cell = "1.19.0"

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>,
}