Skip to content

Send messages in a slack channel using a event created in the CloudWatch. This functions was deployed with serverless.

Notifications You must be signed in to change notification settings

leonardo-beabr/BeckEtAlBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Beck Et Al Brazilian Bot

Ready

  • Send messages in a slack channel as an Bot;
  • Generate new janitors date;
  • Scheduled functions for specific days and times of day;
  • Get the current Weather with a ZIP code;
  • AWS
    • Serverless integrations to use Lambda Functions
    • CloudWatch Events

Todo

  • Add interactions
  • Add a NLP provier (Assisant, Power Agents, Dialogflow)
  • Remove, add and change users of a base
  • Separate the Schedule Functions. One for current weather and birthdays and another for the janitors. Or all together
  • Local news
  • Random messages structure

Setting up

Slack

  • Go to https://api.slack.com/apps to create a new app;
  • Add name to the and a Development Slack Workspace;
  • In Add features and functionality:
    • Select Incoming Webhooks and turn on to use webHooks (optional);
    • Turn on the Enable Events and add a bot user in Subscribe to bot events, turn on the Always Show My Bot as Online;
    • Go back to Subscribe to bot events and select "Add Bot User Event", select "app_mention" and "messages.im";
    • Install the App in your workspace;
    • Copy the "Bot User OAuth Access Token"
    • Change the .env_sample file to .env and paste in BOT_TOKEN of .env file;
    • Add a name in the BOT_NAME in .env file.

Airtable

  • Go to https://airtable.com/account to generate a API key, copy and paste in API_KEY_AIRTABLE of .env file;
  • Create a new base from scratch;
  • See the template of the Airtable here;
  • Go to the Airtable API https://airtable.com/api to select your base;
  • In the section Authentication copy the id of the base and paste in the AIRTABLE_BASE of the .env file
  • In thei project we used the Office Duties and Birthday tables (see in Airtable.js file)
  • Check the sample of the base here;

Serverless

  • Create an account in the AWS
  • Create a IAM user and copy the key and secret ids
  • Install the serverless
  • run the command: serverless config credentials -o --provider aws --key {your_key_id} --secret {your_secret_id}
  • Than run the command yarn deploy or npm run deploy

Scripts

Run with nodemon

yarn dev

or

npm run dev

Deploy to AWS

yarn deploy

or

npm run deploy

Deploy to AWS

yarn deploy

or

npm run deploy

Deploy to AWS

yarn deploy

or

npm run deploy

Invoke function

serverless invoke -f everyday -l

About

Send messages in a slack channel using a event created in the CloudWatch. This functions was deployed with serverless.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published