-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Telegram script #4
base: main
Are you sure you want to change the base?
Conversation
Added telegram version for rpilocator
Added information about the telegram script version.
rpilocator_telegram.py
Outdated
return False | ||
try: | ||
result_msg = bot.sendMessage(chat_id=TELEGRAM_CHAT_ID, text=message, parse_mode='HTML') | ||
return isinstance(result_msg, telegram.message.Message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick question, any reason why you return anything within sendMessage(X)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. They are from another project from me. Damn copy&paste ;-)
I have removed the returns.
Thanks to @Myxfall for the tip
@andy71 Btw, I used to send message to Telegram using simple Curl requests, so I wanted to try out your script so I can scale up. I dont know if you are able to run it like, but I personally needed to include some I am then able to send an async message using loop = asyncio.get_event_loop()
task = loop.create_task(sendMessage(formatMessage(entries)))
loop.run_until_complete(task) Would you have any insight on that ? |
For my own purposes I have created a Telegram version of the script. Maybe it is also interesting for other users.