TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type string or an instance of Buffer, TypedArray, DataView, or KeyObject. Received undefined
[90m at prepareSecretKey (internal/crypto/keys.js:322:11)[39m
[90m at new Hmac (internal/crypto/hash.js:111:9)[39m
[90m at Object.createHmac (crypto.js:147:10)[39m
at Object.exports.generateAuthCode.exports.getAuthCode (C:\Users\user\Desktop\steambot\node_modules\[4msteam-totp[24m\index.js:43:20)
at Object. (C:\Users\user\Desktop\steambot\steambot.js:9:27)
[90m at Module._compile (internal/modules/cjs/loader.js:1063:30)[39m
[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)[39m
[90m at Module.load (internal/modules/cjs/loader.js:928:32)[39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:769:14)[39m
[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)[39m {
code: [32m'ERR_INVALID_ARG_TYPE'[39m
}
== DO NOT PROCEED TO OPEN THIS ISSUE ==
GitHub issues in this repository are for bugs and feature requests ONLY! Please use the dedicated forum instead at https://dev.doctormckay.com/forum/7-node-steam-user/
the original code is it:
const SteamUser = require('steam-user'); const SteamTotp = require('steam-totp'); const config = require('./config.json'); const client = new SteamUser();
const logonOptions = { accoutName: config.username, password: config.password, twoFactorCode: SteamTotp.generateAuthCode(config.shareedSecret)
};
client.logOn(logonOptions);
client.on('loggedOn', () => { console.log(' GarlicBot successfully logged on. '); client.setPersona(SteamUser.EPersonaState.Online); client.gamesPlayed(["Custom Game",440]); });
client.on("friendMessage", function(steamID, message) { if (message == "hi") { client.chatMessage(steamID, "hello! GarlicBot Online!") }
});
and cmd failed to run and send to me this msg.
TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type string or an instance of Buffer, TypedArray, DataView, or KeyObject. Received undefined [90m at prepareSecretKey (internal/crypto/keys.js:322:11)[39m [90m at new Hmac (internal/crypto/hash.js:111:9)[39m [90m at Object.createHmac (crypto.js:147:10)[39m at Object.exports.generateAuthCode.exports.getAuthCode (C:\Users\user\Desktop\steambot\node_modules\[4msteam-totp[24m\index.js:43:20) at Object. (C:\Users\user\Desktop\steambot\steambot.js:9:27)
[90m at Module._compile (internal/modules/cjs/loader.js:1063:30)[39m
[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)[39m
[90m at Module.load (internal/modules/cjs/loader.js:928:32)[39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:769:14)[39m
[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)[39m {
code: [32m'ERR_INVALID_ARG_TYPE'[39m
}
how can i fix it?