Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Telegram script #4

wants to merge 4 commits into from

Conversation

andy71
Copy link

@andy71 andy71 commented Jun 16, 2022

For my own purposes I have created a Telegram version of the script. Maybe it is also interesting for other users.

andy71 added 2 commits June 16, 2022 14:21
Added telegram version for rpilocator
Added information about the telegram script version.
return False
try:
result_msg = bot.sendMessage(chat_id=TELEGRAM_CHAT_ID, text=message, parse_mode='HTML')
return isinstance(result_msg, telegram.message.Message)
Copy link

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) ?

Copy link
Author

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.

@Myxfall
Copy link

Myxfall commented Jan 13, 2023

@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 await blocks from asyncio.

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants