Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alexa-rocketchat
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RocketChat
alexa-rocketchat
Commits
94095382
Commit
94095382
authored
Jun 01, 2020
by
Rocket_Chat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
documentation
parent
9cd0ae75
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
0 deletions
+7
-0
README.md
README.md
+2
-0
lambda/custom/config.js
lambda/custom/config.js
+3
-0
lambda/custom/helperFunctions.js
lambda/custom/helperFunctions.js
+2
-0
No files found.
README.md
View file @
94095382
...
...
@@ -312,6 +312,8 @@ Copy **https://pitangui.amazon.com/api/skill/link/YOURVENDORID** or **https://la
### Setting up Local development
With this setup, develper can run the backend code of the skill in the system itself, leading to faster development.
Note: The below setups are optional and is not required for the code to run in aws lambda.
1.
Navigate to
`./lambda/custom`
folder and make a new file named .env
...
...
lambda/custom/config.js
View file @
94095382
...
...
@@ -8,6 +8,9 @@ module.exports = {
awsAccessKeyId
:
process
.
env
.
ACCESS_KEY_ID
,
awsSecretAccessKey
:
process
.
env
.
SECRET_ACCESS_KEY
,
customLogUrl
:
process
.
env
.
CUSTOM_LOG_URL
||
""
,
//the below configurations are used in resolve channelname and username helper functions
//the minimum rating which a name has to achieve to be considered as similar
lowerSimilarityIndex
:
0.5
,
//a name is considered as best match on passing the below index
upperSimilarityIndex
:
0.7
};
lambda/custom/helperFunctions.js
View file @
94095382
...
...
@@ -935,6 +935,7 @@ const resolveChannelname = async (channelName, headers, single = false) => {
}
}
//if best matching name has passed the upper similarity index or if the function is called to return only best matching result
if
(
bestIndex
>=
envVariables
.
upperSimilarityIndex
||
single
)
return
[
bestMatchingChannel
]
return
similarChannels
...
...
@@ -985,6 +986,7 @@ const resolveUsername = async (username, headers, single = false) => {
}
}
//if best matching name has passed the upper similarity index or if the function is called to return only best matching result
if
(
bestIndex
>=
envVariables
.
upperSimilarityIndex
||
single
)
return
[
bestMatchingUser
]
return
similarUsers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment