From 8237f09212610b3e120a1e42dd5bbabf84c9704a Mon Sep 17 00:00:00 2001 From: Sam Poder <39828164+sampoder@users.noreply.github.com> Date: Sun, 10 Jul 2022 16:01:55 -0400 Subject: [PATCH] Push! Push! Push! --- src/interactions/css.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/interactions/css.js b/src/interactions/css.js index 7e91447..8bd8383 100644 --- a/src/interactions/css.js +++ b/src/interactions/css.js @@ -1,11 +1,24 @@ import { reaction } from "../utils" let validateCss = require('css-validator'); +const Pusher = require("pusher"); + +const pusher = new Pusher({ + appId: "1435548", + key: "de6cd13556d73c05beed", + secret: process.env.pusher, + cluster: "us2", + useTLS: true +}); + const interactionCSS = async (bot, message) => { const { text, channel, ts } = message validateCss({text}, async function (_, data) { if(data.validity){ await reaction(bot, 'add', channel, ts, 'art') + pusher.trigger("css", "new", { + message: text + }); } }); }