Orbeo

Bot API · Guides

Auto-posting to a channel

A bot can publish to your channel on a schedule: a morning digest, a picture of the day, news from an RSS feed. All you need is a token, the bot as a channel admin and a script.

1. Prepare

  1. Create a bot: Settings → My bots, copy the token.
  2. Open your channel → Administrators → Add a bot and choose it.
  3. Give the channel a public handle — then chat_id is simply "@handle".

2. The script

pip install requests
import os, requests
T = os.environ["ORBEO_TOKEN"]
API = f"https://orbeo.me/botapi/bot{T}"

requests.post(f"{API}/sendMessage", json={
    "chat_id": "@mychannel",
    "text": "<b>Morning digest</b>\nThree things worth reading today…",
    "parse_mode": "HTML",
}).raise_for_status()

with open("cover.jpg", "rb") as f:
    requests.post(f"{API}/sendPhoto",
                  data={"chat_id": "@mychannel", "caption": "Picture of the day"},
                  files={"photo": f}).raise_for_status()

parse_mode accepts HTML, MarkdownV2 or Markdown. Text up to 4096 characters, captions up to 1024, files up to 50 MB.

3. Schedule

# every day at 09:00
0 9 * * * ORBEO_TOKEN=123:yourtoken /usr/bin/python3 /home/me/post.py

Any scheduler works: cron, systemd timers, GitHub Actions, a cloud function.

Ideas

Ready-made versions of these are in the @orbeodev channel inside Orbeo.

If something fails

More — Bot API reference.