-
Notifications
You must be signed in to change notification settings - Fork 33
Communicator
Communicator
is a class to support EpicGames's XMPP.
const { Client } = require('epicgames-client');
let client = new Client({
email: 'EMAIL',
password: 'PASSWORD'
});
(async _ => {
if(!await client.init() || !await client.login())
throw 'Error while initialize or login process.';
client.communicator.on('friend:message', async data => {
let author = await client.getProfile(data.account_id);
console.log(author.displayName + ': ' + data.message);
});
/**
* Accepting invitation to Fortnite:
*/
let Fortnite = require('epicgames-fortnite-client');
let fn = await eg.runGame(Fortnite);
fn.communicator.on('party:invitation', invitation => {
invitation.accept();
});
})();
From launcher client (client.communicator
in above example) you can whispering only to PC, NS and mobile players. You have to use fortnite client (fn.communicator
in above exmaple) to whispering to PC, NS, PS, XBOX and mobile players.
Thanks @iXyles for the insight.
-
id [
String
] - user's id -
message [
String
] - message
-
status [
String|Object|null
] (optional) - status is displaying under name on friends list.
Sending request for presence.
-
jid [
JID|String
]
- disconnected
- session:started
- session:ended
- raw:incoming - Using for debugging, is emited while receiving any data.
- raw:outgoing - Using for debugging, is emited while sending any data
- friends - list of friends, is emited after login.
-
friend:added - is emited while you added new friend and he accepted invitation (and vice versa). Returns
Friend
object. -
friend:removed - is emited while your friend has been removed from friends list. Returns
Friend
object. -
friend:status - is emited while your friend updated status. Returns
Communicator/Status
object. -
friend:request - is emited while someone invited you to friends. Returns
FriendRequest
object. -
friend:message is emited while your friend sent you a message. Returns
Communicator/FriendMessage
object.
-
party:invitation - is emited while someone invite you to party. Returns
Communicator/PartyInvitation
object. -
party:invitation:response - is emited e.g. while someone rejected your invitation. Returns
Communicator/PartyInvitationResponse
object. -
party:join:request - is emited while someone wants join into your party. Returns
Communicator/PartyJoinRequest
object. -
party:join:approved - is emited while your join request has been approved. Returns
Communicator/PartyJoinRequestApproved
object. -
party:join:rejected - is emited while your join request has been rejected. Returns
Communicator/PartyJoinRequestRejected
object. -
party:updatepartyconfiguration - is emited while party configuration has been updated. Returns
Communication/PartyUpdateConfirmation
object. -
party:member:joined - is emited while someone (or you) join into party. Returns
Communicator/PartyMemberJoined
object. -
party:member:exited - is emited while someone (or you) exited party. Returns
Communicator/PartyMemberExited
object. -
party:member:promoted - is emited while someone (or you) has been promoted to leader. Returns
Communicator/PartyMemberPromoted
object. -
party:member:data - is emited while you join into party. Contains informations about players (e.g. skins). Returns
Communicator/PartyMemberData
object. -
party:data - is emited while you join into party. Contains informations about party (e.g. playlist). Returns
Communicator/PartyData
object. -
party:query:joinability - is emited while someone wants join into your party. This is query for access to join. Returns
Communicator/PartyQueryJoinability
object. -
party:query:joinability:response - this is response for
party:query:joinability
, is emited while someone answered on yourparty:query:joinability
. Contains informations about permissions to join and reason if you can't join. ReturnsCommunicator/PartyQueryJoinabilityResponse
object. -
party:joinacknowledged - is emited if your
party:join:request
has been approved. ReturnsCommunicator/PartyJoinAcknowledged
object. -
party:joinacknowledged:response - is emited while you approved
party:join:request
. ReturnsCommunicator/PartyJoinAcknowledgedResponse
object.