Skip to content

Latest commit

 

History

History
58 lines (40 loc) · 1.46 KB

README.md

File metadata and controls

58 lines (40 loc) · 1.46 KB

LoggerTelegramBackend

Build Status Docs Hex.pm

A logger backend for Telegram.

Installation

Add :logger_telegram_backend and :finch to your list of dependencies in mix.exs:

def deps do
  [
    {:logger_telegram_backend, "~> 3.0"},
    {:finch, "~> 0.16"},
  ]
end

Add the backend

In your Application.start/2 callback, add the LoggerTelegramBackend:

@impl true
def start(_type, _args) do
  LoggerTelegramBackend.attach()

  # ...
end

Add the following to your configuration:

config :logger, LoggerTelegramBackend,
  chat_id: "your_chat_id",
  token: "yout_bot_token"

To create a Telegram bot, see the next section.

Configure the Telegram bot

To create a Telegram bot, follow the instructions here and get the token for the bot.

Then send a message to the bot and get your chat_id:

TOKEN="your_bot_token"
curl https://api.telegram.org/bot$TOKEN/getUpdates

License

This project is Licensed under the MIT License.