Skip to content

up2code/kafra-line

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kafra-line

Ragnarok mobile LINE bot helper for display some useful information or ask item price from exchange.

Also you can customize this bot for other game or as you want.

This project just made for fun and for study how to create own LINE bot.

Video demo: https://www.youtube.com/watch?v=6zaEf3WksLg

Requirement

  • Heroku - For deploy bot. Or you can use your own server if you have one. But for this I'll use Heroku for reference.
  • Firebase - Easy to use for backend server. I had used this for store bot condition and answers.
  • LINE Developer - Register and follow instruction for create channel

Setup Heroku environment variable

Access your Dyno and check at tab settings and Reveal Config Vars. you can set environment variable here

Key Meaning
CHANNEL_ACCESS_TOKEN Your LINE Channel access token
CHANNEL_SECRET Your LINE Channel secret
FIREBASE_ACCOUNT service.account.json content. Check in Firebase Admin SDK instruction.

Deploy as your own LINE bot

  • Deploy to Heroku. You can check instruction here.
  • On LINE Developer console at Messaging settings. Enable Use webhooks.
  • Webhook URL: https://{your_heroku_app_name}.herokuapp.com/callback.
  • If you wish your bot can join group chats. Then enable Allow bot to join group chats.

Global config

Any config can put here as you want. You can overwrite global_config.json via Firebase too. Sample structure is in sample/app.json. Restart is need for update config.

Usage

Query item from poporing.life

type $ and follow with part of item name. (Ex. $biotite, $cyfar, $twister)

Query item from romexchange.com

type $$ and follow with part of item name. (Ex. $$biotite, $$cyfar, $$twister)

Command

type ! and follow command text. (See below for how to add your custom command)

Add your own custom bot commands/answers

You need to add commands and answers in firebase database with 2 collection.

  • chat : For response and answer normal chat.
  • ref : List of bot command

Check in sample directory for example values and response template.

Credit source information

Reference

About

Ragnarok mobile LINE Bot helper

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published