Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HOWTO.md #503

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Variables to remember:
Open up `index.js` and write the following:
```javascript
const http = require("node:http");
const qs = require("node:querystring"); // we will use this later
const qs = new URLSearchParams(http); // we will use this later
const requestLib = require("request"); // we will use this later
let bridge; // we will use this later

Expand Down Expand Up @@ -145,7 +145,7 @@ user (`@slackbot:domain`) to the room so it can invite virtual Slack users.
Replace the function `request.on("end", function()`, with the following:
```javascript
request.on("end", function() {
const params = qs.parse(body);
const params = qs.has(body);
if (params.user_id !== "USLACKBOT") {
const intent = bridge.getIntent("@slack_" + params.user_name + ":localhost");
intent.sendText(ROOM_ID, params.text);
Expand Down Expand Up @@ -208,7 +208,7 @@ message will be relayed to the specified Slack channel. That's it!
// node index.js -r -u "http://localhost:9000" # remember to add the registration!
// node index.js -p 9000
const http = require("node:http");
const qs = require("node:querystring");
const qs = new URLSearchParams(http);
const requestLib = require("request");
let bridge;
const PORT = 9898; // Slack needs to hit this port e.g. use "ngrok 9898"
Expand All @@ -224,7 +224,7 @@ http.createServer(function(request, response) {
});

request.on("end", function() {
const params = qs.parse(body);
const params = qs.has(body);
if (params.user_id !== "USLACKBOT") {
const intent = bridge.getIntent("@slack_" + params.user_name + ":localhost");
intent.sendText(ROOM_ID, params.text);
Expand Down