Giter Club home page Giter Club logo

particlecord's Introduction

Particlecord

Build Status Language

A Discord notification bot that monitors Particle.io events using Node.js

Home UI

Purpose

Particlecord listens to the data stream from Particle.io devices and notifies the user when a particular event occurs. Think of Particlecord as an "API middleman" that filters a real-time data stream from Particle.io and sends smart push notifications through Discord. Devices can also be managed using the Discord bot by setting friendly names, changing alert frequencies, and outputting the status of any device. Particlecord can also easily adapt to your project by modifying the API webhooks in app.js.

Install

As easy as 1, 2, 3.

  1. Clone the repo and enter the directory: git clone https://github.com/rak3rman/particlecord.git && cd particlecord
  2. Install packages: npm install
  3. Run project: npm run start

Usage

Configuration

After the first run of particlecord, a config file will be created in the config folder with path /config.json. This file stores all the environment variables needed for the project, which can be edited when the instance is not running. The config file will be populated with the following default values:

  • "api_port": 3000 Port where the api webserver will accept incoming connections, of type int
  • "webhook_secret": "random_string_here" A random string generated server side for the Discord bot.
  • "discord_bot_token": "random_string_generated_here"
  • "discord_bot_channel": "discord_channel_here"
  • "discord_bot_prefix": "!" The character that the Discord bot listens to. ! is the default, so !help will display the commands.

NOTE: Make sure to stop the instance of particlecord before changing any of these values. If the file is modified while an instance is active, the changes will be overridden.

Running the project

The npm package supports multiple ways to run the project.

  • npm run start Runs the project, plain and simple.
  • npm run develop Starts the project and watches for all file changes. Restarts the instance if critical files are updated. Must have nodemon installed.
  • npm run test Runs a few tests for Travis-CI. Nothing crazy here.

Use ^C to exit any of these instances. Currently, there are no exit commands or words.

Particlecord commands

  • !help Displays all Particlecord commands
  • !status Returns more details from the last alert
  • !devices Returns all known devices
  • !details <device_id> Returns all details for a Particle device_id
  • !alert_freq <device_id> <freq_in_min> Sets the alert frequency in terms of minutes for a device, use 0 for verbose alerts
  • !name <device_id> <friendly_name> Changes the friendly name for a Particle device_id

Development

The framework behind this project is not new in the slightest. In fact, many articles describe how to make a Discord bot using Node.js and explain the basics better than I can. If you'd like to make a Discord bot yourself I would highly suggest checking out these resources.

Contributors

  • Radison Akerman / Project Lead

Individual contributions are listed on most functions

License

This project (particlecord) is protected by the Mozilla Public License 2.0 as disclosed in the LICENSE. Adherence to the policies and terms listed is required.

particlecord's People

Contributors

rak3rman avatar

Watchers

James Cloos 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.