Rᴇɴᴅʏ Pʀᴏɪᴇᴄᴛs
225 subscribers
1.04K photos
29 videos
17 files
743 links
tgcore is open source. Built for production Telegram apps.

https://github.com/TeamKillerX/tgcore/
Download Telegram
Rᴇɴᴅʏ Pʀᴏɪᴇᴄᴛs
ev result = await tg.use.default\ .route("gemini", "gemini-2.5-flash")\ .inputs("My name is TgCore\nDX (developer experience)")\ .send(via_result=True) return result.text(gemini=True)
OUTPUT:
Hello TgCore! Nice to meet you.

DX (Developer Experience) is a fantastic and crucial topic.

What's on your mind regarding DX? How can I help you explore it further or what are you looking to discuss today?
result = await tg.use.default\
.route("gemini", "gemini-2.5-flash")\
.contents(
[
tg.getkwargs(
parts=[tg.getkwargs(text="lu siapa keren?")]
)
]
)\
.system_instruction(
tg.getkwargs(
parts=[tg.getkwargs(text="kamu adalah TgCore komedi lucu")]
)
)\
.generationConfig(
tg.getkwargs(
temperature=1.0,
topP=0.8,
topK=10
)
)\
.send(via_result=True)

return result.text(gemini=True)
Before vs After
ev resp = await tg.raw.chatCompletions()\
.model("kimi-dev")\
.messages(
[tg.getkwargs(
role="user",
content="what your name?"
)]
)\
.stream(False)\
.send()

kb = tg.kb.inline()\
.url("Me", "https://t.me/" + c.me.username).build()

await tg.raw.sendMessage()\
.chat_id(m.chat.id)\
.text(resp.text())\
.reply_markup(kb)\
.skip()
My name is Kimi. Nice to meet you!
Mode 1: coder easy
msg = tg.msg.core("What your mame")

p = await tg.ai.groq(
model="moonshotai/kimi-k2-instruct-0905",
messages=[msg]
).send()

return p.text()

Mode 2: Hidden hard
msg = tg.msg.core("What your mame")

p = await tg.ai.groq(
model="moonshotai/kimi-k2-instruct-0905",
).messages([msg]).send()

return p.text()

Mode 3: fluent builder extreme
p = await tg.ai.groq().model("moonshotai/kimi-k2-instruct-0905").messages([msg]).send()

return p.text()
ev 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
)
)\
.pretty()
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 ✅
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
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 request
Regular bot = abstraction
TgCore = control

🔥 TL;DR
• Want fast & standard use regular library
• Want a flexible & scalable backend TgCore is more suitable
🤣1
This media is not supported in your browser
VIEW IN TELEGRAM