Description
KakaotalkBotHub is an application that supports KakaoTalk Bot and Hub(similar to a GitHub) for KakaoTalk Bot.
Bot production methods include programming in JavaScript and setting simple keyword auto-response.
Preview
You can see preview apk & image at Google Playstore
Main Function
function response(room, msg, sender, isGroupChat, replier, ImageDB, package) {
/*
@String room: Returns the name of the room that received the message
@String sender: Returns the name of the person who sent the message
@Boolean isGroupChat: Returns whether the room that received the message is a group chat room (open chat room is treated as a group chat room)
@Object replier: Return Object containing the action of the room that received the message
@Object ImageDB: Return Object containing image related data
@String package: Return the package name of the application that received the message
*/
}
Main Function Argument Description
@replier
replier.reply(msg: String) //Sends msg.
replier.reply (room: String, msg: String) //Send msg to the room named room.
replier.replyShowAll(msg1: String, msg2: String) //msg1 is visible and msg2 is sent visible only when the full view button is pressed.
replier.replyShowAll(room: String, msg1: String, msg2: String) //In a room called room, msg1 is just visible, and msg2 is sent to be visible only when the full view button is pressed.
@ImageDB
ImageDB.getProfileImage() //Encodes the profile picture of the other person who received the message in KakaoTalk as Base64 and returns it.
ImageDB.getPicture() //Encodes the last photo received in KakaoTalk as Base64 and returns. (Default : null)
/*
If you use replier.reply(ImageDB.getPicture()), the error data parcel size ~~~ bytes may occur.
In this case, the base64 value of the picture is too long and it is an error in the process of sending it to KakaoTalk, so if you receive Base64 as a small photo and send it, it will work.
*/
JavaScript APIs
Log
d(name: String, content: String)
e(name: String, content: String)
i(name: String, content: String)
AppData
putInt(name: String, value: Int)
putString(name: String, value: String)
putBoolean(name: String, value: Boolean)
getInt(name: String, _null: Int): Int
getString(name: String, _null: String): String?
getBoolean(name: String, _null: Boolean)
clear()
remove(name: String)
Api
getContext(): android.content.Context
Device
getBattery(): Int
getPhoneModel(): String
getAndroidSDKVersion(): String
getAndroidVersion(): String
getIsCharging(): Boolean
Scope
get(name: String): ScriptableObject?
File
read(path: String, _null: String): String
write(path: String, content: String)
append(path: String, content: String)
remove(path: String)
Black
getSender(): String
getRoom(): String
addRoom(room: String)
addSender(sender: String)
removeRoom(room: String)
removeSender(sender: String)
Utils
post(address: String, name: String, data: String)
deleteHtml(html: String): String
makeToast(content: String)
makeNoti(title: String, content: String
getHtml(link: String, fromJsoup: Boolean = true): String?
makeVibration(time: Int)
copy(content: String)
Bot
compile(name: String)
compileAllScripts()
getAllCompiledScripts(): ???
replyRoom(room: String, message: String)
replyRoomShowAll(room: String, msg1: String, msg2: String)
powerOn(name: String)
powerOff(name: String)
JavaScript Example
function response(room, msg, sender, isGroupChat, replier, ImageDB, package) {
switch(package){
case "com.kakao.talk" :
replier.reply("Received a message from KakaoTalk");
break;
default :
replier.reply("Receive message from" + package);
}
if(msg == "My Profile Image") {
replier.reply("This is the result of Base64 encoding " + sender + "`s profile picture.\n\n" + ImageDB.getProfileImage());
}
}
Release Notes
Google PlayStore Link
Supported Messenger
List of confirmed working messengers as of 2019.07.03
- KakaoTalk
- Telegram
- Message (text)
- Line
- Facebook Message
Functions of Hub
- Upload, edit and delete posts
- Write, edit and delete comments
- JavaScript question and answer
- Point system (reflected by level)
- Level ranking system
- New post and comment notification service
- Etc...
LICENSE
Special Thanks
PartWorm