mirror of
https://github.com/Noratrieb/killjoy-turret.git
synced 2026-01-17 08:05:02 +01:00
docker shit
This commit is contained in:
parent
d7901a4fc8
commit
e6414abaf1
5 changed files with 35 additions and 4 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
target/
|
||||||
17
Dockerfile
Normal file
17
Dockerfile
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
#FROM rust:latest as build
|
||||||
|
#RUN sudo apt-get install musl-tools
|
||||||
|
#WORKDIR /app
|
||||||
|
#COPY . ./
|
||||||
|
#RUN rustup target add x86_64-unknown-linux-musl
|
||||||
|
#RUN cargo build --release --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
#COPY --from=build /app/target/x86_64-unknown-linux-musl/release/killjoy_turret /app/killjoy_turret
|
||||||
|
COPY ./target/x86_64-unknown-linux-musl/debug/killjoy_turret /usr/local/bin/killjoy_turret
|
||||||
|
|
||||||
|
COPY ./config.json /app/config.json
|
||||||
|
COPY ./entrypoint.sh /app/entrypoint.sh
|
||||||
|
|
||||||
|
ENV CONFIG_PATH=/app/config.json
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/local/bin/killjoy_turret"]
|
||||||
9
README.md
Normal file
9
README.md
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
needs a config file either with the path of the env var `CONFIG_PATH` or `./config.json`
|
||||||
|
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"token": "<token>",
|
||||||
|
"auto_react": [["keyword", "reaction unicode"]]
|
||||||
|
}
|
||||||
|
```
|
||||||
7
entrypoint.sh
Normal file
7
entrypoint.sh
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
while true ;
|
||||||
|
do
|
||||||
|
/usr/local/bin/killjoy_turret
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
|
@ -21,10 +21,7 @@ pub async fn normal_message(ctx: &Context, msg: &Message) {
|
||||||
let lowercase_content = msg.content.to_lowercase();
|
let lowercase_content = msg.content.to_lowercase();
|
||||||
for (trigger, reaction) in &reactions.auto_react {
|
for (trigger, reaction) in &reactions.auto_react {
|
||||||
if lowercase_content.contains(trigger) {
|
if lowercase_content.contains(trigger) {
|
||||||
if let Err(why) = msg
|
if let Err(why) = msg.react(&ctx.http, ReactionType::Unicode(reaction.clone())).await {
|
||||||
.react(&ctx.http, ReactionType::Unicode(reaction.clone()))
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
eprintln!("Error reacting {}", why);
|
eprintln!("Error reacting {}", why);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue