test shell script

This commit is contained in:
joseph le 2023-09-22 14:36:17 +07:00
parent 26fb0240ca
commit 4c6f63364e
3 changed files with 20 additions and 2 deletions

View File

@ -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,

View File

@ -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))
})()

View File

@ -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}`);
}