Code Monkey home page Code Monkey logo

rocket-taco's Introduction

Rocket Taco

Rocket Taco is a Rocket.Chat bot inspired by HeyTaco!. Rocket Taco allows you to commend members of your server for their actions. Simply send a message with the :taco: emoji and the user's tag (i.e. @<user>) and they will receive a taco from you. Tacos are recorded and displayed on the leader board for all to see.

Setup

  1. Install docker if you haven't already.
  2. Add an admin user to you Rocket.Chat server to represent the Bot.
  3. From within the root directory of the repo run the following command to build the docker image:
docker build -t rocket_taco .
  1. Run the following command to start the Bot server:
docker run -it --net=host rocket_taco
  1. Navigate to http://localhost:4567 in your favorite browser. Fill out the following form fields and hit update at the bottom of the page:
  • Bot IP or FQDN: the IP or FQDN of the Bot server. Note that the Rocket Chat server will send messages to this IP/Address, so it must be reachable from the Rocket Chat Server.
  • Bot Port: the port that the Bot server is listening on.
  • Rocket.Chat Server: FQDN or IP address of the Rocket Chat Server. The Bot server must be able to reach this address.
  • Rocket.Chat Port: the port that the Rocket.Chat server is listening on
  • Rocket Taco Username: username of the user created in step 2
  • Rocket Taco Password: password of the user created in step 2
  1. The status header at the top of the page should now display Connected. For each channel on which you want Rocket Taco to be active, select the corresponding radio button under channels and press update.

Commands

Send tacos to another user by sending a message containing :taco: and @<user> to any channel on which Rocket Taco is active.

  • Every word in the message except :taco: and @<user> are ignored by rocket taco. This allows you to use the bulk of the message to explain why you are giving user tacos.
  • Number of :taco: emojis represents the number of tacos to send to user. Note that you can send at most 5 tacos in a 24 hour period. For example, this message will send 4 tacos to Joe
:taco: :taco: :taco: :taco: @Joe for amazing surprise party!
  • Can also send to multiple users tacos in the same message. The following message will send 2 tacos to Sam and 2 tacos to Kate:
:taco: :taco: @Sam @Kate for help setting up!

Review the leader board and your personal stats by direct messaging the Rocket Taco user.

  • !tacos - prints the number of tacos available for you to give to others.
  • !leaderboard [channel] [timeframe] - displays the leader board for a specified channel over the specified timeframe. Channel must start with # or be GLOBAL (aggregated over all channels), and time frame must be in [day, week, month, year, century]. Both channel and timeframe are optional, defaulting to GLOBAL and century respectively.
  • !help - displays help message that summarizes the available commands.

rocket-taco's People

Watchers

 avatar

Forkers

stefan-baranoff

rocket-taco's Issues

Add Leaderboard Endpoint

Need a way to display the full leader board. Should be able to be sorted by time frame and channel.

Leveling System?

Direct message user when they hit specific thresholds for tacos given / received.
Add a !rank command to give you your total tacos given / received and level.

Possible Thresholds

Level Delta Tacos Total
1 10 10
2 15 25
3 20 45
4 25 70
5 30 100
6 35 135
7 40 175
8 45 220
9 50 270

README

Explain how to install and setup the bot.

Users Can Impersonate another User and Use their Tacos

E.g.

curl \ 
-d '{"bot":false,"trigger_word":":taco:","channel_id":"TJf7cJcJjZDj3kFct","channel_name":"channel","message_id":"5xEFvg23JzH7BSPNx","timestamp":"2019-07-27T21:18:35.319Z","user_id":"F9YKW787Y4bbtYuJu","user_name":"zac","text":":taco: @user"}' \
localhost:4567/taco?channel=channel

Possible Solution:

  • Server and integration script share a secret key
  • Integration script sends hash(taco_giver || taco_receiver || secret_key || timestamp) in the headers for requests to /taco
  • Server computes the hash and rejects the request if it doesn't match

Leaderboard for Global Stats

Currently have individual leader boards for each channel. Might be nice to have a leaderboard that aggregates stats over all rocket-taco channels on the server

Allow User to Specify FQDN

Currently assuming that the bot is on the same machine as the Rocket.chat server and using localhost when setting up the integrations.

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.