const query = require('samp-query');
const { Client, GatewayIntentBits, ActivityType } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
const server = {
ip: '185.169.134.45',
port: 7777
}
client.on('ready', () => {
console.log(`Started.`);
setInterval(() => {
query({ host: server.ip, port: server.port }, (error, response) => {
if (error) return console.log(error);
client.user.setActivity(`Игроков: ${response.online}`);
});
console.log('online updated');
}, 5000)
});
client.login('ТВОЙ ТОКЕН');