mirror of
https://github.com/Expand-sys/mcbot
synced 2026-03-22 12:37:09 +11:00
added query command
This commit is contained in:
parent
cbbb1bab06
commit
71294988a0
2 changed files with 3 additions and 5 deletions
|
|
@ -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),
|
||||||
|
|
|
||||||
|
|
@ -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}`
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue