A Telegram bot, for friends.
Go
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Godeps
cmd/jarvisbot
data
vendor
.agignore
.gitignore
README.md
assets.go
basic.go
commands.md
config-sample.json
currency.go
currency_test.go
giphy.go
google.go
image.go
jarvisbot.go
jarvisbot_test.go
jokes.go
location.go
ping.go
psi.go
urbandictionary.go
utils.go
youtube.go

README.md

Jarvis

A Telegram bot for friends
Jarvis


Current featureset includes:

  • Grabs images
  • Grabs GIFs
  • Does Google searches
  • Does Youtube searches
  • Does Urban Dictionary searches
  • Does location searches
  • Does exchange rate conversions
  • Notifies everyone in a chatroom using their usernames
  • Displays the current air pollution index for all areas in Singapore
  • Clears your NSFW stuff

Build dependencies

Jarvis relies on go-bindata to package assets in the data/ folder into the binary. If you'd like to add to the assets when implementing your own response functions, install the go-bindata tool using:

go get -u github.com/jteeuwen/go-bindata/...

If you're running a Go version < 1.4, you'll need to manually run the following command in the top level dir.

go-bindata -pkg jarvisbot -o assets.go data/

(Otherwise, you can run go generate to achieve the same results).

Instructions

Compile Jarvis for your target platform and upload the binary to your server.

In the same directory as the binary, create a config.json file. (A config-sample.json has been provided for you to modify.) Remember to include the API keys in your config.json:

  • name: Your bot's @username - this is currently unused, but may be used in the future for @replies to your bot.
  • telegram_api_key: Your bot's Telegram bot api key, from Botfather.
  • open_exchange_api_key: An API key from https://openexchangerates.org/
  • youtube_api_key: A Google API key with Youtube enabled.
  • maps_api_key: A Google API key with Maps enabled.

New: you may now choose to use one custom_search_api_key, or use key cycling to get around Google custom search's 100 searches per day limit. To use key cycling, add any number of additional Google API key and Google custom search engine id pairs to config.json, with the following key schema:

  • "custom_search_credentials": [{"api_key": "x", "search_id": "y"}]

... and so on, where api_key is a Google API key with custom search enabled, and search_id is a Google custom search engine id. You'll need to use multiple Google accounts to create these key pairs, using these instructions. If this sounds like a hack, that's because it totally is. Or, stick to the old way and use just one key pair:

Last, but not least, make sure the user running the program has write permissions to its directory, as Jarvis creates a jarvis.db file.

Screenshots

Jarvis

Jarvis

Jarvis