Skip to content

Commit

Permalink
Merge branch 'main' into issue-894-options-types
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch authored Apr 29, 2021
2 parents 646f91f + a5ac8fd commit 26b89ce
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion src/types/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,40 @@ export interface Middleware<Args> {
(args: Args & AllMiddlewareArgs): Promise<void>;
}

export interface Context extends StringIndexed {}
/**
* Context object, which provides contextual information associated with an incoming requests.
* You can set any other custom attributes in global middleware as long as the key does not conflict with others.
*/
export interface Context extends StringIndexed {
/**
* A bot token, which starts with `xoxb-`.
* This value can be used by `say` (preferred over userToken),
*/
botToken?: string;
/**
* A bot token, which starts with `xoxp-`.
* This value can be used by `say` (overridden by botToken),
*/
userToken?: string;
/**
* This app's bot ID in the installed workspace.
* This is required for `ignoreSelf` global middleware.
* see also: https://github.com/slackapi/bolt-js/issues/874
*/
botId?: string;
/**
* This app's bot user ID in the installed workspace.
* This value is optional but allows `ignoreSelf` global middleware be more filter more than just message events.
*/
botUserId?: string;
/**
* Workspace ID.
*/
teamId?: string;
/**
* Enterprise Grid Organization ID.
*/
enterpriseId?: string;
}

export type NextFn = () => Promise<void>;

0 comments on commit 26b89ce

Please sign in to comment.