hdurix / description-keeper-go

Set description in telegram chats (Go/Docker/now.sh)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage

Bot for storing message in Telegram discussion.

Can receive 4 commands:

  • /get: Get channel description
  • /set: Set channel description
  • /add: Add line to channel description
  • /remove: Remove line from channel description

All data is stored in kvstore.io.

Now

Install now

For example:

yarn global add now

Add secret variables

now secrets add keeper-kvstore-token "XXXXX"
now secrets add keeper-bot-id "123:ABC"

Deploy the app

now

Use Alias

You can first change the alias in now.json.

{
  "alias": "custom-alias",
}

Then, once the deployment is done:

now alias

Telegram

Check connection

curl -i -X GET https://api.telegram.org/bot<apikey>/getMe

Get Webhook Info

curl -i -X GET https://api.telegram.org/bot<apikey>/getWebhookInfo

Post Webhook

DOMAIN=<domain>
APIKEY=<apikey>
curl -F "url=https://$DOMAIN/$APIKEY/send" https://api.telegram.org/bot$APIKEY/setWebhook

Go

References

IDE

Articles

Resources

Testing

Les méthodes de test doivent commencer par Test.

import "testing"

func TestName(t *testing.T) {
    [...]
    if actual != expected {
    t.Errorf("Must be %s but was %s", expected, actual)
  }
}

Test Tooling

About

Set description in telegram chats (Go/Docker/now.sh)


Languages

Language:Go 100.0%