Giter Site home page Giter Site logo

ads231 / uptime Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ktg5/discord-uptimerobot

0.0 0.0 0.0 225 KB

A Discord bot that uses UptimeRobot to detect if a service is down or not.

License: GNU General Public License v3.0

JavaScript 100.00%

uptime's Introduction

Discord + UptimeRobot sample bot. Version 2.1.1

A Discord bot that uses UptimeRobot to detect if a service is down or not.

This does require you to have a UptimeRobot account and setup monitors on your UptimeRobot account.

Installation process.

Part 1 -- Getting started:

  1. Download the source by using git clone https://github.com/kt5company/discord-uptimerobot in a command prompt that has Git installed.
  2. Make sure you have Node.js + npm (node.js v12+) installed and run npm i inside the folder.
  3. Open auth.json with any text editor and... 3a. Replace DISCORD TOKEN HERE with your Discord bot's token. 3b. Replace UPTIMEROBOT TOKEN HERE with your UptimeRobot account's token.
  4. Open info.json with any text editor and...
  • Replace YOUR DISCORD ID HERE with your Discord user ID.
  • Replace YOUR PREFIX HERE with the prefix you'll be using to trigger the bot.
  1. When you have everything configured, run npm start in your terminal/command prompt.
  2. Invite the Discord bot to your server and use (prefix)ping to make sure it's running.

Make sure that all IDs you use are still in the quotes or else the last 2 numbers will be zeros, this goes with all IDs in the JSON files.

Part 2 -- Setting up monitors: (VERY IMPORTANT)

Since v2, monitors are now defined in data/db.json. For every monitor -- there should be another list in the collection. If you look in the commands/service.js script, you will see an "example monitor".

First you must find ID number of the monitor. Go to bot.js and uncomment the lines 70-72. Save the file and run the bot.

Check your console and you should see a list of monitors from your UptimeRobot account. Find the monitor ID you would like to use for this example, it will be above the monitor's "friendlyname". In the "db.json" file, in the "name" value the monitor whatever you like because it doesn't really matter. But in the "value" value, enter in your monitor ID.

You can now change the example case name in the service command to use when you want to look at the information for that monitor.

If you wanted to add more monitors, repeat the 2nd part of this process, copy the lines 3-7 in db.json and make sure to change the "value" to your other monitor ID, and copy the lines 26-50 in commands/service.js and make sure to change the case name to something different and change the monitorlist[0].value to monitorlist[1].value; the more you add, the higher the number is.

(Opinional) Part 3 -- Automatic checking of monitors:

Search for your info.json and change the values in "guild" to your chosen guild ID and "channel"to your chosen channel ID.

Make sure that the IDs you use are still in the quotes or else the last 2 numbers will be zeros, this goes with all IDs in the JSON files.

What's new in v 2.1?

  • Deletes old "auto-monitor-reporting" messages.
  • Fixed bugs.

Questions or need help?

Find questions to things you might be asking yourself

For help with anything, join our support server.

For bugs, file an issue.

uptime's People

Contributors

ktg5 avatar ktg5a avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.