diff --git a/.claude/settings.local.json b/.claude/settings.local.json
index 88ad625..8cfd52a 100644
--- a/.claude/settings.local.json
+++ b/.claude/settings.local.json
@@ -1,30 +1,17 @@
{
"permissions": {
"allow": [
- "Bash(bun add:*)",
- "Bash(bun test:*)",
- "Bash(bun run:*)",
- "Bash(bun info:*)",
- "Bash(npm view:*)",
+ "Bash(bun:*)",
"Bash(find:*)",
- "Bash(bun remove:*)",
- "Bash(bunx tsc:*)",
"Bash(rm:*)",
"Bash(grep:*)",
- "Bash(git add:*)",
- "Bash(git commit:*)",
- "Bash(bun tsc:*)",
"Bash(ls:*)",
- "Bash(bun x tsc:*)",
- "Bash(bun:*)",
"Bash(mkdir:*)",
"Bash(cp:*)",
"Bash(rg:*)",
"Bash(mv:*)",
- "Bash(gh workflow:*)",
- "Bash(gh run list:*)",
- "Bash(gh run view:*)",
- "Bash(git push:*)"
+ "Bash(gh:*)",
+ "Bash(git:*)"
],
"deny": []
}
diff --git a/packages/examples/src/useeffect-interval.tsx b/packages/examples/src/useeffect-interval.tsx
new file mode 100644
index 0000000..a572810
--- /dev/null
+++ b/packages/examples/src/useeffect-interval.tsx
@@ -0,0 +1,89 @@
+///
+
+ Seconds elapsed: {count}
+
+
+ Status: {isRunning ? '🟢 Running' : '🔴 Paused'}
+
+
+
+
+ This example demonstrates useEffect with setInterval. + The timer automatically increments every second and properly + cleans up when paused or when the component unmounts. ++ > + ); +}; + +// Main bot setup +async function main() { + // You'll need to set these environment variables + const config = { + apiId: parseInt(process.env.API_ID || '0'), + apiHash: process.env.API_HASH || '', + botToken: process.env.BOT_TOKEN || '', + storage: process.env.STORAGE_PATH || '.mtcute' + }; + + if (!config.apiId || !config.apiHash || !config.botToken) { + console.error('Please set API_ID, API_HASH, and BOT_TOKEN environment variables'); + process.exit(1); + } + + const adapter = new MtcuteAdapter(config); + + // Set up command handler for timer + adapter.onCommand('timer', () =>