I'm trying to install telegram bot api module for golang from this link:
https://github.com/go-telegram-bot-api/telegram-bot-api
the installation example that showed there isnt working and raises the next error:
cannot find package "github.com/go-telegram-bot-api/telegram-bot-api/v5" in any of:
/usr/local/go/src/github.com/go-telegram-bot-api/telegram-bot-api/v5 (from $GOROOT)
/home/foo/go/src/github.com/go-telegram-bot-api/telegram-bot-api/v5 (from $GOPATH)
I looked on google and I saw some people recommending use "go install", but that raises the same error.
I would like to some help here, I'm trying figuring this out without a success for a while now. and feel free to ask for any further infotmation if you need
Thanks in advance!
So to elaborate on my comment:
The package you're trying to use is a module. It has no
mainfunction (ormainpackage). The example in the readme file is something you would write yourself. Say you want to call it "mybot", you'd go about it something like this:In this
main.goyou can paste the example, then run:It'll generate a binary in the current directory called
mybot. You can run this like any executable:Once you're up and running, install it using
go install .. This will put the binary in$GOPATH/bin. If you added that to your$PATHvariable, you can just run the binary by runningmybotfrom anywhere...