Username in Telegram messages #376
Replies: 4 comments 1 reply
-
I've kind of worked out a very crude way to get this going. Very poorly I will add. I've edited the Telegram.py file to the with a couple of lines to insert the a hardcoded text at the front of the message, but I can't work out how to get the "username" into that file for use. If I can work that out, I can do an if statement to determine if settings are set for it and make this more usable. For now I am testing the functionality. I think it would help to have a short text (only a few characters) rather than a full twitch_username as it would make the Telegram message too long. If this gains traction/interest and I can work out the settings import bit above, it might be useful to others.
This above will add "User " to the start of every Telegram message. |
Beta Was this translation helpful? Give feedback.
-
Pull request created, closing this discussion now. |
Beta Was this translation helpful? Give feedback.
-
Will make a better solution with a new PR of my own. |
Beta Was this translation helpful? Give feedback.
-
I would like to propose the ability the add the Username to the telegram Event messages.
Rationale:
Much like the console_username setting, it would be useful to have the username for the twitch miner added to Telegram messages. When you have many miners, you can either start many telegram bot conversation (one for each miner) or funnel them into one telegram bot conversation. If you use one conversation, it would be fantastic to have the username of the twitch miner in the telegram message to be able to discern the miner that the EVENT relates to. I personally use the offline event to trace channel points and it would be great to know which miners have claimed drops rather than seeing a Drop event and then going to check individually.
Potential message structure
"<miner_twitch_username> - <EVENT_message>"
E.g.
"Points_Miner - eslcs (31.79k points) is Offline!"
"Eye_Mine_Pt - eslcs (20.37k points) is Offline!"
It would be great if this was an opt-in option much like the console_username defaulting to false., so that people with only one miner don't get the over-verbose message unnecessarily. This would likely make it more complex, like the console_username entry that I have a had a good read through.
I have tried to work this out myself, but I am out of my depth in python (I am only really proficient in BASH and simple python in home automation), I can't work where I would add this in the code base. I tried a few places and I clearly got it very wrong with formatting and not having the variable called/declared in the correct place. The syntax to add it to the message string is more complex than I am capable of. The console_username entry is using a different way to create the message that I can't easily use as an example.
Beta Was this translation helpful? Give feedback.
All reactions