Module slack_bolt.adapter.tornado

Expand source code
# Don't add async module imports here
from .handler import SlackEventsHandler, SlackOAuthHandler

__all__ = [
    "SlackEventsHandler",
    "SlackOAuthHandler",
]

Sub-modules

slack_bolt.adapter.tornado.async_handler
slack_bolt.adapter.tornado.handler

Classes

class SlackEventsHandler (application: Application, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)

Base class for HTTP request handlers.

Subclasses must define at least one of the methods defined in the "Entry points" section below.

Applications should not construct RequestHandler objects directly and subclasses should not override __init__ (override ~RequestHandler.initialize instead).

Expand source code
class SlackEventsHandler(RequestHandler):
    def initialize(self, app: App):  # type: ignore
        self.app = app

    def post(self):
        bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(self.request))
        set_response(self, bolt_resp)
        return

Ancestors

  • tornado.web.RequestHandler

Methods

def initialize(self, app: App)
Expand source code
def initialize(self, app: App):  # type: ignore
    self.app = app
def post(self)
Expand source code
def post(self):
    bolt_resp: BoltResponse = self.app.dispatch(to_bolt_request(self.request))
    set_response(self, bolt_resp)
    return
class SlackOAuthHandler (application: Application, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)

Base class for HTTP request handlers.

Subclasses must define at least one of the methods defined in the "Entry points" section below.

Applications should not construct RequestHandler objects directly and subclasses should not override __init__ (override ~RequestHandler.initialize instead).

Expand source code
class SlackOAuthHandler(RequestHandler):
    def initialize(self, app: App):  # type: ignore
        self.app = app

    def get(self):
        if self.app.oauth_flow is not None:  # type: ignore
            oauth_flow: OAuthFlow = self.app.oauth_flow  # type: ignore
            if self.request.path == oauth_flow.install_path:
                bolt_resp = oauth_flow.handle_installation(to_bolt_request(self.request))
                set_response(self, bolt_resp)
                return
            elif self.request.path == oauth_flow.redirect_uri_path:
                bolt_resp = oauth_flow.handle_callback(to_bolt_request(self.request))
                set_response(self, bolt_resp)
                return
        self.set_status(404)

Ancestors

  • tornado.web.RequestHandler

Methods

def get(self)
Expand source code
def get(self):
    if self.app.oauth_flow is not None:  # type: ignore
        oauth_flow: OAuthFlow = self.app.oauth_flow  # type: ignore
        if self.request.path == oauth_flow.install_path:
            bolt_resp = oauth_flow.handle_installation(to_bolt_request(self.request))
            set_response(self, bolt_resp)
            return
        elif self.request.path == oauth_flow.redirect_uri_path:
            bolt_resp = oauth_flow.handle_callback(to_bolt_request(self.request))
            set_response(self, bolt_resp)
            return
    self.set_status(404)
def initialize(self, app: App)
Expand source code
def initialize(self, app: App):  # type: ignore
    self.app = app