Lol can you imagine?
import { Bot, Command, Message, InlineKeyboard, Button, useChat, useState } from 'telegram-react';
function CounterBot() {
const [count, setCount] = useState(0);
const chat = useChat(); // current chat context
return (
<Command name="counter">
<Message>
Count: {count}
</Message>
<InlineKeyboard>
<Button onClick={() => setCount(c => c - 1)}>➖</Button>
<Button onClick={() => setCount(c => c + 1)}>➕</Button>
</InlineKeyboard>
</Command>
);
}
// Multi-step flows become trivial
function OnboardingFlow() {
const [step, setStep] = useState(0);
if (step === 0) return <NamePrompt onComplete={() => setStep(1)} />;
if (step === 1) return <EmailPrompt onComplete={() => setStep(2)} />;
return <Confirmation />;
}