Closed ColinShark closed 2 years ago
I'm really in love with this feature :heart: I've developed in the past many Telegram Bots, and they were my first projects
I'll see what can I do
I'll see what can I do
I've already hacked together a method post_telegram()
into the utils.py to simply import that lul
I could make a fork and push my changes (sans api key) so you can see how it could work ^^
@ColinShark Be careful when referencing things from a private repo. We can see the 2 commits that includes your telegram key.
@ColinShark Be careful when referencing things from a private repo. We can see the 2 commits that includes your telegram key.
If you read closely, the __TOKEN
variable is just ascending numbers and letters. Nothing to worry about ^^
I've thought a lot on this issue, we should track all events? Or create a list of event like:
track_only=[ STREAMER_ONLINE, STREAMER_OFFLINE, GAIN_FOR_RAID, GAIN_FOR_CLAIM, GAIN_FOR_WATCH, GAIN_FOR_WATCH_STREAK, BET_WIN, BET_LOSE, BET_REFUND]
, inside TelegramSettings
Something like that?
I think choosing which ones to track is a good idea. Probably default to everything so you can just do something like this:
miner = TwitchChannelPointsMiner(
username="username",
telegram_settings=TelegramSettings(token="123456:abc123def456")
)
Then you could disable what you don't need/want with something like this? No idea how easy that'd be to implement.
TelegramSettings(
token="123456:abc123def456",
streamer_online=True,
gain_for_raid=False,
...
)
As you can see from my fork, I literally just put a POST request to Telegrams API in utils, and track what I get updates on anyway (Points for watch and claim, drop progress and claim, as well as prediction gains)
Are you able to clear the code and submit a PR? I'll work on it, but in this way we will have a commit signed by you - the idea it's yours ;) and we had a contribution by you
I can do that, but Imma re-do my fork and branch for that because VSCode commited that as Gitea first 🙄 😅
As you wish 😂
I don't know how easy it would be to implement, but can we have a Telegram Bot Feature? :D
I thought maybe a Class for a Telegram Bot, so we can receive updates on Points, Drops and/or Bets from our own Bot in Telegram. Perhaps a Class to handle everything.
Users could be told in the Readme to create a bot with BotFather and add the Token and their own User ID to the
run.py
. All api request would need to go tohttps://api.telegram.org/bot<token>/METHOD_NAME
, where Method_Name could just besendMessage
with appropriate information filled in.As an additional bonus, maybe even commands to restart the points miner? 👀
I know, I've kinda skipped the issue template 🙈
Edit: I've made a (rough) proof-of-concept in
WebSocketsPool.on_message
:What it could look like: