szymonlisowiec / node-epicgames-client Goto Github PK
View Code? Open in Web Editor NEWUnofficial EpicGames Launcher in javascript.
License: MIT License
Unofficial EpicGames Launcher in javascript.
License: MIT License
I noticed the library sets a default presence that seems to be a bit difficult to override. An option to change the default presence data would be quite helpful, or to disable it from setting it automatically by default.
Also another slight issue, the library sets the status as "Lobby Battle Royale" when it is usually "Battle Royale Lobby".
When initializing a client, I am getting this error:
Error: errors.com.epicgames.common.oauth.unauthorized_client
i am able to receive/send message/DM/Whisper from everyone after accepting the friend requests, but when i send a friend request from ps4 and send message from Ps4 to nodejs client, client is unable to receive those messages. no event gotten in here
launcher.communicator.on('friend:message', async(friendMessage) => {
console.log("msg coming from other people are fine, but i wouldnt run when ps4 guy messages me,i just dnt like him");
}
);
hello I have this error on run my script :
Error: TypeError: Cannot read property 'client_id' of null
at AccountAuth.auth (/root/snipe_bot/node_modules/epicgames-client/src/Accou
nt/Auth.js:89:28)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:18402) UnhandledPromiseRejectionWarning: Error while initialize or login p
rocess.
I have it since the update
to reproduce error just use 2.0.16 version, copy paste main page code of login, one of the promise fails.
Is it possible to add @types/epicgames-client for Typescript compatibility ?
A method to return all friend requests would be helpful. A filtered array of getFriends (including pending) would probably do the trick.
Skins of bot and other invited people dnt appear in party , this only happends if i leave default party created by login and create a new party,
if i dnt leave the default party and invite friends in that party, everything works good
const {EPartyPrivacy} = require('epicgames-client');
const {Launcher} = require('epicgames-client');
const {Party} = Launcher;
const db = require('./db.js');
const EGClient = require('epicgames-client').Client;
const Fortnite = require('epicgames-fortnite-client');
const {ESubGame} = Fortnite;
var discord = require('./discord');
const launcher = new Launcher({
email: '[email protected]',
password: '',
createPartyOnStart: true,
debug: console.log
});
let egClient = new EGClient({
email: '[email protected]',
password: ''
});
(async () => {
if (!await launcher.init() || !await launcher.login()) {
throw new Error('Error while initialize or login process.');
}
console.log(`Logged account's displayName: ${launcher.account.displayName}`);
const app = await launcher.runGame(Fortnite);
launcher.communicator.on('party:invitation', (invitation) => {
console.log("invitation came" + invitation);
(async () => {
await invitation.accept();
})();
});
app.communicator.on('party:invitation', (invitation) => {
console.log("invitation came" + invitation);
(async () => {
await invitation.accept();
})();
});
egClient.init().then(async (success) => {
console.log("Logged in to epic game client");
let partyStatus = await launcher.Party.lookupUser(app, launcher.account.id);
if (partyStatus.current.length > 0) {
console.log("Previous Party found lets leave it");
await app.party.leave();
console.log('You left previous party');
} else {
console.log("No previous party was found")
}
let defaultPartyConfig = {
privacy: EPartyPrivacy.PUBLIC,
joinConfirmation: false,
joinability: 'OPEN',
maxSize: 16,
subType: 'default',
type: 'default',
inviteTTL: 14400,
chatEnabled: true,
};
var party = await launcher.Party.create(app, defaultPartyConfig);
try {
await party.waitForRevision(1);
}
catch (e) {
console.log('exception', e);
}
await party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters/CID_313_Athena_Commando_M_KpopFashion.CID_313_Athena_Commando_M_KpopFashion");
await party.me.setBattlePass(true, 99999999, 99999999, 99999999);
party.updatePresence();
console.log("Party Created");
partyStatus = await launcher.Party.lookupUser(app, launcher.account.id);
if (partyStatus.current.length > 0) {
console.log("Party new created well")
}
partyStatus = await launcher.Party.lookupUser(app, launcher.account.id);
console.log("partystatus", partyStatus);
// app.party.update(partyStatus);
console.log("Presence", launcher.config.autoPresenceUpdating);
party.invite("f7b1a006b3dd47e887cff4d4c481872a");
party.updatePresence();
});
})();
Functionality, like redeeming product codes, rely on graphql queries and mutations. It would be nice to see some kind of abstraction for graphql requests. I could PM you some examples.
https://github.com/SzymonLisowiec/node-epicgames-client/blob/develop/src/Client/index.js#L559
It returns token
with undefined
as value, because the body the request returns is malformed. It contains this error:
I tried using the webbrowser purchase URL instead (https://www.epicgames.com/store/purchase
), but that doesn't work either, because it requires cookies to work.
I have been trying to figure it out myself but I am having trouble. Currently I am stuck on getting the xal when you need to post to https://talon-service-prod.ecosec.on.epicgames.com/v1/init/execute. Any idea how I get the xal? TY. Very cool app!
The login method could automatically pop open a window to confirm the code, and let you solve it before it resolves the promise in order to authenticate properly
Requested at Revadike/epicgames-freebies-claimer#4 by @chaoscreater
Just another suggestion. A method that would be helpful is a hasFriend(id_or_name) method for the client.
Currently the folder .egstore
only stores the cookies of the last used account. If you want to support multiple accounts, you could easily do this by using subfolders by login name. Resolves Revadike/epicgames-freebies-claimer#23
The ability to set the game the account is currently on and will display through it's status would be a nice feature.
With the new update, I have noticed that I get the following error sometimes when a client is initialized:
Cannot get launcher status.
Error: errors.com.epicgames.common.missing_permission
at Client.getLauncherStatus (C:\Discord Bots\Test\node_modules\epicgames-client\src\Client\index.js:409:16)
at process.internalTickCallback (internal/process/next_tick.js:77:7)
The example sample with my own credentials returns
errors.com.epicgames.accountportal.captcha_invalid
Don't know how to bypass that.
Uncaught Promise Error: TypeError: this.stream.sendRequest is not a function
at Communicator.sendMessage (C:\TestBot\node_modules\epicgames-client\src\Communicator\index.js:277:15)
at Communicator.communicator.on (C:\TestBot\index.js:72:26)
at Communicator.emit (events.js:182:13)
at Client.stream.on.stanza (C:\TestBot\node_modules\epicgames-client\src\Communicator\index.js:243:13)
at Client.prototype.emit (C:\TestBot\node_modules\wildemitter\wildemitter.js:117:30)
at Client.<anonymous> (C:\TestBot\node_modules\stanza.io\lib\client.js:91:14)
at Client.prototype.emit (C:\TestBot\node_modules\wildemitter\wildemitter.js:117:30)
at WSConnection.<anonymous> (C:\TestBot\node_modules\stanza.io\lib\client.js:341:18)
at WSConnection.prototype.emit (C:\TestBot\node_modules\wildemitter\wildemitter.js:128:30)
at WSConnection.<anonymous> (C:\TestBot\node_modules\stanza.io\lib\transports\websocket.js:86:14)
TypeError: this.stream.sendRequest is not a function
at Communicator.sendMessage (C:\TestBot\node_modules\epicgames-client\src\Communicator\index.js:277:15)
at Communicator.communicator.on (C:\TestBot\index.js:72:26)
at Communicator.emit (events.js:182:13)
at Client.stream.on.stanza (C:\TestBot\node_modules\epicgames-client\src\Communicator\index.js:243:13)
at Client.prototype.emit (C:\TestBot\node_modules\wildemitter\wildemitter.js:117:30)
at Client.<anonymous> (C:\TestBot\node_modules\stanza.io\lib\client.js:91:14)
at Client.prototype.emit (C:\TestBot\node_modules\wildemitter\wildemitter.js:117:30)
at WSConnection.<anonymous> (C:\TestBot\node_modules\stanza.io\lib\client.js:341:18)
at WSConnection.prototype.emit (C:\TestBot\node_modules\wildemitter\wildemitter.js:128:30)
at WSConnection.<anonymous> (C:\TestBot\node_modules\stanza.io\lib\transports\websocket.js:86:14)
I am receiving the above error when using the code below:
client.egClient = new EpicGamesClient({
email: "email",
password: "password"
});
try {
await client.egClient.init();
await client.egClient.login();
const communicator = client.egClient.communicator;
communicator.on("friend:request", async (data) => {
communicator.sendMessage(data.account_id, "[Debug 1] This is a test message!");
});
} catch (error) {
console.log(error);
}
This happens when you try to run git submodule update on this repo - which incidentally is what npm does when you declare SzymonLisowiec/node-epicgames-client
as a dependency, making the package install fail:
$git submodule update -q --init --recursive
fatal: No url found for submodule path 'docs/.vuepress/dist' in .gitmodules
git rm
on the "ghost" gitlink allows the command to complete successfully and unblocks npm, but you'd have to figure out whether this was actually supposed to be a real submodule which is missing for some reason.
$git rm docs\.vuepress\dist\
A method to return the current status of a single friend would be very helpful, rather than having to listen to the friend:status event which only sends data when a friend's status changes. It would also be good if there could be another method to retrieve the status of multiple friends, similar to getProfiles
getFriendStatus(account_id) - Returns the status of a friend.
getFriendStatuses(account_ids) - Returns the status of multiple friends.
I can't run the script... Help me (I'm new in programming)
Just discovered this repo last night, I suspect this is how people like FNPL and FortniteTracker are making bot accounts. I used to be making a node.js program Konsole with Jaren until he got a c&d from Epic. We did pretty extensive xmpp stuff such as faking being in game, forcing people to ready up, infinite emotes, etc. Obviously forcing ready up won't work on a bot (theoretically) However I think some things like showing status as in the Epic launcher vs in Fortnite and being able to set if it's in game or not would be nice additions.
I want to install node-epicgames-client
on Firebase functions.
The only folder with write permissions is the tmp/
folder.
So I use this config :
const launcher = new Launcher({
email: 'E-MAIL',
password: 'PASSWORD',
store: '/tmp/.egstore',
});
And i have this error :
Error: EROFS: read-only file system, mkdir '/workspace/.egstore'
Not a big issue but getEpicDomains returns [ 'unrealengine.com', 'unrealtournament.com', 'fortnite.com', 'epicgames.com' ]
. There is also epicgamesstore.com
Preferably with multi-stream/multi-connection support.
Any chance you've looked into chat support before?
Just a feature request which I noticed was not currently in. The ability to either accept or deny a received friend request such as through the friend:request event.
Hello, account, what i use for this have email verification, it's here some solution, how login with email verification code? Something like writing email code to script? Thank you and have a nice day
//edit: we talk about it on discord, probably solved, this function will be added probably
While logging in I always get the message "Error while initialize or login process"
(node:23416) UnhandledPromiseRejectionWarning: Error: Error while initialize or login process.
at Object.exports.login ([path]\epic.js:7:13)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:23416) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:23416) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
My code:
const { Launcher } = require('epicgames-client');
const launcher = new Launcher({ email: "email", password: "pass" });
exports.login = async (email, password) => {
if(!await launcher.init() || !await launcher.login()) {
throw new Error('Error while initialize or login process.');
}
console.log(`Logged in as ${launcher.account.name}`);
};
Also, is there any way to get more information on why it failed or something?
Currently, I have this,
async function setPickaxe(member, asset, key, variants) {
await member.meta.setCosmeticLoadout({
pickaxeDef: asset,
pickaxeEKey: key || '',
variants: variants || []
})
}
All that does is set the pickaxe, I want to figure out how to put variants on pickaxes.
Hi Kysune!
Thank you for this wonderful project!
I tried using it to claimer free games at epicgames automatically.
What made me really hard is the code is fixed to use stdin as input to answer prompts (e.g. 2-Factor Code). I can not do it while my server is deployed to the cloud. I hope there is a way to receive a variable as the answer.
Also, I hope the client is able to receive an argument to change the .esstore location.
Thanks again.
Hello,
If I use eg.logout, I take error:
UnhandledPromiseRejectionWarning: errors.com.epicgames.common.oauth
.invalid_token
(node:17474) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). (rejectio
n id: 2)
It would be awesome to add so we can see if a player is online or offline :) Maybe even game status
Unfortunately, everytime I try use updateStatus() it fails. I have tried put strings, no strings, big strings etc. None have set my status correctly.
A method to return the client's display name, and also potentially their account ID if possible would be helpful.
Seems alot easier to understand and easier to use if you could be able to do message.reply()
or invite.accept
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.