Package com.slack.api.bolt.context
Class Context
java.lang.Object
com.slack.api.bolt.context.Context
- Direct Known Subclasses:
ActionContext,AttachmentActionContext,BlockSuggestionContext,DefaultContext,DialogCancellationContext,DialogSubmissionContext,DialogSuggestionContext,EventContext,GlobalShortcutContext,MessageShortcutContext,OAuthCallbackContext,SlashCommandContext,ViewSubmissionContext,WorkflowStepEditContext,WorkflowStepExecuteContext,WorkflowStepSaveContext
Represents a context behind a request from Slack API.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AuthTestResponseThe `auth.test` response received in authorization middlewareprotected Stringbot_id associated with this request.The scopes associated to the botTokenprotected StringA bot token associated with this request.protected StringBot user's user_id associated with this request.protected StringOrganization ID for Enterprise Grid.protected booleanReturns true if the token is issued by an enterprise install (= org-level installation)protected StringThe bot token associated with this "function_executed"-type event and its interactions.protected StringThe ID of function_executed event delivery.final org.slf4j.Loggerprotected StringThe user's ID associated with this request.The scopes associated to the requestUserTokenprotected StringThe user token that is associated with the request user ID.protected Slackprotected StringWorkspace ID. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionack()ack(com.google.gson.JsonElement json) ackWithJson(Object obj) client()The `auth.test` response received in authorization middlewaregetBotId()bot_id associated with this request.The scopes associated to the botTokenA bot token associated with this request.Bot user's user_id associated with this request.Organization ID for Enterprise Grid.The bot token associated with this "function_executed"-type event and its interactions.The ID of function_executed event delivery.org.slf4j.LoggerThe user's ID associated with this request.The scopes associated to the requestUserTokenThe user token that is associated with the request user ID.getSlack()Workspace ID.booleanWhen true, the framework automatically attaches context#functionBotAccessToken to context#client instead of context#botToken.booleanReturns true if the token is issued by an enterprise install (= org-level installation)voidsetAttachingFunctionTokenEnabled(boolean attachingFunctionTokenEnabled) When true, the framework automatically attaches context#functionBotAccessToken to context#client instead of context#botToken.voidsetAuthTestResponse(AuthTestResponse authTestResponse) The `auth.test` response received in authorization middlewarevoidbot_id associated with this request.voidsetBotScopes(List<String> botScopes) The scopes associated to the botTokenvoidsetBotToken(String botToken) A bot token associated with this request.voidsetBotUserId(String botUserId) Bot user's user_id associated with this request.voidsetEnterpriseId(String enterpriseId) Organization ID for Enterprise Grid.voidsetEnterpriseInstall(boolean enterpriseInstall) Returns true if the token is issued by an enterprise install (= org-level installation)voidsetFunctionBotAccessToken(String functionBotAccessToken) The bot token associated with this "function_executed"-type event and its interactions.voidsetFunctionExecutionId(String functionExecutionId) The ID of function_executed event delivery.voidsetRequestUserId(String requestUserId) The user's ID associated with this request.voidsetRequestUserScopes(List<String> requestUserScopes) The scopes associated to the requestUserTokenvoidsetRequestUserToken(String requestUserToken) The user token that is associated with the request user ID.voidvoidWorkspace ID.com.google.gson.JsonElementtoString()
-
Field Details
-
slack
-
logger
public final org.slf4j.Logger logger -
enterpriseId
Organization ID for Enterprise Grid. -
teamId
Workspace ID. -
enterpriseInstall
protected boolean enterpriseInstallReturns true if the token is issued by an enterprise install (= org-level installation) -
botToken
A bot token associated with this request. The format must be starting with `xoxb-`. -
functionBotAccessToken
The bot token associated with this "function_executed"-type event and its interactions. The format must be starting with `xoxb-`. -
functionExecutionId
The ID of function_executed event delivery. -
botScopes
The scopes associated to the botToken -
botId
bot_id associated with this request. -
botUserId
Bot user's user_id associated with this request. -
requestUserId
The user's ID associated with this request. -
requestUserToken
The user token that is associated with the request user ID. -
requestUserScopes
The scopes associated to the requestUserToken -
authTestResponse
The `auth.test` response received in authorization middleware -
additionalValues
-
-
Constructor Details
-
Context
public Context()
-
-
Method Details
-
client
-
asyncClient
-
say
public ChatPostMessageResponse say(BuilderConfigurator<ChatPostMessageRequest.ChatPostMessageRequestBuilder> request) throws IOException, SlackApiException - Throws:
IOExceptionSlackApiException
-
ack
-
ackWithJson
-
ack
-
toJson
-
toString
-
getSlack
-
getLogger
public org.slf4j.Logger getLogger() -
getEnterpriseId
Organization ID for Enterprise Grid. -
getTeamId
Workspace ID. -
isEnterpriseInstall
public boolean isEnterpriseInstall()Returns true if the token is issued by an enterprise install (= org-level installation) -
getBotToken
A bot token associated with this request. The format must be starting with `xoxb-`. -
isAttachingFunctionTokenEnabled
public boolean isAttachingFunctionTokenEnabled()When true, the framework automatically attaches context#functionBotAccessToken to context#client instead of context#botToken. Enabling this behavior only affects function_executed event handlers and app.action/app.view handlers associated with the function token. -
getFunctionBotAccessToken
The bot token associated with this "function_executed"-type event and its interactions. The format must be starting with `xoxb-`. -
getFunctionExecutionId
The ID of function_executed event delivery. -
getBotScopes
The scopes associated to the botToken -
getBotId
bot_id associated with this request. -
getBotUserId
Bot user's user_id associated with this request. -
getRequestUserId
The user's ID associated with this request. -
getRequestUserToken
The user token that is associated with the request user ID. -
getRequestUserScopes
The scopes associated to the requestUserToken -
getAuthTestResponse
The `auth.test` response received in authorization middleware -
getAdditionalValues
-
setSlack
-
setEnterpriseId
Organization ID for Enterprise Grid. -
setTeamId
Workspace ID. -
setEnterpriseInstall
public void setEnterpriseInstall(boolean enterpriseInstall) Returns true if the token is issued by an enterprise install (= org-level installation) -
setBotToken
A bot token associated with this request. The format must be starting with `xoxb-`. -
setAttachingFunctionTokenEnabled
public void setAttachingFunctionTokenEnabled(boolean attachingFunctionTokenEnabled) When true, the framework automatically attaches context#functionBotAccessToken to context#client instead of context#botToken. Enabling this behavior only affects function_executed event handlers and app.action/app.view handlers associated with the function token. -
setFunctionBotAccessToken
The bot token associated with this "function_executed"-type event and its interactions. The format must be starting with `xoxb-`. -
setFunctionExecutionId
The ID of function_executed event delivery. -
setBotScopes
The scopes associated to the botToken -
setBotId
bot_id associated with this request. -
setBotUserId
Bot user's user_id associated with this request. -
setRequestUserId
The user's ID associated with this request. -
setRequestUserToken
The user token that is associated with the request user ID. -
setRequestUserScopes
The scopes associated to the requestUserToken -
setAuthTestResponse
The `auth.test` response received in authorization middleware
-