Package: galactic-messenger
Galactic Messenger 🚀Galactic Messenger is a versatile and efficient Python package designed for sending messages across multiple platforms. It provides seamless integration with popular communication channels such as email, Telegram, and WhatsApp, offering a streamlined solution for message delivery. Built with asynchronous capabilities, Galactic Messenger supports batch requests and delivers optimal performance. 💬📨📱InstallationTo install Galactic Messenger, simply use pip:pipinstallgalactic-messengerUsageHere is an example demonstrating how to use Galactic Messenger to send messages: 📝🚀importasynciofromgalactic_messengerimportsetup_emailfromgalactic_messengerimportsetup_telegramfromgalactic_messengerimportsetup_whatsappasyncdefsend_messages():# Set up emailemail_sender=setup_email("your_email@example.com","your_password")awaitemail_sender({"to":"recipient@example.com","subject":"Hello","message":"This is a test email.",})# Set up Telegramtelegram_sender=setup_telegram("your_telegram_token")awaittelegram_sender({"chatId":"your_chat_id","text":"Hello from Galactic Messenger!",})# Set up WhatsAppwhatsapp_sender=setup_whatsapp("http://your-whatsapp-api-endpoint")awaitwhatsapp_sender({"chatId":"your_group_id","text":"Hello from Galactic Messenger!",})asyncio.run(send_messages())FeaturesEmail ✉️Send plain text emailsSend emails with attachmentsSupports popular email services like Zoho Mail and GmailTelegram 📢Send text messages to Telegram chatsSend images with captions to Telegram chatsSend videos with captions to Telegram chatsWhatsApp 📲Send text messages to WhatsApp groupsSend images with captions to WhatsApp groupsSend videos with captions to WhatsApp groupsBatch Requests 🚀Galactic Messenger seamlessly handles batch requests, allowing you to send multiple messages simultaneously. You can provide an array of messages to the sender functions for efficient batch processing.asyncdefmain():# Sending multiple Telegram messages in a batchtelegram_sender=setup_telegram("your_telegram_token")awaittelegram_sender([{"chatId":"chat_id_1","text":"Message 1",},{"chatId":"chat_id_2","text":"Message 2","imageBytes":open("./image.png","rb").read(),},{"chatId":"chat_id_3","text":"Message 3","videoBytes":open("./video.png","rb").read(),},])# Sending multiple WhatsApp messages in a batchwhatsapp_sender=setup_whatsapp("http://your-whatsapp-api-endpoint")awaitwhatsapp_sender([{"chatId":"chat_id_1","text":"Message 1",},{"chatId":"chat_id_2","text":"Message 2","imageBytes":open("./image.png","rb").read(),},{"chatId":"chat_id_3","text":"Message 3","videoBytes":open("./video.png","rb").read(),},])ConfigurationYou can customize the behavior of Galactic Messenger by setting the following environment variables:📫EMAIL_SERVICE: The email service provider. Choose "zoho" or "gmail". Default: "zoho".⏳BATCH_TOTAL_TIMEOUT: Total timeout in seconds for batch requests. Default: 30.⏰BATCH_CONNECT_TIMEOUT: Connection timeout in seconds for batch requests. Default: 5.⏳SINGLE_TOTAL_TIMEOUT: Total timeout in seconds for single requests. Default: 10.⏰SINGLE_CONNECT_TIMEOUT: Connection timeout in seconds for single requests. Default: 2.ContributingContributions to Galactic Messenger are welcome! If you find a bug, have a suggestion, or want to contribute code, please open an issue or submit a pull request on theGitHub repository.