diff --git a/app/utils/sendMessToZulip.ts b/app/utils/sendMessToZulip.ts index d02ba37..656f6ae 100644 --- a/app/utils/sendMessToZulip.ts +++ b/app/utils/sendMessToZulip.ts @@ -8,7 +8,7 @@ export const sendMessToZulip = async (type, to, topic, content) => { realm: "https://zulip.ipsupply.com.au", }; const client = await zulip(config); - if(type === "direct"){ + if(type === "private"){ let params = { type: type, to: to, diff --git a/screenshot.js b/screenshot.js index 6397d4b..99c0cb1 100644 --- a/screenshot.js +++ b/screenshot.js @@ -176,4 +176,22 @@ // // Close the browser. // await browser2.close(); // })(); +const zulip = require("zulip-js"); + + +(async () => { + const config = { + username: "networktool-bot@zulip.ipsupply.com.au", + apiKey: "0jMAmOuhfLvBqKJikv5oAkyNM4RIEoAM", + realm: "https://zulip.ipsupply.com.au", + }; + const client = await zulip(config); + const user_id = 45; + let params = { + to: "joseph.le@apactech.io", + type: "private", + content: "With mirth and laughter let old wrinkles come.", + }; + console.log(await client.messages.send(params)) +})() \ No newline at end of file diff --git a/start/routes.ts b/start/routes.ts index e7661f7..6698d23 100644 --- a/start/routes.ts +++ b/start/routes.ts @@ -195,7 +195,7 @@ Route.post("/api/gitea-webhook", ({ request, response }) => { return; } - const res = await sendMessToZulip("direct", [45], "none", "** NEW EVENT -> "+request.header("x-gitea-event")+" **"+stdout ) + const res = await sendMessToZulip("private", "joseph.le@apactech.io", "none", "** NEW EVENT -> "+request.header("x-gitea-event")+" **"+stdout ) console.log(res) console.log(`Command output:\n${stdout}`); }