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 the documents to use respond over say in response to slash commands #1059

Merged
merged 1 commit into from
Aug 11, 2021

Conversation

seratch
Copy link
Member

@seratch seratch commented Aug 11, 2021

Summary

This pull request updates some code snippets of slash command listeners to use respond() over say() method. The reason is t make the examples more robust. A slash command can be invoked anywhere. If the conversation where a user hit the command is the person's direct message, say() method does not work at all. But respond() works even for the use case.

see also: #365 (comment)

Requirements (place an x in each [ ])

…mands

Slash commands can be invoked anywhere. In some situations like DM,
say() function does not work as the bot user is not in the conversation.
respond() can work in any situations.
@seratch seratch added the docs M-T: Documentation work only label Aug 11, 2021
@seratch seratch added this to the 3.6.0 milestone Aug 11, 2021
@@ -25,7 +25,7 @@ async function addTimezoneContext({ payload, client, context, next }) {
await next();
}

app.command('request', addTimezoneContext, async ({ command, ack, client, context }) => {
app.command('/request', addTimezoneContext, async ({ command, ack, client, context }) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for consistency

@codecov
Copy link

codecov bot commented Aug 11, 2021

Codecov Report

Merging #1059 (17c3e92) into main (62f60a2) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1059   +/-   ##
=======================================
  Coverage   68.89%   68.89%           
=======================================
  Files          13       13           
  Lines        1212     1212           
  Branches      357      357           
=======================================
  Hits          835      835           
  Misses        304      304           
  Partials       73       73           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 62f60a2...17c3e92. Read the comment docs.

@seratch seratch merged commit dc3e4a9 into slackapi:main Aug 11, 2021
@seratch seratch deleted the slash-command-docs branch August 11, 2021 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs M-T: Documentation work only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants