An IRC Bot written in Go
# Dependencies
go get -u github.com/thoj/go-ircevent github.com/steveyen/gkvlite github.com/PuerkitoBio/goquery github.com/dustin/go-humanize github.com/kennygrant/sanitize gopkg.in/xmlpath.v2 github.com/kurrik/oauth1a github.com/kurrik/twittergo
# Porygon2
go get -u github.com/0x263b/porygon2
package main
import (
"github.com/0x263b/porygon2"
_ "github.com/0x263b/porygon2/commands/8ball"
_ "github.com/0x263b/porygon2/commands/admin"
_ "github.com/0x263b/porygon2/commands/bing"
_ "github.com/0x263b/porygon2/commands/choose"
_ "github.com/0x263b/porygon2/commands/lastfm"
_ "github.com/0x263b/porygon2/commands/opengraph"
_ "github.com/0x263b/porygon2/commands/translate"
_ "github.com/0x263b/porygon2/commands/twitter"
_ "github.com/0x263b/porygon2/commands/urbandictionary"
_ "github.com/0x263b/porygon2/commands/weather"
_ "github.com/0x263b/porygon2/commands/wolfram"
_ "github.com/0x263b/porygon2/commands/youtube"
)
func main() {
config := newConfig()
bot.Run(config)
}
func newConfig() *bot.Configure {
return &bot.Configure{
Server: "irc.rizon.net:6697", // "server:port"
Channel: "#Porygon2", // "#channel" or "#channel key"
User: "Porygon2", // "bot"
Nick: "Porygon2", // "bot"
Nickserv: "some password", // leave as "" if none
Modes: "GRp", // "GRp"
UseTLS: true, // true/false
Debug: false, // true/false
Prefix: "!", // "!"
Owner: "joe", // your nick
API: bot.API{
Bing: "",
Geocode: "",
Giphy: "",
Lastfm: "",
Translate: "",
TwitterConsumerKey: "",
TwitterConsumerSecret: "",
Weather: "",
Wolfram: "",
Youtube: "",
},
}
}
Save as /etc/init/porygon2.conf
and run service porygon2 start
# Upstart Configuration
description "Porygon2"
author "Black Smiling Face"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
respawn
exec /path/to/porygon2
- Bing: commands/bing
- Sign up for the free tier then get your API Key
- Giphy: commands/giphy
- The public beta key is good enough
- Google Geocode: commands/weather
- Key can be found on the Google API Console
- Last.fm: commands/lastfm
- Forecast.io: commands/weather
- Microsoft Translator: commands/translate
- Go to the Azure Marketplace and subscribe to Microsoft Translator, then test it with the Service Explorer. Top of the page, you'll see the
Primary Account Key
- Go to the Azure Marketplace and subscribe to Microsoft Translator, then test it with the Service Explorer. Top of the page, you'll see the
- Twitter: commands/twitter
- Create an app (Read only). Under
Keys and Access
, copy theConsumer Key
andConsumer Secret
- Create an app (Read only). Under
- Wolfram Alpha: commands/wolfram
- Register, then create and App, and copy the
AppID
- Register, then create and App, and copy the
- Youtube: commands/youtube
- Key can be found on the Google API Console