Socket
Book a DemoInstallSign in
Socket

octoba-io-app

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

octoba-io-app

Octoba bot application

0.0.2
latest
Source
npmnpm
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Octoba Application - easy way to create bots in Telegram.

Before we start I want to create my view of this framework. The main goal is to give for developers a perfect tool to create bots (crud included) for Telegram. I'm not a pro with NodeJS, but I love Telegram and Telegram bots as well. So, let's dive into application.

Requirements

To install and use this tool, you need to stick to these requirements:

  • NodeJS: v10.3.0 or newer
  • NPM: v6.5.0 or newer

We use Octoba and Telegraf Frameworks as a sub-layers of our application.

  • You need to install package npm i --save octoba-io-app
  • Read more in documentation.

Documentation

Setup local environment

  • Copy .env-example to .env
  • Open .env and paste bot token BOT_TOKEN=... which you can receive from @BotFather
  • Run npm i to install all package dependencies.
  • Run npm start to start bot.

That's it!

Localizations

Localizations for your application located in ./locales folder. If you need to add new localization you may easy do it by adding new locale configuration. To do that you need to create a new {name}.yaml file where name is a locale. To use some locale as default you need to edit key APP_LANG from en (default locale) to new one.

Application configuration

Okay. Now we need to configure our application. In the root folder of the project you can see ./config.js file. This is the main config file of our feature bot. Let's dive into configuration!

./config.js API

  • lang - language of application (default en).

  • bot_token - Telegram Bot Token.

  • langsFolder - location of your locales. If you want to change directory of locales, you can config it here.

  • timezone - application timezone.

  • formatDate - default dates format.

  • middleware - array of middlewares.

  • commands - commands which bot can handle. Default commands: start and help.

  • hears - hears (keyboard clicks) which bot can handle.

  • scenes - scenes which bot can handle.

  • actions - actions (inline keyboard clicks) which bot can handle.

  • paginator - default pagination options. page - default loading page (Default value: 1) per_page - default items on page (Default value: 5)

  • scenarios - has models and keyboards sections. models - object of {name: value} where name - name of model and value is model config. keyboards - object of {name: fn(app)} where name is a name of keyboard and fn(app) is a function to return keyboard settings.

Want to help us?

If you have ideas to improve application or you have noticed some issues, let us know. Of course, pull requests are extremely welcome!

Contributors

Keywords

octoba

FAQs

Package last updated on 16 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.