Multivit4min / TS3-NodeJS-Library

TeamSpeak 3 Server Query Library supports SSH and RAW Query
https://multivit4min.github.io/TS3-NodeJS-Library/
MIT License
149 stars 20 forks source link

"invalid serverID" while connecting to the server #172

Closed Ronak0020 closed 2 years ago

Ronak0020 commented 2 years ago

Hello there! I am kinda new to this so idk what I am doing wrong but I am having issue with connecting my bot with the teamspeak server. Whenever I try to connect without serverport, it doesn't work and when I add the serverport (serverport: 9987) it says "invalid serverID" It worked fine in my other vps server but it is not the same in this one.

Does that mean the server port is incorrect? If so, how can I get the serverport? Thank you. I hope I get an answer soon 😄

Multivit4min commented 2 years ago

You can see the server port in your clients teamspeak log when you connect to the teamspeak server. Also check that you got the correct IP Address.

Ronak0020 commented 2 years ago

image Is this the server port? 9987 If so, it is not working~ If not, then what is? @Multivit4min

Multivit4min commented 2 years ago

Can you provide a Code with which I can try to reproduce it?

Multivit4min commented 2 years ago

If you connect via standard telnet to that IP Address and select the port 9987 then you still receive that error, so you probably got the wrong port there

Ronak0020 commented 2 years ago

Can you provide a Code with which I can try to reproduce it?

Here. Trying to make a bot for discord which logs activity from teamspeak. This is teamspeak.js file and in index.js file, I just called this function using require("./teamspeak.js")(client)


const { TeamSpeak, QueryProtocol } = require("ts3-nodejs-library");
const config = require("../config.json");

module.exports = async (client) => {
    return new TeamSpeak({
        host: "45.43.24.154",
        protocol: QueryProtocol.RAW,
        // readyTimeout: 15000,
        queryport: 10011,
        serverport: 9987,
        // username: "Ronka's admin bot",
        // nickname: "Ronka's NodeJS Bot"
    })
        .on("ready", () => {
            console.log("Connected to teamspeak");
        })
        .on("error", (error) => {
            console.log(error);
        })
        .on("clientconnect", async (joiner) => {
            if (!config.teamspeakBanned.includes(joiner.client.uniqueIdentifier)) {
                client.channels.cache.get(config.logChannel).send({
                    embeds: [client.utils.generateEmbed({
                        description: `**Member Joined**
        **User :** ${joiner.client.nickname}`
                    })]
                });
            }
            console.log(joiner);
        })
      }
Ronak0020 commented 2 years ago

It isn't logging "connected to teamspeak" as well cuz it is unable to login to the server and says invalid serverID

Multivit4min commented 2 years ago

seems alright to me, when connecting manually via a telnet software you get the same error so you just got your serverport wrong, ask your server provider for the right port

i will close this issue as it is not an issue with the library itself

image