torikushiii / hoyolab-auto

Auto check-in and others for any Hoyoverse games
https://ko-fi.com/torikushiii
GNU Affero General Public License v3.0
84 stars 18 forks source link

Weebhook URL is being asked even though I am configuring application as a discord bot #2

Closed AleytiaFairlight closed 4 months ago

AleytiaFairlight commented 4 months ago

I am being asked for a webhook url even though webhooks are disabled in the config image image

torikushiii commented 4 months ago

Yes, that's how the current system work for now since it need to send notifications via webhook.

I'm currently working on it so it can send notification using discord if you have webhook disabled and discord enabled

AleytiaFairlight commented 4 months ago

Alright, I disabled discord and enabled webhooks, I'm getting the same error I believe image Here is the config I'll just reset the webhook later image

torikushiii commented 4 months ago

It seems that it still read the URL as the default config, not the new config.

Did you use default.config.js or renamed it into config.js ?

AleytiaFairlight commented 4 months ago

ohh I created my own config.js changing the name of or removing default.config..js results in this error however

image

Renaming config.js to default.config.js results in the same error which is odd

torikushiii commented 4 months ago

Interesting, I've trying to replicate the error and no luck.

could you change and modify index.js at line 21

https://github.com/torikushiii/hoyolab-auto/blob/67bf7918753731fe8ec2f5aaef2542cf05923984/index.js#L13-L24

to

let config;
try {
    config = require("./config.js");
}
catch (e) {
    console.log(e);
    try {
        config = require("./default.config.js");
    }
    catch (e) {
        console.log(e);
        throw new Error({ message: "No default or custom configuration found." });
    }
}
AleytiaFairlight commented 4 months ago

as expected from the change here you go image also did a fresh clone of the repo and same result

torikushiii commented 4 months ago

Sorry, did a few comment on my comment you'll need to add

let config;
try {
    config = require("./config.js");
}
catch (e) { <-- this
    console.log(e); <-- and this
    try {
        config = require("./default.config.js");
    }
    catch (e) { -- same as above
        console.log(e);
        throw new Error({ message: "No default or custom configuration found." });
    }
}
AleytiaFairlight commented 4 months ago

I actually fixed the problem I apologize I was wondering why the checkin tag was not set in the config so I added it image now however when I remove it it throws an error as there are no flags for honkai image

torikushiii commented 4 months ago

now that's my fault for not checking it properly, current one is still checking whether dailiesCheck or weekliesCheck exist or not, you can copy this object and it should fixed it

{
    cookie: {
        ltoken: "",
        ltuid: ""
    },
    dailiesCheck: false,
    weekliesCheck: false,
    stamina: {
        check: false,
        threshold: 150,
        persistent: false
    },
    expedition: {
        check: false,
        persistent: false
    }
}
AleytiaFairlight commented 4 months ago

alright no more errors apart frin this

image

but I fixed it by removing the second account