Skip to content

Instantly share code, notes, and snippets.

@anttti
Last active February 16, 2017 08:16
Show Gist options
  • Save anttti/2b0b22bedc7df81e6377026490822ef6 to your computer and use it in GitHub Desktop.
Save anttti/2b0b22bedc7df81e6377026490822ef6 to your computer and use it in GitHub Desktop.
looby-bots-guide

Looby Bot Wurksup

Bots everywhere

Telegram-botin rekisteröinti

  • Avaa chat käyttäjän Botfather kanssa
  • Kirjoita /newbot luodaksesi uuden botin
  • Komenna /help nähdäksesi kaikki Botfatherin tarjoamat toiminnot

Node-projektin aloitus

  • mkdir foo-project
  • cd foo-project
  • npm init (tai nopeammin npm init -y)

Bottikirjaston asennus

  • npm install node-telegram-bot-api --save

Gitin käyttöönotto

  • git init

.gitignoren luonti

Tee tiedosto nimeltä .gitignore seuraavalla sisällöllä:

node_modules/

Heroku-sovelluksen luonti

  • heroku login
  • heroku apps:create MYAPPNAME

Procfilen luonti

Tee tiedosto nimeltä Procfile seuraavalla sisällöllä:

web: node bot.js

Deployaus Herokuun

  • git add .
  • git commit -m "Kekkonen"
  • git push heroku master

Hyödyllisiä Node-moduleja

Avoimia rajapintoja

Esimerkit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment