Giter Site home page Giter Site logo

stack-exchange-bot's Introduction

Stack Exchange Telegram Bot

Build Status codecov Known Vulnerabilities GitHub issues FOSSA Status

A Telegram bot to explore the Stack Exchange API. Built with Claudia.js.

Installation and Configuration

Create the Telegram bot

Create a new bot by talking to BotFather and following a few simple steps. You will get an authorization token.

Setup Node.js version for local development/testing

Claudia.js v.5.10.0+ deploys your lambda on AWS Lambda and configures it to be executed on a Node.js 12.x environment.

When testing your lambda locally, be sure to use the same Node.js version. I included a .nvmrc file in the repo, so if you use nvm you just have to type:

nvm use

Since this project includes a .nvmrc file, the same Node.js version will be used on Travis CI.

Install dependencies

Install both production and development dependencies:

yarn

First deployment

The first time you deploy your bot, you will need to create an API on AWS API Gateway, create a lambda on AWS Lambda, create a security role on AWS Identity and Access Management (IAM), setup policies for your lambda to use other AWS services such as S3 or DynamoDB.

You can do all of the above with this command:

yarn bot:create

Configure the bot

Now that the bot is deployed on AWS, you need to configure it with the authorization token that BotFather gave you.

yarn bot:configure-telegram  # type access token when prompted

Development

Whenever you want to deploy a new version of the bot, run one of these commands:

yarn bot:update:dev  # development
yarn bot:update:prod && yarn api:release  # production

Note: You can invoke npm Task List with: yarn menu to avoid typing the commands.

Typescript type definitions

At the moment claudia-api-builder and claudia-bot-builder don't ship their type definitions. I included some type definitions in the @types directory. They are ok for the current needs of this project, but they are incomplete. Don't rely on them too much.

License

FOSSA Status

stack-exchange-bot's People

Contributors

fossabot avatar jackdbd avatar

Watchers

 avatar  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.