allah
This commit is contained in:
parent
f337844bf9
commit
a49583b078
31
index.js
31
index.js
@ -1,37 +1,8 @@
|
|||||||
const
|
const
|
||||||
discord = require('discord.js'),
|
|
||||||
bot = new discord.Client(),
|
|
||||||
mc = require('minecraft-server-util'),
|
mc = require('minecraft-server-util'),
|
||||||
needle = require('needle'),
|
web = new discord.WebhookClient("1009180421390598365", "uqcEgaZRiSG9L5e3M9idcpr5ObdZDsL1L6QzflQvZbnMew5rA6LJ1HnPghv1WY-PHx0D")
|
||||||
web = new discord.WebhookClient("1009180421390598365", "uqcEgaZRiSG9L5e3M9idcpr5ObdZDsL1L6QzflQvZbnMew5rA6LJ1HnPghv1WY-PHx0D"),
|
|
||||||
prefix = "&"
|
|
||||||
|
|
||||||
bot.login("MTAwOTE3OTUzNDY5Mzc3MzQxNA.GA7c-4.Ct3_njR4txMsx6K2Fp-cUCvOPwlLe3ao_NWZnM")
|
|
||||||
|
|
||||||
|
|
||||||
bot.on('ready', async () => {
|
|
||||||
console.clear()
|
console.clear()
|
||||||
console.log(`Logged on ${bot.user.username}`)
|
|
||||||
})
|
|
||||||
|
|
||||||
bot.on('message', async(message) => {
|
|
||||||
var args = message.content.substring(prefix.length).split(" ");
|
|
||||||
if (!message.content.startsWith("&")) return;
|
|
||||||
switch (args[0]) {
|
|
||||||
case "status":
|
|
||||||
var h = await mc.status("play.2b2flat.fr", 25565).catch(e => {
|
|
||||||
message.channel.send("Serveur offline")
|
|
||||||
})
|
|
||||||
var embed = new discord.MessageEmbed()
|
|
||||||
.setTitle("**Status 2b2flat**")
|
|
||||||
.addField("**IP**", "`play.2b2flat.fr`", true)
|
|
||||||
.addField("**Version**", `${h.version}`, true)
|
|
||||||
.addField("**Motd**", `\`\`\`\n${h.motd}\n\`\`\``)
|
|
||||||
.setTimestamp()
|
|
||||||
message.channel.send(embed)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
setInterval(async() => {
|
setInterval(async() => {
|
||||||
var h = await mc.status("play.2b2flat.fr", 25565).catch(e => {
|
var h = await mc.status("play.2b2flat.fr", 25565).catch(e => {
|
||||||
web.send(":red_circle: Serveur Down")
|
web.send(":red_circle: Serveur Down")
|
||||||
|
Loading…
Reference in New Issue
Block a user