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
After thinking more deeply, I realised that putting the full twitch username in the message was not a great idea as it would be overly verbose for a Telegram message. I subsequently thought that having the ability to create a short string the prefix the messages with will help to identify the miner. I personally use the first characters of the miner name.
Type of change
[X] New feature (non-breaking change which adds functionality)
How Has This Been Tested?
I have tested this locally with multiple miners and it is working successfully. Messages are prefixed.
I have commented out the message_prefix in run.py configuration - works as normal
I have deleted the message_prefix configuration line in run.py - works as normal
To test:
Use a miner with a configuration with configured Telegram messaging.
Change the message_prefix option in the Telegram section of run.py from False to "User "
Start miner
Check Telegram messages
If successful, messages will be prefixed with "User "
Checklist:
[X] My code follows the style guidelines of this project
[X] I have performed a self-review of my code
[x] I have commented on my code, particularly in hard-to-understand areas
[X] I have made corresponding changes to the documentation (README.md)
[X] My changes generate no new warnings
[x] Any dependent changes have been updated in requirements.txt
Notes
I didn't think that my few lines of code warranted comments, but I updated the readme.md and example.py to suit with some comments in there.
Nothing is changed in the requirements I believe as this is a very simple change.
This is my first Pull Request, hopefully I got it sort of right.
I don't use other messaging services, but this could work for others as well.
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.
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:
Checklist:
Notes