agala v1.0.3 Agala.Handler.Broadcast

Broadcast bot handler. Use it to broadcast some information from your bot to chanel.

Getting your chat_id for Private Chanel

Getting your chat_id for now is not so easy. Perform these steps:

  • Turn you chanel to public, so it will get id like @MyChannel
  • Send cURL request to Web Bot API

    curl -X POST "https://api.telegram.org/bot%YOURBOTTOKEN%/sendMessage" -d "chat_id=@MyChannel&text=my sample text"
  • Get response in form of:

    { "ok" : true, "result" : { "chat" : { "id" : -1001005582487, ...
  • Extract id from response, it will not be changed anymore
  • Turn your chanel back to private

Summary

Functions

handle(state, text)

Callback implementation for Agala.Handler.handle/2.