test shell script
This commit is contained in:
parent
26fb0240ca
commit
4c6f63364e
|
|
@ -8,7 +8,7 @@ export const sendMessToZulip = async (type, to, topic, content) => {
|
||||||
realm: "https://zulip.ipsupply.com.au",
|
realm: "https://zulip.ipsupply.com.au",
|
||||||
};
|
};
|
||||||
const client = await zulip(config);
|
const client = await zulip(config);
|
||||||
if(type === "direct"){
|
if(type === "private"){
|
||||||
let params = {
|
let params = {
|
||||||
type: type,
|
type: type,
|
||||||
to: to,
|
to: to,
|
||||||
|
|
|
||||||
|
|
@ -176,4 +176,22 @@
|
||||||
// // Close the browser.
|
// // Close the browser.
|
||||||
// await browser2.close();
|
// 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))
|
||||||
|
})()
|
||||||
|
|
@ -195,7 +195,7 @@ Route.post("/api/gitea-webhook", ({ request, response }) => {
|
||||||
return;
|
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(res)
|
||||||
console.log(`Command output:\n${stdout}`);
|
console.log(`Command output:\n${stdout}`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue