This commit is contained in:
valentijn
2024-01-04 19:57:40 +01:00
parent c5a5c06ae0
commit 5152eb3834
2 changed files with 8 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js'); const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
const axios = require('axios'); const axios = require('axios');
const { server_ip, server_port } = require('../../config.json'); const { server_ip } = require('../../config.json');
module.exports = { module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
@@ -8,7 +8,7 @@ module.exports = {
.setDescription('Get the current server status and players'), .setDescription('Get the current server status and players'),
async execute(interaction) { async execute(interaction) {
const SERVER_IP = `${server_ip}:${server_port}`; const SERVER_IP = `${server_ip}`;
axios.get(`https://api.mcsrvstat.us/3/${SERVER_IP}`).then((resp) => { axios.get(`https://api.mcsrvstat.us/3/${SERVER_IP}`).then((resp) => {
const data = resp.data; const data = resp.data;

6
config.json.example Normal file
View File

@@ -0,0 +1,6 @@
{
"clientId":"your bots application id",
"token":"your bot token",
"server_ip":"127.0.0.1:12345"
}