Coder Social home page Coder Social logo

discord-uptime's Introduction

discord-uptime

Code style: black security: bandit

Discord Uptime is a Discord bot that allows you to monitor the uptime of services using ICMP ping, tcp and http requests. There are also commands avaliable to make manual requests. Built using discord.py, ping3 and aiohttp.

Installation

Requires Python 3.6+

Install dependencies:

pip install -r requirements.txt

Bot setup (Rename config.example.json and edit the default values):

  • token - Discord bot token
  • prefix - Discord bot prefix
  • activity_type - Activity type for bot status (must be one of playing, streaming, listening, watching)
  • activity_name - Text for bot status
  • disable_help - If true, the default help command will be disabled
  • hide_ips - If true, any IP addresses in notifications or the status command will be hidden
  • notification_channel - Channel ID where down/up notifications will be sent
  • retries - How many retries to complete before flagging a server with down status
  • role_to_mention - Role ID which will be tagged in down/up notifications
  • secs_between_ping - How many seconds between each uptime check
  • timeout - How many seconds before a ping or HTTP request should timeout

No privileged intents are currently needed to run the bot.

Servers Configuration

Servers should be setup similar to the examples already in server.json:

  • There are three supported types: http, tcp and ping
[
    {
      "name": "Google",
      "type": "http",
      "address": "google.com"
    },
    {
      "name": "Gmail SMTP",
      "type": "tcp",
      "address": "smtp.gmail.com:465",
    },
    {
      "name": "Cloudflare",
      "type": "ping",
      "address": "1.1.1.1"
    }
]

Commands

Default Prefix: >

  • ping <address> [pings] - Pings an address once, or for the amount specified via pings and returns the delay in ms
  • http <address> - Performs a HTTP request to the specified address and returns the response code
  • status - Displays the status of all servers setup in servers.json

Screenshots

Status Command

status

Uptime & Downtime Notifications

uptime

Hide IP addresses

hideips

Contributing

Contributions are very welcome. I use flake8, black, and bandit as linting tools and there is a pre-commit config in the repo to help automate this process as much as possible.

discord-uptime's People

Contributors

aditya12311 avatar coldunwanted avatar dependabot[bot] avatar finlaysawyer avatar tferreira 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.