rdavydov / Twitch-Channel-Points-Miner-v2

A simple script that will watch a stream for you and earn the channel points.
GNU General Public License v3.0
1.21k stars 351 forks source link

Telegram message prefix #379

Closed Yorik-Code closed 11 months ago

Yorik-Code commented 11 months ago

Description

This enhancement adds a prefix to Telegram messages. When running multiple miners using one Telegram chat, it is difficult to discern which miner the message relates to. Much like the console_username parameter, this adds the ability to identify the messages. However, this does not use the username by default (concern about long usernames creating overly verbose messages).

Opt-In by default: Does nothing unless it is specifically configured. If the user configures a text string, it will be pre-pended into message that send to the Telegram chat. If the configuration line is not present, it continues normally.

Works particularly well with a space after the text, so I added this in the comment text in example.py and the readme.md

I have updated what I believe needed to be updated.

Fixes # (discussion) Partly resolves my own discussion - #376

Type of change

How Has This Been Tested?

To test:

  1. Use a miner with a configuration with configured Telegram messaging.
  2. Change the message_prefix option in the Telegram section of run.py from False to "User "
  3. Start miner
  4. Check Telegram messages
  5. If successful, messages will be prefixed with "User "

Checklist:

Notes

rdavydov commented 11 months ago

There is a better way. And I think it should cover not only Telegram, but also Discord, Matrix and Pushover. Something like the "console_username" way.