TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Build a WhatsApp Chatbot with Python, Flask and Twilio

183 pointsby makaimcover 5 years ago

11 comments

namanaggarwalover 5 years ago
I really didn&#x27;t like the WhatsApp approach on this. Basically only partnering with few big vendors like twilio and then asking people to build apps via them (by basically paying for it).<p>Other apps like telegram allows anyone to directly interact with them
评论 #21585005 未加载
评论 #21584679 未加载
评论 #21585155 未加载
评论 #21584866 未加载
评论 #21584898 未加载
评论 #21604007 未加载
评论 #21584812 未加载
评论 #21587512 未加载
air7over 5 years ago
This is nice but quite expensive. Up to 0.09$ per message inbound or outbound!<p>Pricing for Template messages<p>Outbound template messages to WhatsApp destinations have two different components:<p>Edit: Here&#x27;s the price breakdown. [0] &gt; Twilio charges a flat fee of $0.005 per message for all WhatsApp messaging. This applies to all incoming messages, outbound Template and Session messages. &gt; WhatsApp also charges a per-message fee to send outbound Template messages. This fee may vary, depending on the destination country or region.<p>The second fee varies wildly up to 0.09$ in Germany! [1]<p>[0] <a href="https:&#x2F;&#x2F;support.twilio.com&#x2F;hc&#x2F;en-us&#x2F;articles&#x2F;360037672734-How-Much-Does-it-Cost-to-Send-and-Receive-WhatsApp-Messages-with-Twilio-" rel="nofollow">https:&#x2F;&#x2F;support.twilio.com&#x2F;hc&#x2F;en-us&#x2F;articles&#x2F;360037672734-Ho...</a> [1] <a href="https:&#x2F;&#x2F;developers.facebook.com&#x2F;docs&#x2F;whatsapp&#x2F;pricing&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developers.facebook.com&#x2F;docs&#x2F;whatsapp&#x2F;pricing&#x2F;</a>
评论 #21604019 未加载
评论 #21586178 未加载
评论 #21586163 未加载
3riverdevover 5 years ago
Hey all, I&#x27;m the engineering manager for teams at Twilio responsible for WhatsApp integration, among other channels. We&#x27;re more than happy to answer any technical or general questions -- fire away with replies. Will keep an eye on it today.
评论 #21602417 未加载
评论 #21587509 未加载
评论 #21585985 未加载
评论 #21586110 未加载
aacookover 5 years ago
I&#x27;m about to release a bot for Whatsapp for NanaGram (<a href="https:&#x2F;&#x2F;nanagram.co" rel="nofollow">https:&#x2F;&#x2F;nanagram.co</a>). Amped!<p>The user experience of SMS-first products is novel and fun. There&#x27;s something magical about snapping a photo and just texting it to a unique NanaGram number powered by Twilio. It takes just a couple seconds. I&#x27;m excited to deliver the same experience through Whatsapp to customers around the globe and people on wifi.<p>Building NanaGram SMS-first has been a challenge. There have been all kinds of gotchas:<p>1) AT&amp;T started blocking any number permanently across its network last January if it contains a hyperlink or email address, even if the customer interacts with the number. I had to create separate messages just for the 12.5% AT&amp;T users.<p>2) Twilio only works when you have cell service. If you&#x27;re indoors with wifi only, the text won&#x27;t go through.<p>3) Images are downsized in an unpredictable way by the carriers. If you&#x27;re sending 1 or a couple images, they&#x27;re pretty good quality. If you send ~5+ photos, they get downsized pretty far and luckily they&#x27;re still good enough for 4x6 photo printing. Certain carriers like cricket are super aggressive with downsizing.<p>4) When Apple users with iCloud enabled share more than 1 image, it generates a sharing album which has been a beast to support. Then there&#x27;s the added challenge of Apple&#x27;s recent move to HEIC&#x2F;HEIF images.<p>5) Twilio doesn&#x27;t support group threads (WhatsApp doesn&#x27;t yet, either)<p>... I could go on and on.<p>Getting approval from Whatsapp took a while. I first applied about a year ago and didn&#x27;t hear anything, then applied again and was approved a few weeks ago. I&#x27;m guessing the approval layer is to ensure only high-quality bots make the cut. They also have an approval layer for all of your messages sent outside a 24-hour window of the last user interaction. The approval for that took a few days.<p>Integration with WhatsApp has been surprisingly easy. I basically just had to change &quot;+1{number}&quot; to &quot;whatsapp+1{number}&quot;
评论 #21586303 未加载
评论 #21587979 未加载
ericmarcosover 5 years ago
Chatbots on Whatsapp are kind of hard from a UX point of view because the platform don&#x27;t support rich elements like buttons or webviews (unlike Facebook messenger). I hope Whatsapp adds these kind of features soon, otherwise users will get frustrated when interacting with bots and never use it to talk to businesses again. And no, AI&#x2F;NLP is not the answer to this because users are lazy and prefer to tap on buttons than to write 20 characters... I know this because I&#x27;m the creator of Botonic (a React-based conversational framework) and we&#x27;ve been building conversational apps on Whatsapp and other platforms for years. By the way, if anyone is interested in access to the Whatsapp Business API beta feel free to drop me a line at eric@botonic.io
评论 #21586090 未加载
评论 #21586106 未加载
sixhobbitsover 5 years ago
wow this is by Miguel Grinberg who is the author of some of the best Flask tutorials and books around. Nice to see Twilio is attracting such high quality writers for their blog
评论 #21585088 未加载
mmsimangaover 5 years ago
I am divided about this. In my home country WhatsApp is the Internet (along with Facebook and Twitter). Mobile service providers sell WhatsApp data bundles which are orders of magnitude more affordable than &quot;normal&quot; data bundles. So we all communicate via WhatsApp. We use WhatsApp groups and it works well. News, videos, pictures everything I get by WhatsApp from contacts. IMHO it works well because there is not advertising and no bots spamming us. Some of the groups are noisy but you can mute.<p>I am divided because I like WhatsApp as it is right now. But we are not paying for it and the money has to come from somewhere. Using third party providers like Twilio is probably one way to pay for it. I am divided because having to use Twilio is likely to freeze out developers from my home country. C&#x27;est la vie.
评论 #21585447 未加载
评论 #21585562 未加载
kuuover 5 years ago
This is funny because just today I decided to join Telegram to develop a bot.
评论 #21584792 未加载
评论 #21586456 未加载
yomansatover 5 years ago
The pricing model is:<p>Template Message: $0.0085 WhatsApp fee + $0.005 Twilio fee = $0.0135 [1].<p>WhatsApp Session Message, sent or received: $0.005. A session ends 24h after last user message [1].<p>Compared to just $0.0075 for sending&#x2F;receiving SMS [2].<p>[1]: <a href="https:&#x2F;&#x2F;www.twilio.com&#x2F;whatsapp&#x2F;pricing&#x2F;us" rel="nofollow">https:&#x2F;&#x2F;www.twilio.com&#x2F;whatsapp&#x2F;pricing&#x2F;us</a><p>[2]: <a href="https:&#x2F;&#x2F;www.twilio.com&#x2F;sms&#x2F;pricing&#x2F;us" rel="nofollow">https:&#x2F;&#x2F;www.twilio.com&#x2F;sms&#x2F;pricing&#x2F;us</a>
kwelstrover 5 years ago
In the 90&#x27;s I built an IRC chatbot, at the time users were naive enough to think it was a real person, so I kept adding conversation lines. Over time it grew into thousands of lines and some people came back to the channel just to chat with it. My friends and I had some good laughs, good times heh.
stetsover 5 years ago
Do you have to pay for Twilio for something like this or does that only come in for SMS&#x2F;MMS?