From 1819af6bf14f2b890fde56f7dc109760bda393f2 Mon Sep 17 00:00:00 2001 From: MarckTomack Date: Mon, 24 Jun 2019 20:51:51 +0200 Subject: [PATCH] add start/help command and update README --- README.md | 14 +++++++++++--- main.go | 11 +++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5272b37..75ae20e 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,24 @@ # bitcoincash-explorer-bot This is a bot for interact with the BitcoinCash Blockchain from Telegram -# Download e configuration +# Download and configuration + +Binaries are available for some operating systems here + +Extract the zip and add your token in config.json file. + +Then, run: +`./bitcoincash-explorer-bot` + + +# Build from source You need a Go compiler `git clone https://github.com/MarckTomack/bitcoincash-explorer-bot.git` -Add your token to config.json ``` cd bitcoincash-explorer-bot go build -./bitcoincash-explorer-bot ``` diff --git a/main.go b/main.go index 84a3c9c..ef735f6 100644 --- a/main.go +++ b/main.go @@ -29,6 +29,16 @@ import ( const satoshi = 0.00000001 +func start(bot *tb.Bot) { + bot.Handle("/start", func(m *tb.Message) { + bot.Send(m.Sender, "This is a bot for the BitcoinCash Blockchain.\n"+ + "You can use these commands:\n"+"\n"+ + "/blockchainstatus\n"+ + "/price\n"+"\n"+ + "Or send an address or a transaction hash for check informations about it.") + }) +} + func addressAndTransaction(bot *tb.Bot) { bot.Handle(tb.OnText, func(m *tb.Message) { addr, tx := m.Text, m.Text @@ -166,6 +176,7 @@ func main() { if err != nil { log.Fatal(err) } + start(bot) addressAndTransaction(bot) blockchainStatus(bot) price(bot)