Skip to content

Commit

Permalink
Update saweria-notifikasi.js
Browse files Browse the repository at this point in the history
Signed-off-by: Ernestoyoofi <94425296+ernestoyoofi@users.noreply.github.com>
  • Loading branch information
ernestoyoofi committed Mar 19, 2023
1 parent 9ec6c07 commit c7cd806
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/saweria-notifikasi.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
const WebSocket = require("ws") const url = "wss://events.saweria.co/stream" const apikey = "<your stream key>" const socket = new WebSocket(`${url}?streamKey=${apikey}`,{
const WebSocket = require("ws")
const url = "wss://events.saweria.co/stream"
const apikey = "<your stream key>"
const socket = new WebSocket(`${url}?streamKey=${apikey}`,{
headers: {
Origin: "https://saweria.co",
"User-agent": "Nodejs/16.1.2",
"Cache-Control": "no-cache"
}
}) socket.on("message", (msg) => {
})

socket.on("message", (msg) => {
const data = JSON.parse(msg.toString())
if(data.type != "donation"){
return ;
Expand Down

0 comments on commit c7cd806

Please sign in to comment.