Rᴇɴᴅʏ Pʀᴏɪᴇᴄᴛs
ev await tg.use.default\ .route("games", "chain")\ .user( tg.where( name="Randy Architect", age="145", hobi="all" ) )\ .database( tg.where( mongodb=True, …
OUTPUT:
{
"ok": true,
"data": {
"user": {
"name": "Randy Architect",
"age": "145",
"hobi": "all"
},
"database": {
"mongodb": true,
"redis": true,
"sqlite": true
}
}
}New: mini backend language
await tg.use.default\
.route("games", "chain")\
.user(
tg.where(
name="Randy Architect",
age="145",
hobi="all"
)
)\
.database(
tg.where(
mongodb=True,
redis=True,
sqlite=True
)
)\
.then([
tg.where(
allow_users=True
)
])\
.max_level(
tg.where(
final=[
tg.where(
name="done"
)
]
)
)\
.pretty()
🤣1
JSON = format ❌
DSL = interface ✅
Source: teamkillerx.github.io/tgcore/
PyPi: https://pypi.org/project/tgcore/
DSL = interface ✅
result = await tg.app("groq.ai")\
.model("moonshotai/kimi-k2-instruct-0905")\
.messages(
tg.user("Say test")
)\
.stream(False)\
.send()
return result.text()Source: teamkillerx.github.io/tgcore/
PyPi: https://pypi.org/project/tgcore/
🤣2
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/