How to automate interactions with a Telegram Bot?

I’m trying to find a way to automate my interactions with a Telegram Bot. Right now I manually send commands like /start and /help but I want to create a script to do this for me.

I’ve tried a few things:

  1. Writing a batch file on my Windows 10 PC where I use Telegram Desktop
  2. Looking into Telegram-CLI but it’s Linux-only
  3. Creating my own bot (but this won’t work as I need to use my personal account)

Does anyone know of any tools or methods I could use to achieve this automation? I’m open to different programming languages or approaches. The main goal is to have a script that can send messages and commands to the bot as if they were coming from my account.

Thanks for any help or suggestions!

Have you considered using the Telegram API directly? It’s a powerful tool that allows you to interact with Telegram programmatically. You’ll need to create an application on the Telegram website to get your API ID and hash. Then, you can use libraries like Telethon or Pyrogram in Python to automate your interactions.

These libraries provide methods to send messages, execute commands, and even handle incoming messages. They work with user accounts, so you can automate actions as if you were using your personal account. Just be cautious not to violate Telegram’s terms of service or spam restrictions.

I’ve used this method to create scripts that automatically respond to certain messages or execute scheduled commands. It’s quite flexible and can be adapted to various automation needs. Let me know if you need more specific guidance on setting this up.

hey mike, have u tried using the telethon library for python? its pretty easy to set up and can automate interactions with telegram bots. you’ll need to get ur api id and hash from telegram’s website, but after that its smooth sailing. lemme know if u need more help!

I’ve actually had success using the Telegram Bot API with Python. It’s a bit different from what you’re trying to do, but hear me out. Instead of automating your personal account, you could create a simple bot that acts as a middleman between you and the target bot. This way, you’d send commands to your bot, which then relays them to the target bot.

I set this up using the python-telegram-bot library. It’s straightforward to use and well-documented. You’d need to get a bot token from BotFather, but that’s quick and easy. The main advantage is you can run this script 24/7 on a small server or Raspberry Pi, giving you constant access to automate interactions.

Just a thought - it might solve your problem without risking your personal account or violating any terms of service. Let me know if you want more details on this approach.