discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.35k stars 3.97k forks source link

Typings out of date. again. #2835

Closed naterchrdsn closed 6 years ago

naterchrdsn commented 6 years ago

Please describe the problem you are having in as much detail as possible: typings are out of date again.

I use both discord.js and commando in my project, written in typescript. For proper usage, I need to use master for both. Whenever there is a new commit, no one tests or updates the typings, so my CI/CD pipeline breaks.

Include a reproducible code sample here, if possible:


tsc

Further details:

naterchrdsn commented 6 years ago

pastebin of the tsc error: https://pastebin.com/WdZXsJma

SpaceEEC commented 6 years ago

Working fine for me with commando and discord.js(, as well as with just discord.js).

bin/index.ts

import { MessageEmbed } from 'discord.js';
import { CommandoClient } from 'discord.js-commando';

const client: CommandoClient = new CommandoClient();

client.on('message', message => {
    message.reply(new MessageEmbed().setDescription('test'));
});

client.login('I am a string, am I now a token?');

tsconfig.json

{
    "compilerOptions": {
        "module": "commonjs",
        "outDir": "bin",
        "target": "esnext",
        "lib": [
            "esnext"
        ],
    },
    "exclude": [
        "node_modules",
        "bin"
    ]
}

Dendencies from the package.json

{
    "@types/node": "^10.9.4",
    "discord.js": "discordjs/discord.js",
    "discord.js-commando": "discordjs/commando",
    "tslint": "^5.11.0",
    "typescript": "^3.0.3"
}

Commit hashes

Command run .\node_modules\.bin\tsc.cmd -p ./

You may want to fix your tone and actually including a reproducible "code sample". This includes here probably:

ShayBox commented 6 years ago

I get this too, I've always had to use ts-node just to get these typings to not yell at me

EDIT: That and akairo imports sqlite which is "optional" but is actually required because it's imported in the typings, so akairo's typings are angery too

ghost commented 6 years ago

that's weird, because I don't get this. i tried on node 10.10.0 and node 8.9.4 and it worked fine for me. my dependencies look the same as space's

    "dependencies": {
        "@types/node": "^10.9.4",
        "tslint": "^5.11.0",
        "typescript": "^3.0.3"
        "discord.js": "discordjs/discord.js",
}
naterchrdsn commented 6 years ago

not sure what's happening. I get the same result on my dev machine, and my build server.

It's fine. I don't have time to get ridiculed by the devs for this.

EDIT (by @SpaceEEC): To have this issue complete, deleted comments from our discord webhook: image

ShayBox commented 6 years ago

yeah same, no idea why I get it, but it prevents me from using normal tsc

iCrawl commented 6 years ago

Requesting you to provide correct information on an issue you have is in no way "ridiculing" you. Stop being so ignorant and if you want help, provide at least the points we want you to provide.

As you do not have time to figure out all of "this", we do not either if no appropriate information is provided.