Search the Community
Showing results for tags 'telegram'.
-
Hi ProcessWire community! π I'm excited to share a new module I've been working on: TeleWire - a Telegram notifications module that brings instant messaging capabilities to your ProcessWire sites. The Problem with Current Notification Solutions After running several e-commerce sites and experimenting with different notification systems, I've encountered these recurring issues: π§ Email (SMTP/WireMail): Requires SMTP server configuration (WireMailSMTP) Google App Passwords setup complexity Emails constantly landing in spam folders Delayed delivery (sometimes 5-10 minutes) No guarantee the recipient will see it quickly π± SMS (Twilio, etc): Monthly fees just to keep a phone number active (~$1-15/month) Per-message charges (can add up quickly) US compliance requirements (verification, regulations) Not everyone wants to share their phone number π¬ WhatsApp Business API: Requires business verification Complex setup process API fees and restrictions Limited to business accounts π Push services (Pushover, etc): Requires purchasing apps ($5-10 per platform) Recipient needs to install and configure the app Additional barrier to entry Why Telegram? π Completely free - No monthly fees, no per-message charges, no app purchases π Widely available - Free to download on any platform, 900+ million users worldwide β‘ Instant delivery - Messages arrive in 1-2 seconds, not minutes π― Low barrier to entry - Just "install the free app and start a chat with the bot" vs "pay $5" or "give me your phone number" π Reliable - No spam filters, no deliverability issues, no carrier restrictions π± Multi-platform - iOS, Android, Web, Desktop - works everywhere π¨ Rich features - HTML formatting, emojis, photos, documents, links Key Features π Send text notifications with HTML/Markdown formatting πΈ Send photos and documents π₯ Support for multiple recipients (users and groups) π§ Simple admin interface with test button π Optional logging and debug mode β‘ Optimized performance with configurable timeouts π― Easy to integrate with hooks Real-World Use Cases E-commerce order notifications: $wire->addHookAfter('FormBuilderProcessor::processInputDone', function($event) { $form = $event->object; if($form->name === 'order-form') { $telewire = $this->modules->get('TeleWire'); $message = 'π <b>New Order</b>' . "\n\n"; $message .= 'π€ Customer: ' . $form->get('customer_name')->value . "\n"; $message .= 'π° Total: $' . $form->get('total')->value; $telewire->send($message); } }); Failed login attempts monitoring: $wire->addHookAfter('Session::loginFailed', function($event) { $telewire = $this->modules->get('TeleWire'); $name = $event->arguments(0); $message = 'β οΈ <b>Failed Login Attempt</b>' . "\n\n"; $message .= 'Username: ' . $name . "\n"; $message .= 'IP: ' . $this->session->getIP(); $telewire->send($message); }); Content updates: $wire->addHookAfter('Pages::saved', function($event) { $page = $event->arguments(0); if($page->template == 'article' && !$page->isNew()) { $telewire = $this->modules->get('TeleWire'); $message = 'π <b>Article Updated</b>' . "\n"; $message .= 'Title: ' . $page->title . "\n"; $message .= 'By: ' . $this->user->name; $telewire->send($message); } }); Send photos with captions: $telewire = $modules->get('TeleWire'); // Product photo when new product added $telewire->sendPhoto( $page->images->first()->httpUrl, "New product: {$page->title} - \${$page->price}" ); Send documents (invoices, reports): $telewire = $modules->get('TeleWire'); // Send generated PDF invoice $telewire->sendDocument( '/site/assets/invoices/invoice-123.pdf', 'Invoice #123 for Order #456' ); Installation Get a bot token from @BotFather on Telegram (takes 30 seconds) Install the module from GitHub Configure your bot token and chat IDs Click "Send Test Message" to verify everything works Requirements: PHP 8.2+ and ProcessWire 3.0.210+ Admin Interface Features The configuration page includes: β Real-time connection status indicator π§ͺ One-click test message button (AJAX, no page reload) βοΈ Configurable parse mode (HTML/Markdown/MarkdownV2) π Optional logging with debug mode for troubleshooting β±οΈ Adjustable API timeouts π Silent mode option (no notification sound) π Message length handling (auto-split long messages) Production Ready This module is currently running on several production sites: π« E-commerce shop - order notifications, stock alerts π· Wine/liquor business - order confirmations, delivery updates π° News portal - content publishing notifications Average response time: ~150-300ms per notification Getting Your Chat ID Find @userinfobot in Telegram Send any message - it will reply with your Chat ID Important: Start conversation with your bot by sending /start Enter the Chat ID in module configuration For groups: Add the bot to your group, make it admin, and use the negative Chat ID API Documentation // Get module instance $telewire = $modules->get('TeleWire'); // Simple text message $telewire->send('Hello from ProcessWire!'); // HTML formatted message $message = '<b>Bold</b> <i>italic</i> <code>code</code>'; $telewire->send($message); // Send with custom options $telewire->send('Silent notification', [ 'disable_notification' => true, 'parse_mode' => 'Markdown' ]); // Send photo $telewire->sendPhoto('/path/to/photo.jpg', 'Optional caption'); // Send document $telewire->sendDocument('/path/to/file.pdf', 'Document caption'); Feedback Welcome! I'd love to hear your thoughts, use cases, and suggestions. If you've been frustrated with email deliverability or SMS costs for notifications, give this a try! GitHub: https://github.com/mxmsmnv/TeleWire Thanks to the ProcessWire community for the inspiration and all the great modules that helped me learn the PW module system!
-
Hello I opensourced my Telegram bot called "Voxgram" https://github.com/NinjasCL/voxgram Now you all have an example of working with the Rest Helper and the Python Telegram Framework (I think the my python code is a mess) but anyway here you go :).
-
Hello, I created a simple telegram bot. What it does? it enables you to save your voice messages and send them later using emojis or keywords in your group chats. Just add @voxgrambot in your group chats and search all the public voice messages available using text or emojis. If you want to create a new voice message just send a private message to the bot with the command /new . If you want more info send the command /help. The bot was made using Python and https://python-telegram-bot.org The backend was made using ProcessWire 3.x and my Rest API helper. http://telegra.ph/Voxgram-Telegram-Bot-12-03