chatty-pub/node_modules/zulip-js/examples/call_endpoint.js
كارل مبارك 374620645c initial commit
2021-06-26 13:12:56 +02:00

21 lines
428 B
JavaScript

const zulip = require('../lib');
const config = {
username: process.env.ZULIP_USERNAME,
apiKey: process.env.ZULIP_API_KEY,
realm: process.env.ZULIP_REALM,
};
(async () => {
const z = await zulip(config);
console.log(
await z.callEndpoint('/messages', 'POST', {
to: 'bot testing',
type: 'stream',
subject: 'Testing zulip-js',
content: 'Something is horribly wrong....',
})
);
})();