Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • added additional telegram tools & docs

Type of Change

  • New feature

Testing

Manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Oct 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Oct 14, 2025 10:33pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Summary

This PR expands the Telegram integration by adding five new tools (send photo, video, audio, animation, and delete message) alongside comprehensive documentation.

Key Changes

  • Added operation dropdown to Telegram block with conditional fields for each tool type
  • Implemented new tools: telegram_send_photo, telegram_send_video, telegram_send_audio, telegram_send_animation, telegram_delete_message
  • Refactored telegram_message tool with improved response structure
  • Updated type definitions with union type TelegramResponse for all response types
  • Added detailed documentation for all tools with input/output specifications

Critical Issues Found

  • Import path errors in index.ts - imports reference non-existent file names (audio, delete, photo, video instead of send_audio, delete_message, send_photo, send_video), causing module resolution failures
  • Type mismatch for messageId - defined as number in types.ts but used as string throughout delete_message tool and block config

Style Issues

  • Multiple files use Record<string, any> type assertion violating project type safety guidelines

Confidence Score: 0/5

  • This PR has critical runtime errors that will prevent the telegram tools from loading
  • Score reflects two critical bugs: (1) import path errors in index.ts will cause module resolution failures preventing all telegram tools from loading, and (2) messageId type mismatch between types.ts (number) and implementation (string) will cause type errors. These must be fixed before merge.
  • apps/sim/tools/telegram/index.ts (critical import errors), apps/sim/tools/telegram/types.ts (messageId type mismatch)

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/tools/telegram/index.ts 0/5 critical import path errors will cause runtime failures when loading telegram tools
apps/sim/tools/telegram/types.ts 1/5 messageId type mismatch (number vs string) will cause type errors across telegram tools
apps/sim/tools/telegram/delete_message.ts 3/5 new delete message tool implementation, type inconsistency with messageId parameter
apps/sim/tools/telegram/send_photo.ts 4/5 new photo sending tool, uses Record<string, any> instead of proper types
apps/sim/tools/telegram/send_video.ts 4/5 new video sending tool, uses Record<string, any> instead of proper types
apps/sim/tools/telegram/send_audio.ts 4/5 new audio sending tool, uses Record<string, any> instead of proper types
apps/sim/tools/telegram/send_animation.ts 4/5 new animation sending tool, uses Record<string, any> instead of proper types

Sequence Diagram

sequenceDiagram
    participant User
    participant Block as Telegram Block
    participant Registry as Tool Registry
    participant Tool as Telegram Tool
    participant API as Telegram Bot API

    User->>Block: Select operation (message/photo/video/audio/animation/delete)
    Block->>Block: Validate parameters based on operation
    Block->>Registry: Request tool via config.tool(params)
    Registry->>Tool: Route to specific tool (telegram_message, telegram_send_photo, etc.)
    Tool->>Tool: Build request body with botToken, chatId, content
    Tool->>API: POST to Telegram API endpoint
    API-->>Tool: Response with message data or deletion status
    Tool->>Tool: Transform response (success, message, data)
    Tool-->>Block: Return formatted output
    Block-->>User: Display result with message_id, chat info, timestamps
Loading

12 files reviewed, 6 comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 force-pushed the feat/telegram-extended branch from 2e4c19b to 5b92fb0 Compare October 14, 2025 22:31
@blacksmith-sh blacksmith-sh bot deleted a comment from waleedlatif1 Oct 14, 2025
@waleedlatif1 waleedlatif1 merged commit f147eae into staging Oct 14, 2025
9 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/telegram-extended branch October 14, 2025 22:34
Sg312 pushed a commit that referenced this pull request Oct 15, 2025
* feat(telegram): added delete message,send photo-video-audio-animation tools

* fix: updated Telegram tool types and removed debug logs

* reverted telegram message tool to older name

* added docs for telegram

* updated telegram docs

---------

Co-authored-by: SimplyRohit <rohitjaatjaat073@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants