Androz2091 / discord-logs

📝Framework that simplify the usage of advanced Discord logs
239 stars 22 forks source link

Cannot use discord-logs with a custom client #173

Closed HunteRoi closed 1 year ago

HunteRoi commented 1 year ago

Hello there!

I created a custom client (that actually extends Discord.Client). I want it to use discord-logs.

import { Client, ClientOptions } from 'discord.js';
import addDiscordLogsFramework from 'discord-logs';

class DatadropClient extends Client {
    constructor(options: ClientOptions) {
        super(options);
        addDiscordLogsFramework(this);
    }
}

Unfortunately, it seems that the library throws a TypeError whenever I try to pass it the this parameter. I receive the following report from my logger:

H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:47
        intents = new discord_js_1.Intents(client.options.intents);
                  ^

TypeError: discord_js_1.Intents is not a constructor
    at H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:47:19
    at step (H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:33:23)
    at Object.next (H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:14:53)
    at H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:4:12)
    at module.exports (H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:41:54)
    at new DatadropClient (H:\git\personal\datadrop\build\src\datadrop.js:67:36)
    at Object.<anonymous> (H:\git\personal\datadrop\build\index.js:30:16)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)

I checked your issues and saw that #171 and #169 talk about it. Both are closed by #172. Unfortunately, no release version has been made. Would it be possible to publish discord-logs@2.2.0 if possible?

MegalithOfficial commented 1 year ago

same issue. I checked the npm but the new version didnt uploaded. I tried npm i git@github.com:Androz2091/discord-logs.git but it didnt work.

ogulcan-dev commented 1 year ago

I have same Issue.

MegalithOfficial commented 1 year ago

I fixed all known issues about v14

MegalithOfficial commented 1 year ago

Use npm i git@github.com:MegalithOffical/discord-logs.git

MegalithOfficial commented 1 year ago

My fork works with v14 without any issues in my tests

ogulcan-dev commented 1 year ago

My fork works with v14 without any issues in my tests

I got error npm ERR! git dep preparation failed

MegalithOfficial commented 1 year ago

Hmh I will check when my electicity comeback.

MegalithOfficial commented 1 year ago

Can you send full error please ?

ogulcan-dev commented 1 year ago

Hmh I will check when my electicity comeback.

I fix error and downloaded what you wrote. Ty <3

HunteRoi commented 1 year ago

@Androz2091 hello there, would it be possible to release 2.2.0 please? It causes delay of some releases of other apps.