This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | action | major | `v2` -> `v3` | --- ### Release Notes <details> <summary>docker/setup-buildx-action (docker/setup-buildx-action)</summary> ### [`v3`](https://github.com/docker/setup-buildx-action/compare/v2...v3) [Compare Source](https://github.com/docker/setup-buildx-action/compare/v2...v3) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMzguMiIsInVwZGF0ZWRJblZlciI6IjM5LjIzOC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: Timo Behrendt <t.behrendt@t00n.de> Co-authored-by: t.behrendt <t.behrendt@noreply.localhost> Reviewed-on: #28 Co-authored-by: Renovate Bot <renovate@t00n.de> Co-committed-by: Renovate Bot <renovate@t00n.de>
65 lines
1.3 KiB
TypeScript
65 lines
1.3 KiB
TypeScript
import { Gotify } from "gotify";
|
|
import { QueryProtocol, TeamSpeak } from "ts3-nodejs-library";
|
|
|
|
import { pino } from "pino";
|
|
|
|
import {
|
|
GOTIFY_TITLE,
|
|
GOTIFY_TOKEN,
|
|
GOTIFY_URL,
|
|
LOG_LEVEL,
|
|
MODE,
|
|
TS3_HOST,
|
|
TS3_NICKNAME,
|
|
TS3_PASSWORD,
|
|
TS3_QUERY_PORT,
|
|
TS3_SERVER_PORT,
|
|
TS3_USERNAME,
|
|
} from "./env";
|
|
import type { Mode } from "./types";
|
|
import { getModes, ts3gotifyFactory } from "./ts3gotify";
|
|
|
|
async function main() {
|
|
const logger = pino({
|
|
level: LOG_LEVEL,
|
|
name: "ts3gotify",
|
|
});
|
|
|
|
const gotify = new Gotify({
|
|
server: GOTIFY_URL,
|
|
});
|
|
|
|
const teamspeak = await TeamSpeak.connect({
|
|
host: TS3_HOST,
|
|
queryport: TS3_QUERY_PORT,
|
|
serverport: TS3_SERVER_PORT,
|
|
protocol: QueryProtocol.RAW,
|
|
username: TS3_USERNAME,
|
|
password: TS3_PASSWORD,
|
|
nickname: TS3_NICKNAME,
|
|
});
|
|
logger.info("connected to TS3");
|
|
|
|
const modeList = getModes(MODE);
|
|
const enabledModeNames = Object.entries(modeList)
|
|
.filter(([, value]) => value)
|
|
.map(([key]) => key);
|
|
|
|
logger.info(`connected to TS3 in modes: ${enabledModeNames.join(", ")}`);
|
|
|
|
const ts3gotify = ts3gotifyFactory(
|
|
teamspeak,
|
|
gotify,
|
|
{
|
|
app: GOTIFY_TOKEN,
|
|
title: GOTIFY_TITLE,
|
|
},
|
|
logger
|
|
);
|
|
|
|
for (const mode of enabledModeNames)
|
|
ts3gotify.registerEventListenerForMode(mode as Mode);
|
|
}
|
|
|
|
main();
|