Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Notifications for new matches #1657

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ const defaults = {
GCDATA_PARALLELISM: 1, // Number of simultaneous GC match details requests to make (per retriever)
STRIPE_SECRET: '', // for stripe payment processing (kept on server)
STRIPE_API_PLAN: '', // plan id for stripe metering
GCP_PROJECT_ID: '', // used for notifications
GCP_CLIENT_EMAIL: '', // used for notifications
GCP_PRIVATE_KEY: '', // used for notifications
};
// ensure that process.env has all values in defaults, but prefer the process.env value
Object.keys(defaults).forEach((key) => {
Expand Down
12 changes: 12 additions & 0 deletions dev/sendMatchNotification.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable import/no-extraneous-dependencies */

const rewire = require('rewire');

const parser = rewire('../svc/parser.js');

const sendNotifications = parser.__get__('sendNotifications');

// Sends notification to all the account_ids in the pgroup object. Replace account_id with the account you're testing against.
const job = JSON.parse('{"match_id":3402873969,"radiant_win":true,"start_time":1503712159,"duration":2887,"pgroup":{"0":{"account_id":102344608,"hero_id":1,"player_slot":0},"1":{"account_id":null,"hero_id":40,"player_slot":1}},"ability_upgrades":[]}');

sendNotifications(job);
Loading