In-game players on discord status

This commit is contained in:
Burlone
2025-03-16 03:18:50 +01:00
parent 511dc37311
commit 9aaf24d32e
4 changed files with 16 additions and 4 deletions
+2 -1
View File
@@ -2,7 +2,8 @@
"moderators": ["discordId", "discordId2"],
"discord": {
"bUseDiscordBot": true,
"bot_token": ""
"bot_token": "",
"bEnableInGamePlayerCount": true
},
"mongodb": {
"database": "mongodb://127.0.0.1/Reload"
+11
View File
@@ -35,6 +35,17 @@ client.once("ready", () => {
}
}
if (config.discord.bEnableInGamePlayerCount) {
function updateBotStatus() {
if (global.Clients && Array.isArray(global.Clients)) {
client.user.setActivity(`${global.Clients.length} player(s)`, { type: "WATCHING" });
}
}
updateBotStatus();
setInterval(updateBotStatus, 10000);
}
let commands = client.application.commands;
const loadCommands = (dir) => {
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "reloadbackend",
"version": "1.1.4",
"version": "1.1.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "reloadbackend",
"version": "1.1.4",
"version": "1.1.5",
"license": "BSD-3-Clause license",
"dependencies": {
"axios": "^1.7.7",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "reloadbackend",
"version": "1.1.4",
"version": "1.1.5",
"description": "Created by Burlone, This is a modded backend, all main backend credits to lawin",
"main": "index.js",
"dependencies": {