m1roff/yii2-telegram-notifications

Telegram Notifications

2.0.0 2022-09-08 17:31 UTC

This package is auto-updated.

Last update: 2024-12-08 22:22:14 UTC


README

Installation

The preferred way to install this extension is through composer.

Either run

composer require m1roff/yii2-telegram-notifications "dev-master"

Configure

add this lines to your project config file

'components' => [
    ...,
    'telegram' => [
        'class' => \m1roff\TelegramNotifications::class,
        'token' => ***', // Token of your bot
        'chat' => ***, // Notifications chat id
        'extraTitle' => "⚠️⚠️⚠️ Some extra title added to message⚠️⚠️⚠️\n", // optional
        'proxy' => 'socks5://LOGIN:PASS@PROXY_ADDRESS:PROXY_PORT', // optional, if needed to use proxy, like in Russia
    ],
],

HOW

How to find out my user`s Id ot chat id?

  • send message to the bot
  • Look at last updates at https://api.telegram.org/bot{BOT_TOKEN}/getUpdates
  • {BOT_TOKEN} - replace with your bot token