automed ESLint fixes
This commit is contained in:
parent
135022a14f
commit
92ff0261db
19
index.js
19
index.js
@ -1,7 +1,6 @@
|
|||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
const github = require('@actions/github');
|
|
||||||
|
|
||||||
var sdk = require("matrix-js-sdk");
|
const sdk = require('matrix-js-sdk');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const homeserver = core.getInput('homeserver');
|
const homeserver = core.getInput('homeserver');
|
||||||
@ -10,7 +9,6 @@ try {
|
|||||||
const message = core.getInput('message');
|
const message = core.getInput('message');
|
||||||
const messagetype = core.getInput('messagetype');
|
const messagetype = core.getInput('messagetype');
|
||||||
|
|
||||||
|
|
||||||
// Debug output
|
// Debug output
|
||||||
console.log(`homeserver: ${homeserver}`);
|
console.log(`homeserver: ${homeserver}`);
|
||||||
console.log(`channel: ${channel}`);
|
console.log(`channel: ${channel}`);
|
||||||
@ -20,27 +18,26 @@ try {
|
|||||||
|
|
||||||
// Create client object
|
// Create client object
|
||||||
const client = sdk.createClient({
|
const client = sdk.createClient({
|
||||||
baseUrl: "https://matrix.org",
|
baseUrl: 'https://matrix.org',
|
||||||
accessToken: token
|
accessToken: token,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Join channel (if we are already in the channel this does nothing)
|
// Join channel (if we are already in the channel this does nothing)
|
||||||
client.joinRoom(channel).then(function() {
|
client.joinRoom(channel).then(() => {
|
||||||
console.log("Joined channel");
|
console.log('Joined channel');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Send message
|
// Send message
|
||||||
const content = {
|
const content = {
|
||||||
"msgtype": messagetype,
|
msgtype: messagetype,
|
||||||
"body": message
|
body: message,
|
||||||
};
|
};
|
||||||
|
|
||||||
client.sendEvent(channel, "m.room.message", content, "").then((res) => {
|
client.sendEvent(channel, 'm.room.message', content, '').then(() => {
|
||||||
// message sent successfully
|
// message sent successfully
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user