phen0menon / poe-trade-telegram-notifier

šŸ“± Receive Telegram notifications about trade offers and reply to them!
Other
10 stars 2 forks source link
path-of-exile path-of-exile-bot telegram-bot

PoE Trade Telegram Notifier

Demonstration video:

https://github.com/phen0menon/poe-trade-telegram-notifier/assets/15520523/184d6102-3254-47aa-a111-80a43cf8e129

Why

In Path of Exile, the lack of an auction system complicates trading, requiring players to monitor trade offers near their PC. This application solves a key issue: when away from their PC, players can receive PoE whisper messages on their Telegram account. This allows them to view and respond to trade offers instantly via Telegram, avoiding interruptions like being pulled away from TikTok for low-value trades (every PoE player knows 1c trading is unproductive).

How it works

Application constantly observes log file of Path of Exile located in Path of Exile/logs/Client.txt. If there is Whisper message, it instantly forwards to Telegram Channel.

To get replies to messages in the Telegram Channel, application constantly polls Telegram API for getting updates of a bot.

How to install

Prerequisites

  1. System: Windows, MacOS not tested
  2. Python >= 3.8. You can download Python here: https://www.python.org/downloads/

Running application

  1. Open project directory and open terminal in this directory.
  2. Run the command to create venv:
    python -m venv .venv
  3. Activate the venv:
    .venv\Scripts\activate.bat
  4. Install project dependencies:
    pip install -r requirements.txt
  5. IMPORTANT: make sure you configured your config.ini (read section below) according to your prefs.
  6. Run the application:
    python main.py

Configuring config.ini

Required fields - mandatory for running the application

Field Type Required Description
TelegramBotId string Yes Create telegram bot which will notify you about all incoming whispers. You can use BotFather for creating one, it is simple stupid. Obtain created bot token. You can do that in the BotFather. The bot token usually have the following pattern: 181283218:BBFRF5r-2Q2fSofZV-wQOFXKX6UIsd_GTtl
TelegramUserId string Yes Obtain your telegram id. You can do that using GetMyId bot
LogPath string Yes Your Path of Exile logging directory. Typically, it is located in the steam/steamapps/Path of Exile/logs/Client.txt for Windows and in /Users/{username}/Library/Caches/com.GGG.PathOfExile/Logs/Client.txt for MacOS

Other fields

Field Type Required Description
ObserverCooldownSecs float No (default is 2.0) Interval between log reads. You can set it to lower value in order to get notifications as fast as it's possible (it is bound to our operating system)
TelegramPollingCooldownSecs float No (default is 1.0) Interval between requests to Telegram API for getting reply messages.

IMPORTANT: it is recommended to not override this variable, do that only if you know what are you doing.

Development

Future requests:

License

Ā© Rolan Ibragimov (phen0menon) 2024. Licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) License.