Retrieve the bot's status and real-time information.
Info | Description |
---|---|
username |
The bot's username |
id |
The bot's id |
status |
The bot's status (online or offline) |
friends |
Array of bot's friends |
party |
Party status |
matchmaking |
Matchmaking status |
timestamp |
Last update timestamp (in ms) |
async function getUserStatus(username) {
const response = await fetch(`https://darkdus.vercel.app/api/status?username=${encodeURIComponent(username)}`, {
method: 'GET',
});
const data = await response.json();
console.log(data);
}
getUserStatus('testUsername');
async function addOrUpdateBot() {
const response = await fetch('https://darkdus.vercel.app/api/status', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
key: 'secretKey123',
username: 'player1',
id: 'user123',
status: 'online',
friends: ['player2', 'player3'],
party: 'party123',
matchmaking: 'queued',
timestamp: Date.now(),
}),
});
const data = await response.json();
console.log(data);
}
addOrUpdateBot();
async function deleteBot(username) {
const response = await fetch('https://darkdus.vercel.app/api/status', {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ key: 'secretKey123', username }),
});
const data = await response.json();
console.log(data);
}
deleteBot('player1');