Skip to content

gadget-bot/gadget-plugin-netutils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gadget Network Utilities Plugin

This is a Gadget plugin that allows Gadget to perform various network utility functions.

Note that Gadget -- and therefore any plugin for Gadget -- is still very much a work in progress, so please don't use it in production yet (or if you do, don't complain).

How do I use this plugin?

In your main.go for using Gadget, your main() function should instruct you bot, which is created using gadget.Setup() needs to be instructed to Router.AddMentionRoutes(netutils.GetMentionRoutes()). This usually looks like this:

package main

import (
	gadget "github.com/gadget-bot/gadget/core"
	netutils "github.com/gadget-bot/gadget-plugin-netutils"
)

func main() {
	// This is the Gadget bot
	myBot := gadget.Setup()

	// Add your custom plugins here
	myBot.Router.AddMentionRoutes(netutils.GetMentionRoutes())

	// This launches your bot
	myBot.Run()
}

What can this plugin do?

In your chat, you can perform the following actions:

  • whois <DOMAIN|IP|ASN> - Queries public WHOIS for the given object.
    • Parameters:
      • <DOMAIN|IP|ASN> either a domain name, an IP address, or an ASN.
  • hping [get|post|head] URL [COUNT] [INTERVAL(s|ms)] - Performs an HTTP request to the given URL with some optional parameters.
    • Parameters:
      • [get|post|head] - optional Allows specificy the HTTP Request Type (default: get)
      • URL - The HTTP or HTTPS URL
      • [COUNT] - optional The number of times to attempt the "ping" (default: 3)
      • [INTERVAL(s|ms)] - optional The time to wait, in either seconds (s) or milliseconds (ms), between requests (default: 2s)
    • Notes: