-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
125 additions
and
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,55 @@ | ||
# Kitsu automatic notifications to Discord webhook | ||
Supports customizable template. | ||
# Kitsu (CGWire) automatic notifications to Discord | ||
This app automatically sends task status notifications from Kitsu tracker to Discord using a simple schedule. Discord messages can be customized via simple template engine (check /tpl dir). | ||
|
||
# Bugs | ||
Assignees - if 1 person he doesn't appear in template (> 1 works fine) | ||
## Quick run | ||
Download the latest version (only Windows for now), fill in conf.toml and run it. | ||
|
||
### Configuration (conf.toml) | ||
#### Basic | ||
| Variables | Description | | ||
| - | - | | ||
| ignoreMessagesDaysOld | Don't parse tasks from Kitsu older that this value (days). | | ||
| threads | Increase value to speed up proccesing parsed data - little to no benefit for now | | ||
| debug | Print Kitsu response data to shell | | ||
| log | Print additional information to shell | | ||
#### Kitsu | ||
| Variables | Description | | ||
| - | - | | ||
| hostname | Kitsu hostname like https://example.com/ - trailing slash is required. | | ||
| email | Kitsu account email - account must have `Studio manager` privileges. | | ||
| password | Account password. | | ||
| skipComments | Comments create overhead - skip them if you don't need them. | | ||
| requestInterval | How often (in minutes) to request data from kitsu and publish it to Discord. | | ||
#### Discord | ||
| Variables | Description | | ||
| - | - | | ||
| embedsPerRequests | How many messages (embeds) are in one post in the chat. 10 maximum | | ||
| RequestsPerMinute | How many posts (with messages) per minute can be made. 50 maximum | | ||
| webhookURL | Discord webhook URL address | | ||
|
||
### Templating (tpl dir) | ||
The Discord message can be changed using the template files found in the `\tpl` directory. | ||
Each file corresponds to a different element in the Discord embedding structure, and each file has access to the following variables: | ||
| Variables | Description | | ||
| - | - | | ||
| `{{.ProjectName}}` | Production name. | | ||
| `{{.ParentName}}` | Task parent name: can be scenes name or asset type name. | | ||
| `{{.TaskName}}` | Task name | | ||
| `{{.TaskType}}` | Task type | | ||
| `{{.CurrentStatus}}` | Current task type status (got from Kitsu) | | ||
| `{{.PreviousStatus}}` | Previous tast type status (got from local database) | | ||
| `{{.CommentContent}}` | Comment message | | ||
| `{{.CommentAuthor}}` | Comment author | | ||
| `{{.EntityType}}` | Entity type name | | ||
|
||
## Compilation | ||
Compilation is straight forward: | ||
```bash | ||
go build -ldflags "-s -w" -o app.exe src/main.go | ||
``` | ||
## Docker | ||
To deploy app via Docker: | ||
1. docker-compose and Traefik is installed | ||
2. Go to `deploy` dir | ||
3. Update `.evn` if needed. | ||
4. `bash run.sh` - exec supplied shell script that will download latest sources, build Docker image and run it via docker-compose. |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Сonfiguration file | ||
|
||
ignoreMessagesDaysOld = 5 # set to 0 to message everything | ||
threads = 12 # small speedup in main loop | ||
debug = false # show kitsu json response | ||
log = true | ||
|
@@ -8,11 +9,10 @@ log = true | |
hostname = "https://example.com/" # trailing slash is mandatory | ||
email = "[email protected]" | ||
password = "123" | ||
skipComments = false # comments creates some overhead for Kitsu database - use with caution | ||
skipComments = true # comments create some overhead for Kitsu database - use with caution | ||
requestInterval = 10 # minutes | ||
|
||
[discord] | ||
embedsPerRequests = 10 # ten is maximum | ||
RequestsPerMinute = 50 # fifty is maximum | ||
ignoreMessagesDaysOld = 1 | ||
webhookURL = "https://discord.com/api/webhooks/123/123456789" |
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
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
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