feat: move to discord-mc-cat
This commit is contained in:
parent
9009c2e2af
commit
f135eeaf73
2 changed files with 36 additions and 19 deletions
|
|
@ -5,31 +5,45 @@ let
|
|||
in
|
||||
{
|
||||
systemd.services.minecraft-discord-config = {
|
||||
description = "Inject Discord bot token into Discord4Fabric config";
|
||||
description = "Inject Discord bot token into Discord-MC-Chat config";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
before = [ "docker-minecraft.service" ];
|
||||
after = [ "agenix.service" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = pkgs.writeShellScript "setup-discord4fabric" ''
|
||||
CONFIG_DIR="${mcDataDir}/config/discord4fabric"
|
||||
mkdir -p "$CONFIG_DIR"
|
||||
ExecStart = pkgs.writeShellScript "setup-discord-mc-chat" ''
|
||||
set -euo pipefail
|
||||
|
||||
CONFIG_FILE="${mcDataDir}/config/discord-mc-chat.json"
|
||||
mkdir -p "${mcDataDir}/config"
|
||||
|
||||
TOKEN=$(cat ${config.age.secrets.discord-bot-token.path})
|
||||
|
||||
cat > "$CONFIG_DIR/config.json" <<EOF
|
||||
# Admin Discord IDs: jet, z, edward
|
||||
cat > "$CONFIG_FILE" <<EOF
|
||||
{
|
||||
"botToken": "$TOKEN",
|
||||
"guildId": "849685154543960085",
|
||||
"channelId": "1482269524571979899",
|
||||
"chatMessageFormat": "**%player%** > %message%",
|
||||
"joinFormat": "%player% joined the server",
|
||||
"leaveFormat": "%player% left the server",
|
||||
"deathFormat": "%message%",
|
||||
"advancementFormat": "%player% has made the advancement **%advancement%**",
|
||||
"discordToMinecraftFormat": "[Discord] <%user%> %message%"
|
||||
"generic": {
|
||||
"botToken": "$TOKEN",
|
||||
"channelId": "1482486447591391285",
|
||||
"consoleLogChannelId": "1482487413153464330",
|
||||
"useWebhook": true,
|
||||
"announceServerStartStop": true,
|
||||
"announcePlayerJoinLeave": true,
|
||||
"announceDeathMessages": true,
|
||||
"announceAdvancements": true,
|
||||
"broadcastChatMessages": true,
|
||||
"adminsIds": [
|
||||
"1008533670426050704",
|
||||
"839601350865584158",
|
||||
"373272898368176129"
|
||||
]
|
||||
},
|
||||
"multiServer": {
|
||||
"enable": false
|
||||
}
|
||||
}
|
||||
EOF
|
||||
chmod 600 "$CONFIG_FILE"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue