Giter Club home page Giter Club logo

generator-line-bot's Introduction

LINE Bot template generator for yeoman

日本語はこちら

This repository contains generator of LINE Bot for yeoman. To use the package, install yeoman and the generator.

npm install -g yo
npm install -g generator-line-bot

This is optimized for Visual Studio Code, I strongly recommend using Visual Studio Code as editor. You can install it from Visual Studio Code download.

Goal

The goal of this project is to let developer start LINE Bot developement super quick. It should be like this.

  1. generate project by yeoman
  2. Open via Visual Studio.
  3. F5 to start debugging.

If you find any issue which doesn't meet this goal, please log issue or PR.

How to use

  1. To generate the application as "MyBot" with C# :
yo line-bot MyBot --csharp
  1. It also supports other languages. Change the last option
  • go
  • nodejs
  • python
  • ruby If you select csharp, it will ask you project type, either Azure Function or Web API. You can specify it as option too.
yo line-bot MyBot --csharp --webapi
  1. It will ask you for ChannelSecret and Token. Pass the correct values.

  1. Open the generated folder via VSCode and you are good to go.
  2. Visual Studio Code will let you know which extension you should install. Follow the instruction and install them as needed.
  3. Simply press F5 will start debug the application.

Other things you need to know

C#

There are two project types. Azure Function or Web API.

Azure Function

  • It is Azure Function v2 application and default port is 7071.
  • make sure you install azure function tools for dotnetcore. For further information, see here

Web API

  • It is dotnet core 2.0 Web API and default port is 5000.

common

  • make sure you install C# extension
  • make sure you install dotnet core 2
  • The template uses Azure Blog Storage for additional features.

Node.js

  • by default, it uses port 3000 when you debug locally. See index.js for more detail.
const port = process.env.PORT || 3000;
app.listen(port, () => {
  console.log(`listening on ${port}`);
});

golang

  • make sure you installed golang
  • make sure you install Go extension.
  • make sure you configured PATH to go command.
  • by default, it uses port 8000 when you debug locally. See .vscode/launch.json for detail.

python

  • makre sure you installed python
  • make sure you install Python extension
  • make sure you configured PATH to python and pip command.
  • by default, it uses port 8000 when you debug locally. see app.py for more detail.
arg_parser.add_argument('-p', '--port', default=8000, help='port')

Ruby

  • makre sure you installed Ruby
  • make sure you installed Ruby extension
  • make sure you configured PATH to Ruby and Gem command.
  • by default, it uses port 4567 when you debug locally. see app.rb for more detail.
set :port, 4567

Other resources

I will write detail step by step blog later.

generator-line-bot's People

Contributors

kenakamu avatar shumach5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.