Telegram Notification - C0D3D3V/Moodle-DL GitHub Wiki

To set up the notifications about Telegram you need to create a Telegram Bot. You can follow the instructions below, or search for other instructions on the Internet.

  1. Start a conversation with BotFather.

  2. Use the /newbot command to create a new bot. Just send the message "/newbot" to the BotFather. The BotFather will ask you for a name (this is the display name) and username (must end with 'bot'), then generate an authorization token for your new bot.

  3. The token (i.e. 110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw) the BotFather sends you is the token you need for the telegram notifications. That is required to authorize the bot and send requests to the Bot API.

  4. Now you start a chat with the bot you just created by clicking on the link the BotFather sent you. In the chat you then click on "Start". Send your bot a friendly "Hello".

  5. Go to following url: https://api.telegram.org/botXXX:YYYY/getUpdates replace XXX:YYYY with your bot token. If you do not see an entry with your username, send a message to your bot again and reload the page (with F5)

  6. Look for

"chat":{
  "id":zzzzzzzzzz,

zzzzzzzzzz is your chat id (possibly with a minus sign).

  1. Execute moodle-dl -ct in your usual download directory and enter the appropriate data (token and chatid). If everything was correct you will receive a test message.

Alternatively you can add directly a corresponding section to your config.json.

    "telegram": {
        "token": "127123404:AAGc0KoobPAABBCgUgrUY5KiRMkUbn4vdE",
        "chat_id": "910011480",
        "send_error_msg": true
    },