作者如何用 Claude Code 智能體在 Telegram 羣組追蹤黑客松截止日期
How I use a Claude Code agent in Telegram to track my hackathon deadlines
作者以 Claude Code 智能體配合 Telegram 羣組,追蹤五個黑客松的截止日期並核查提交要求。智能體按作者所在時區由最早期限開始列出事項,並檢查 GitHub 儲存庫和示範網站;Python 腳本負責日期計算及要求檢查。程式碼位於 github.com/mohammedfirdouss/hackathon-copilot;Switch 暫未支援定時發送訊息,作者目前需要主動詢問。
This month I'm entering five hackathons. Each one has a different deadline, a different timezone and different rules. I kept forgetting what was due first.
So I built a helper. It's a Claude Code agent in my Telegram group. I ask it "what's due?" and it lists my deadlines in my own timezone, soonest first. I ask "is bountypay ready?" and it checks my GitHub repo and my demo site, then tells me what is still missing. When I finish something, I tell it, and it updates its list.
The code is here: github.com/mohammedfirdouss/hackathon-copilot
What Switch does
Switch is an open-source tool. It connects AI agents to chat apps like Slack, Discord and Telegram.
Switch does not give you an agent. You bring your own, like Claude Code. When someone messages the agent in the chat, Switch starts it on your computer and passes the messages back and forth.
So Claude Code runs on my laptop, and I talk to it from Telegram on my phone.
How it works
The project has three main files.
-
hackathons.tomlis my list of hackathons. Each one has a deadline, a repo and a list of things I must submit. -
copilot.pyis a small Python script. It works out how much time is left and checks each requirement. For example, it checks if the repo is public, if it has a license, and if the demo site is up. -
CLAUDE.mdtells the agent what to do. It says: always use the script for dates and checks, keep replies short, and never submit forms or post anything for me.
The script does the maths, so the dates are always right. The agent understands my question and explains the answer.
How to set it up
You need Python, Node.js, the GitHub CLI, a Claude Code account and a Telegram account with a username.
- Install Switch Console from the releases page.
- Click Add a server, then Run a server on this computer. Wait about a minute.
- In Telegram, open @BotFather and send
/newbotto make a bot. Save the token somewhere safe. - In BotFather, turn Group Privacy off for your bot.
- In Switch Console, connect Telegram using the bot token and username.
- Make a Telegram group and add the bot to it.
- Send a message in the group. Then, in Switch Console, click Link my account and choose yourself.
- In Switch Console, create a Claude Code agent. Set its folder to the project folder.
- In the group, send
!invite-agent @your-agent-name, then!set-alias @your-agent-name @copilot.
Now send @copilot what's due?
Mistakes I made
I changed Group Privacy too late. Turn it off before you add the bot to a group. If you forget, remove the bot and add it again.
I added the bot before connecting it. Connect the bot in Switch first, then add it to the group.
I couldn't find myself when linking my account. Switch only knows people who have sent a message in the group. Send a new message, then search again.
The agent ignored my instructions. It was running in an empty default folder, so it never saw my CLAUDE.md. I fixed it by linking that folder to my project folder. If your agent acts strangely, check which folder it runs in.
My lines got merged into one paragraph. Telegram joined my lines together. Starting each line with - fixed it.
What's next
I want a morning message with my deadlines. Switch can't schedule messages yet (issue #771), so for now I have to ask.
If you have many deadlines too, copy the repo, put your own hackathons in hackathons.toml, and connect it to Switch.
來源:DEV Community · dev.to

