yuniteapi.js is a node.js API wrapper for Yunite allowing you to easily interact with their API.
To install yuniteapi.js, run the following command into your terminal from your bot folder:
Install yuniteapi.js:
npm install yuniteapi.js
const YuniteAPI = require('yuniteapi.js');
const Yunite = new YuniteAPI('Yunite API Key', 'Guild ID');
Yunite.registrationData(['array of user Ids']).then((result => console.log(result)));
- registrationData(['array of user Ids']) - Access registration data of a guild and know which Discord user is linked to which Epic user.
- addPlayerToQueue(userId) - Join a player into a custom game
- blockUser(userId, options) - Block a user from using Yunite on provided guild
- blockEpic(epicId, options) - Block an epic account from using Yunite on provided guild
- unblockUser(userId) - Unblock a user from Yunite on provided guild
- unblockEpic(epicId) - Unblock an epic account from Yunite on provided guild
- listTournaments() - Get list of tournaments
- tournamentLeaderboards(tournamentId) - Get leaderboard of tournament
- tournamentMatches(tournamentId) - Get list of matches in tournament
- sessionLeaderboard(tournamentId, sessionId) - Get leaderboard of single match
- acssStatistics(from, to) - Get ACSS statistics from Yunite on a provided guild
- singleTournament() - Get a single tournament
- listAllTournamentTeams(tournamentId) - Get all teams in a tournament
- epicRegistrationData(['array of user Ids']) - Access registration data of a guild and know which Epic user is linked to which Discord user.
- addTeamToTournament(tournamentId, epicId, discordId) - Add team to a tournament (only one of Epic or Discord Id needed)
- disqualifyTeamFromTournament(teamId, tournamentId) - Disqualifty a team from a tournament
- updateTeam(teamId, tournamentId, players) - Update players in a team in a tournament
Access registration data of a guild and know which Discord user is linked to which Epic user.
Yunite.registrationData(['123456789123456789', '987654321987654321']).then((result => console.log(result)));
Join a player into a custom game
Yunite.addPlayerToQueue('123456789123456789').then((result => console.log(result)));
Block a user from using Yunite on provided guild
Yunite.blockUser('123456789123456789', { reason: 'Test', blockLinkedEpic: true }).then((result => console.log(result)));
Block an epic account from using Yunite on provided guild
Yunite.blockEpic('epicId', { reason: 'Test', blockLinkedUser: true }).then((result => console.log(result)));
Unblock a user from Yunite on provided guild
Yunite.unblockUser('123456789123456789').then((result => console.log(result)));
Unblock an epic account from Yunite on provided guild
Yunite.unblockEpic('epicId').then((result => console.log(result)));
Get list of tournaments
Yunite.listTournaments().then((result => console.log(result)));
Get leaderboard of tournament
Yunite.tournamentLeaderboards('bd4e8807-629f-4820-9207-13d899e76a67').then((result => console.log(result)));
Get list of matches in tournament
Yunite.tournamentMatches('bd4e8807-629f-4820-9207-13d899e76a67').then((result => console.log(result)));
Get leaderboard of single match
Yunite.tournamentMatches('bd4e8807-629f-4820-9207-13d899e76a67', '56acd6f7627a4763b1b38c58f3fe5169').then((result => console.log(result)));
Get ACSS statistics from Yunite on a provided guild, optional from and to dates (UNIX-timestamp)
Yunite.acssStatistics(1000, 2000).then((result => console.log(result)));
Get single tournmanet by ID
Yunite.singleTournament('bd4e8807-629f-4820-9207-13d899e76a67').then((result => console.log(result)));
Get all teams in a tournament
Yunite.listAllTournamentTeams('bd4e8807-629f-4820-9207-13d899e76a67').then((result => console.log(result)));
Access registration data of a guild and know which Epic user is linked to which Discord user
Yunite.epicRegistrationData(['123456789123456789', '987654321987654321']).then((result => console.log(result)));
Add team to a tournament (only one of Epic or Discord Id needed)
Yunite.addTeamToTournament('bd4e8807-629f-4820-9207-13d899e76a67', undefined, '987654321987654321').then((result => console.log(result)));
Disqualifty a team from a tournament
Yunite.disqualifyTeamFromTournament('75757394-906f-461e-b33f-b51534d2563f', 'bd4e8807-629f-4820-9207-13d899e76a67').then((result => console.log(result)));
Update players in a team in a tournament (only one of Epic or Discord Id needed)
Yunite.updateTeam('75757394-906f-461e-b33f-b51534d2563f', 'bd4e8807-629f-4820-9207-13d899e76a67', {
player1: {
epicId: '1b17b72aaa36r579ebb47f832053cc30',
discordId: '987654321987654321'
},
player4: {
epicId: '1b17b72aaa36r579ebb47f832053cc30'
}
}).then((result => console.log(result)));