added query command

This commit is contained in:
Expand 2023-12-18 00:03:43 +11:00
parent cbbb1bab06
commit 71294988a0
2 changed files with 3 additions and 5 deletions

View file

@ -15,7 +15,7 @@ module.exports = {
*/ */
async execute(interaction) { async execute(interaction) {
const { member, guild, options } = interaction const { member, guild, options } = interaction
await interaction.deferReply({ ephemeral: true }).catch(err => console.error(`There was a problem deferring an interaction: `, err)); await interaction.deferReply({ ephemeral: false }).catch(err => console.error(`There was a problem deferring an interaction: `, err));
const rcon = new Rcon({ const rcon = new Rcon({
host: `${process.env.MCHOST}`, host: `${process.env.MCHOST}`,
port: parseInt(process.env.RCON_PORT), port: parseInt(process.env.RCON_PORT),

View file

@ -22,8 +22,6 @@ module.exports = {
function runevery30seconds(i) { function runevery30seconds(i) {
setTimeout(() => { setTimeout(() => {
dig.query({ dig.query({
type: 'minecraft', type: 'minecraft',
host: process.env.MCHOST, host: process.env.MCHOST,
@ -43,7 +41,7 @@ module.exports = {
channelSend(`Server offline for ~${serverofflinefor}`) channelSend(`Server offline for ~${serverofflinefor}`)
} }
if(serverofflinefor == 60 && restarted != 1){ if(serverofflinefor == 60 && restarted != 1){
channelSend(`server Offline for 60 seconds Restarting`) channelSend(`Server Offline for 60 seconds Restarting`)
const killer = await spawn("screen", ['-XS', 'minecraft', 'quit']) const killer = await spawn("screen", ['-XS', 'minecraft', 'quit'])
const mc = await spawn("screen", ['-dmS', 'minecraft', '/bin/bash', `${process.env.SERSTARTLOC}/ServerStart.sh`], { const mc = await spawn("screen", ['-dmS', 'minecraft', '/bin/bash', `${process.env.SERSTARTLOC}/ServerStart.sh`], {
cwd: `${process.env.SERSTARTLOC}` cwd: `${process.env.SERSTARTLOC}`