Build a KakaoTalk Chatbot in Python

Setup Hosting for Bot

First, create an account on BotHub.Studio, a chatbot hosting service for developers, and install CLI tool using the command below:

$ pip install bothub-cli

Run configure next:

$ bothub configure

Create a project directory:

A template code will be generated after init finished.

$ mkdir MyBot
$ cd MyBot
$ bothub init

Now we connect with ‘KakaoTalk’ channel:

$ bothub channel add kakao

The ‘URL’ that is result of command will be used ‘KakaoTalk’ setting page:

And deploy the project to server:

$ bothub deploy

Creating a KakaoTalk Plus Friend Bot

1. Connect to ‘KakaoTalk Plus Friend’ webpage:

2. Log-in with Kakao ID/Password:

3. Create ‘Plus Friend’:

4. Change ‘KakaoTalk Plus Friend’ to public:

5. Create ‘KakaoTalk SmartChatting’ App:

1) Select the ‘SmartChatting’ tab.

2) Click ‘Setting’ button for API style

3) Input App Name and App Description as you want

4) Paste URL from ‘BotHub.Studio’ channel connection result to App URL

5) Check the personal information agreement and register phone number

6) Click the save button

7) Click the ‘Start’ button to start service

6. ‘KakaoTalk SmartChatting’ App Test

Let’s try to test with ‘KakaoTalk SmartChatting’.

You can find a app by searching registered ‘App Name’ at the ‘Chatting’ tab and communicate with Bot.

Should you have any questions, please feel free to contact bothub@bothub.studio anytime.

Like what you read? Give Yeonho Park a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.