Skip to content
This repository has been archived by the owner on Sep 5, 2021. It is now read-only.

A Slack bot named ReconBolt that sends you spicy Valorant news.

License

Notifications You must be signed in to change notification settings

radiantsgg/valorant-news-slackbot

Repository files navigation

Valorant News Slackbot 🤖

A Slack bot named ReconBolt that sends you spicy Valorant news from https://playvalorant.com/en-us/news/.

Add to Slack

Screenshots


Development

Prerequisites

Create a new slack app https://api.slack.com/apps?new_app=1

Retrieve apps client ID and client Secret and fill in .env

SLACK_CLIENT_ID=''
SLACK_CLIENT_SECRET=''

Add the redirection URL http://localhost:3000/install to your app

Installation

Postgres database required. https://www.postgresql.org/download/

Update knexfile.js with your database information:

module.exports = {
  development: {
    client: 'pg',
    connection: {
      port: 5432,
      host: 'localhost',
      database: 'slackbots',
      user: 'root',
      password: '',
    }
  }
}

Install dependencies

npm install

Migrate database to create required tables

npm run migrate

Start development server

npm run dev

Endpoints

localhost:3000/install

The install endpoint handles OAuth tokens and saves Slack server channel's required information to push messages.

localhost:3000/update

The endpoint is used to trigger a search for new articles. When new articles are found they are pushed to servers. By default the included cron job runs every five minutes.

Deployment

Deploy to your favorite service that runs docker containers. Update knexfile.js and .env with your production database connection information.

To start production mode

npm run start

Built With

  • Knex - A SQL Query Builder for Javascript
  • Axios - Promise based HTTP client for the browser and node.js

Authors

  • James Vansteenkiste - Initial work - jvanst

License

This project is licensed under the MIT License - see the LICENSE.md file for details