Skip to content
This repository has been archived by the owner on Dec 29, 2019. It is now read-only.

Commit

Permalink
add start/help command and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
MarckTomack committed Jun 24, 2019
1 parent 89fe499 commit 1819af6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 <a href="https://github.com/MarckTomack/bitcoincash-explorer-bot/releases">here</a>

Extract the zip and add your token in config.json file.

Then, run:
`./bitcoincash-explorer-bot`


# Build from source

You need a <a href="https://golang.org/dl/">Go compiler</a>

`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
```
11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -166,6 +176,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
start(bot)
addressAndTransaction(bot)
blockchainStatus(bot)
price(bot)
Expand Down

0 comments on commit 1819af6

Please sign in to comment.