/go-tgbwp

A in Golang written telegram bot with plugins support (using the Golang plugins package). I use this to get my (raspberry pi) server IP. Replaced with https://github.com/knackwurstking/tgs

Primary LanguageGo

tgbwp (telegram-bot-with-plugins)

Replaced with: https://github.com/knackwurstking/tgs

A Golang Telegram bot with plugins support.

Install Info

  • Create a bot with the BotFather command: /newbot, name, username, and grep the API token from the message.
  • Invite the bot into a group.
  • Run the BotFather command: /setjoingroups to disable the bot from joining groups.

Now, the bot will only answer group members.

  • Inside the group, type: /hello.

  • Run curl https://api.telegram.org/bot<token>/getUpdates | jq to get and store the chat ID.

  • export TGBWP_TOKEN=Enable debug:export debug. DEBUG=true`

Build with: go build -buildmode=plugin -o ~/.local/share/tgbwp/plugins/ip.so ./plugins/ip

Configuration

Example configuration, replace <number> with the current chat numbers:

{
  “id”: {
    “user”: {
      “knackwurstking”: <number>
    },
    “chat”: {
      “alice”: <number>
    }
  }
}