~xenrox/10man-ts3

a30ca1eb688c90286f25b8187c8f7519c6010907 — Thorben Günther 2 years ago 0c84f94
config: Change from dotenv to loading config.json
4 files changed, 6 insertions(+), 22 deletions(-)

M .gitignore
M app.ts
M package-lock.json
M package.json
M .gitignore => .gitignore +1 -1
@@ 1,3 1,3 @@
node_modules/
.env
config.json
app.js

M app.ts => app.ts +5 -6
@@ 1,19 1,18 @@
import { TeamSpeak, QueryProtocol } from "ts3-nodejs-library";
import { GraphQLClient, gql } from "graphql-request";
import dotenv from "dotenv";

type Variables = { [key: string]: any };

dotenv.config();
var config = require("./config.json");

var voter = "";
const teamspeak = new TeamSpeak({
    host: process.env.HOST,
    host: config.host,
    protocol: QueryProtocol.RAW, //optional
    queryport: 10011, //optional
    serverport: 9987,
    username: process.env.USERNAME,
    password: process.env.PASSWORD,
    username: config.username,
    password: config.password,
    nickname: "10Man",
});



@@ 130,7 129,7 @@ function get_error(e: unknown): string {
}

async function request(query: string, variables?: Variables): Promise<any> {
    const endpoint = process.env.ENDPOINT!;
    const endpoint = config.endpoint!;
    const graphQLClient = new GraphQLClient(endpoint, {
        headers: {},
    });

M package-lock.json => package-lock.json +0 -14
@@ 8,7 8,6 @@
            "name": "10man-ts3",
            "version": "1.0.0",
            "dependencies": {
                "dotenv": "^10.0.0",
                "graphql": "^15.7.2",
                "graphql-request": "^3.6.1",
                "ts3-nodejs-library": "^3.4.0"


@@ 92,14 91,6 @@
                "node": ">=0.4.0"
            }
        },
        "node_modules/dotenv": {
            "version": "10.0.0",
            "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
            "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==",
            "engines": {
                "node": ">=10"
            }
        },
        "node_modules/extract-files": {
            "version": "9.0.0",
            "resolved": "https://registry.npmjs.org/extract-files/-/extract-files-9.0.0.tgz",


@@ 278,11 269,6 @@
            "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
            "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
        },
        "dotenv": {
            "version": "10.0.0",
            "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
            "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q=="
        },
        "extract-files": {
            "version": "9.0.0",
            "resolved": "https://registry.npmjs.org/extract-files/-/extract-files-9.0.0.tgz",

M package.json => package.json +0 -1
@@ 13,7 13,6 @@
    "keywords": [],
    "author": "Thorben Günther",
    "dependencies": {
        "dotenv": "^10.0.0",
        "graphql": "^15.7.2",
        "graphql-request": "^3.6.1",
        "ts3-nodejs-library": "^3.4.0"