Core Difference
Regular Telegram Bot (regular library):
• Required use of JSON wrapper / standard schema
• Flow rigid (follows Telegram API structure)
• Less flexible for custom backend
TgCore:
❌ No wrapper (direct raw / custom flow)
✅ Full control (free to define your own structure)
✅ Can integrate into backend chain without JSON constraint
✅ Closer to "DSL style" chaining
🔑 Authentication
❌ Not a Bearer Token
✅ x-api-key (more suitable for internal API / gateway)
⚙️ Custom Endpoints (Backend Chain)
• Path:
❌ Doesn't have to be JSON
✅ Can be chained with syntax /
• Suitable for custom workflow / automation
🤖 Telegram Native API
• Path:
• Direct mapping to Telegram API
•
🔥 TL;DR
• Want fast & standard use regular library
• Want a flexible & scalable backend TgCore is more suitable
Regular Telegram Bot (regular library):
• Required use of JSON wrapper / standard schema
• Flow rigid (follows Telegram API structure)
• Less flexible for custom backend
TgCore:
❌ No wrapper (direct raw / custom flow)
✅ Full control (free to define your own structure)
✅ Can integrate into backend chain without JSON constraint
✅ Closer to "DSL style" chaining
🔑 Authentication
from tgcore import Client
# custom backend
# use x-api-key
tg = Client(
api_key="your-api-key",
base_url="https://your-domain"
)
❌ Not a Bearer Token
✅ x-api-key (more suitable for internal API / gateway)
⚙️ Custom Endpoints (Backend Chain)
await tg.app("endpoint")\
.your_code_here()\
.send()• Path:
/api/web/{endpoint}❌ Doesn't have to be JSON
✅ Can be chained with syntax /
• Suitable for custom workflow / automation
🤖 Telegram Native API
await tg.raw.sendMessage()\
.something()\
.skip()
• Path:
/api/v2/{method}• Direct mapping to Telegram API
•
.skip() bypass wrapper / finalize requestRegular bot = abstraction
TgCore = control
🔥 TL;DR
• Want fast & standard use regular library
• Want a flexible & scalable backend TgCore is more suitable
🤣1
• API devs etc
- use router enums:
• TgCore (full control)
PyPi: https://pypi.org/project/tgcore/
- use router enums:
/v1, /openai, /apifrom tgcore import Client
tg = Client(
bearer_token="gsk_xxxx",
base_url="https://api.groq.com",
is_bearer=True
)
await (
tg.app(
"v1/chat/completions",
router="/openai",
tgmod=False
)
.model("moonshotai/kimi-k2-instruct-0905")
.messages(tg.user("say test"))
).execute()
• TgCore (full control)
from tgcore import Client
tg = Client(api_key="xxxxxx")
result = await tg.app("groq.ai", tgmod=True)\
.model("moonshotai/kimi-k2-instruct-0905")\
.messages(
tg.user("Say test")
)\
.send()
print(result.text())
PyPi: https://pypi.org/project/tgcore/
❤1🤣1
Ultra-fast 💀
If using telethon:
If using Pyrogram:
PyPi: https://pypi.org/project/tgcore/
If using telethon:
tg.parallel(install_type="cryptg")If using Pyrogram:
tg.parallel(install_type="tgcrypto")PyPi: https://pypi.org/project/tgcore/
ev t = await tg.translate.create(tl="en", q="Anda sudah lama berada di sini").send()
return t.next().translated_text
return t.next().translated_text