Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Add Telegram Notifications to your Yield Generator

Adlai edited this page Jul 10, 2020 · 5 revisions

NOTE: Although the approach described in this guide is still doable, it was written for an early version of joinmarket, and the code is not updated for the latest version

NOTE: This Guide is for advanced users. If you have never touched code or know how to indent python you should not be doing this. While the risk of losing coins is basically zero touching code and changing things is never a good idea if you don't know what you are doing.

This is how it looks

There are two steps to get YG notifications in Telegram:

1. Get a API-Key and figure out the ChatID between you and the Bot

  1. In Telegram open a Chat with @BotFather
  2. Type /newbot and follow the instructions
  3. Copy the http access token
  4. Find your chat ID
    • Copy the code from this Pastebin, save it as ChatID.py, add your access token and run it using python ChatID.py. This will start a telegram bot we use to find the chatID between you and the bot
    • Message your bot with /getmychatid, it will reply with Chat ID: CHATIDHERE
    • You can close the ChatID.py console window

2. Edit the python script so send you notifications

  1. Install telepot as a dependency using pip install telepot
  2. Open maker.py in your favorite text editor
  3. Add import telepot besides the other import statements at the top of the file
  4. Copy the code from this paste
  5. Paste it between the lines log.info('earned = ' + str(self.real_cjfee - self.txfee)) and to_cancel, to_announce = self.maker.on_tx_confirmed(self, confirmations, txid). Make sure all lines have the same indentation as the lines you pasted between
  6. Change the placeholders to your API-Key and chatID.
  7. Restart the Yield Generator script