Closed Wh1t3Rose closed 3 years ago
Also your line numbers for the Service file in the Readme are way off. I guess the file changed a bit after you made the readme? Can you update the readme file with the proper line numbers? I think I got it right but want to be sure. Thanks!
JSON files require you to put ,
at the need of a new list.
So at line 7, add a ,
after the }
.
Ok I got that fixed. Thank you. Can you please help with my service file. I am so close to getting this working. The bot works AND I can do /service SERVICENAME and it gives a response.
But I still only have one thing listed by the bot when I do /service in Discord and it lists the Example despite me renaming the case name for that section.
I have 2 sections below. Not sure If I copied the right lines as I think your ReadMe is out of date or doesn't list the right line numbers
await cl.getMonitors({customUptimeRatio: [1, 7, 30]}).then((res) => {
switch (args[1]) {
case `Ombi`:
// Example monitor
//
// Monitors are defined in "data/db.json", for every monitor -- there should be another list in the collection.
// See the README.md for more information.
var monitor = botTools.findMonitor(res, monitorlist[0].value);
var monitStatus = botTools.monitorStatus(monitor.status);
var monitColor = botTools.embedColor(monitor.status);
var emojiStatus = botTools.emojiMsg(monitor.status);
var monitType = botTools.monitorType(monitor.port, monitor.type);
var embed = new Discord.MessageEmbed()
.setTitle(`${emojiStatus} ${monitor.friendlyname}`)
.addField(`Type:`, monitType)
.addField(`URL:`, monitor.url)
.addField(`Status:`, monitStatus)
.addField(`Today's uptime percentage:`, `${monitor.customuptimeratio[0]}%`)
.setFooter(`Uptime detection by UptimeRobot.`)
.setColor(monitColor)
channelmsg.send({embed});
logger.info(`----------------------------------------------`)
logger.info(`${monitor.friendlyname} was tested by ${usernameMSG} on ${guildmsg.name}.`)
logger.info(`Status: ${monitStatus} | Today's uptime %: ${monitor.customuptimeratio[0]}`)
break;
case `Plex`:
// Example monitor
//
// Monitors are defined in "data/db.json", for every monitor -- there should be another list in the collection.
// See the README.md for more information.
var monitor = botTools.findMonitor(res, monitorlist[1].value);
var monitStatus = botTools.monitorStatus(monitor.status);
var monitColor = botTools.embedColor(monitor.status);
var emojiStatus = botTools.emojiMsg(monitor.status);
var monitType = botTools.monitorType(monitor.port, monitor.type);
var embed = new Discord.MessageEmbed()
.setTitle(`${emojiStatus} ${monitor.friendlyname}`)
.addField(`Type:`, monitType)
.addField(`URL:`, monitor.url)
.addField(`Status:`, monitStatus)
.addField(`Today's uptime percentage:`, `${monitor.customuptimeratio[0]}%`)
.setFooter(`Uptime detection by UptimeRobot.`)
.setColor(monitColor)
channelmsg.send({embed});
logger.info(`----------------------------------------------`)
logger.info(`${monitor.friendlyname} was tested by ${usernameMSG} on ${guildmsg.name}.`)
logger.info(`Status: ${monitStatus} | Today's uptime %: ${monitor.customuptimeratio[0]}`)
break;
default:
var embed = new Discord.MessageEmbed()
.setTitle(`Please select your monitor you'd like to check on.`)
.addField(`\`${prefix}service example\``, `Example monitor.`)
Please join the support server (Discord) for that type of help.
I am trying to add multiple monitors to db.json and keep getting json parse errors. No offense but either your app has a bug or the documentation needs updating. I copied lines 3-7 just like it says.
I think it would help if you updated your example file with multiple Monitors,