-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added language support for notifications, and also fixed the footer t…
…hat wasn't working. Improved readme
- Loading branch information
Showing
5 changed files
with
124 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# minecraft-discord-webhook | ||
A small, server agnostic, way to push your server updates to Minecraft | ||
|
||
![image](https://user-images.githubusercontent.com/23201434/120118752-7e06c880-c16a-11eb-84fb-cce9fb123b38.png) | ||
|
||
This script will push your easily push: | ||
- Server joins and leaves | ||
- Deaths | ||
- Advancements, challenges and goals | ||
|
||
to a Discord Webhook easily, with minimal configuration, and without needing server-side mods or plugins such as Spigot, Paper, etc (although it works with those servers as well!), meaning it also works with a vanilla server. | ||
|
||
This script works by reading your server log file, parsing and formatting it using Discord rich embeds, and pushing it to the webhook endpoint. | ||
|
||
## Usage | ||
|
||
### With Docker: | ||
|
||
There's an image avaible on [Docker Hub](https://hub.docker.com/r/saadbruno/minecraft-discord-webhook)! | ||
|
||
#### Docker run: | ||
`docker run --name minecraft-discord-webhook -v /path/to/server/logs/latest.log:/app/latest.log:ro --env WEBHOOK_URL=https://discord.com/api/webhooks/111222333/aaabbbccc --env FOOTER=Optional\ Footer\ Text --env LANGUAGE=en-US saadbruno/minecraft-discord-webhook:latest` | ||
> Note: FOOTER and LANGUAGE are optional | ||
#### Docker Compose: | ||
``` | ||
version: '3.3' | ||
services: | ||
minecraft-discord-webhook: | ||
container_name: minecraft-discord-webhook | ||
volumes: | ||
- '/path/to/server/logs/latest.log:/app/latest.log:ro' | ||
environment: | ||
- 'WEBHOOK_URL=https://discord.com/api/webhooks/111222333/aaabbbccc' | ||
- 'FOOTER=Optional Footer Text' | ||
- 'LANGUAGE=en-US' | ||
image: 'saadbruno/minecraft-discord-webhook:latest' | ||
restart: unless-stopped | ||
``` | ||
> Note: FOOTER and LANGUAGE are optional | ||
### Without Docker: | ||
- Clone the repo | ||
- run `WEBHOOK_URL=<discord webhook> SERVERLOG=</path/to/server/log/latest.log> FOOTER=<optional footer> LANGUAGE=<optional language> ./minecraft-discord.webook.sh` | ||
|
||
## Variables: | ||
|
||
- WEBHOOK_URL: it's the discord webhook you want the notifications posted to. Read more at [Discord Support](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) | ||
- LANGUAGE: The language of the notifications. This only supports joins and leaves. Advancements and death messages are posted "as is", meaning they'll be posted using the language of your server. Check the [lang directory](https://github.com/saadbruno/minecraft-discord-webhook/tree/main/lang) for currently supported languages. Contributions are welcome! | ||
- FOOTER: An optional footer text that will be included with the notifications, you can put your server name, server address or anything else. You can also ommit this for a more compact notification. | ||
![image](https://user-images.githubusercontent.com/23201434/120119109-44cf5800-c16c-11eb-9ce1-8927629c805f.png) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
JOIN="$PLAYER joined the game!" | ||
LEAVE="$PLAYER left the game... :(" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
JOIN="$PLAYER entrou no servidor!" | ||
LEAVE="$PLAYER saiu do servidor... :(" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters