Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
import logging
import os

from slack_bolt import App
from slack_bolt.adapter.socket_mode import SocketModeHandler
Expand Down
4 changes: 2 additions & 2 deletions app_oauth.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import logging
import os

from slack_bolt import App, BoltResponse
from slack_bolt.oauth.callback_options import CallbackOptions, SuccessArgs, FailureArgs
from slack_bolt.oauth.callback_options import CallbackOptions, FailureArgs, SuccessArgs
from slack_bolt.oauth.oauth_settings import OAuthSettings

from slack_sdk.oauth.installation_store import FileInstallationStore
from slack_sdk.oauth.state_store import FileOAuthStateStore

Expand Down
7 changes: 1 addition & 6 deletions listeners/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
from listeners import actions
from listeners import commands
from listeners import events
from listeners import messages
from listeners import shortcuts
from listeners import views
from listeners import actions, commands, events, messages, shortcuts, views


def register_listeners(app):
Expand Down
1 change: 1 addition & 0 deletions listeners/actions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from slack_bolt import App

from .sample_action import sample_action_callback


Expand Down
4 changes: 2 additions & 2 deletions listeners/actions/sample_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ def sample_action_callback(ack: Ack, client: WebClient, body: dict, logger: Logg
"submit": {"type": "plain_text", "text": "Submit"},
},
)
except Exception as e:
logger.error(e)
except Exception:
logger.exception("Error opening sample action modal")
1 change: 1 addition & 0 deletions listeners/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from slack_bolt import App

from .sample_command import sample_command_callback


Expand Down
7 changes: 4 additions & 3 deletions listeners/commands/sample_command.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from slack_bolt import Ack, Respond
from logging import Logger

from slack_bolt import Ack, Respond


def sample_command_callback(command, ack: Ack, respond: Respond, logger: Logger):
try:
ack()
respond(f"Responding to the sample command! Your command was: {command['text']}")
except Exception as e:
logger.error(e)
except Exception:
logger.exception("Error responding to sample command")
1 change: 1 addition & 0 deletions listeners/events/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from slack_bolt import App

from .app_home_opened import app_home_opened_callback


Expand Down
4 changes: 2 additions & 2 deletions listeners/events/app_home_opened.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ def app_home_opened_callback(client: WebClient, event: dict, logger: Logger):
],
},
)
except Exception as e:
logger.error(f"Error publishing home tab: {e}")
except Exception:
logger.exception("Error publishing home tab")
1 change: 1 addition & 0 deletions listeners/messages/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import re

from slack_bolt import App

from .sample_message import sample_message_callback


Expand Down
4 changes: 2 additions & 2 deletions listeners/messages/sample_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ def sample_message_callback(context: BoltContext, say: Say, logger: Logger):
try:
greeting = context["matches"][0]
say(f"{greeting}, how are you?")
except Exception as e:
logger.error(e)
except Exception:
logger.exception("Error responding to sample message")
1 change: 1 addition & 0 deletions listeners/shortcuts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from slack_bolt import App

from .sample_shortcut import sample_shortcut_callback


Expand Down
4 changes: 2 additions & 2 deletions listeners/shortcuts/sample_shortcut.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ def sample_shortcut_callback(body: dict, ack: Ack, client: WebClient, logger: Lo
"submit": {"type": "plain_text", "text": "Submit"},
},
)
except Exception as e:
logger.error(e)
except Exception:
logger.exception("Error opening sample shortcut modal")
1 change: 1 addition & 0 deletions listeners/views/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from slack_bolt import App

from .sample_view import sample_view_callback


Expand Down
4 changes: 2 additions & 2 deletions listeners/views/sample_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ def sample_view_callback(view, ack: Ack, body: dict, client: WebClient, logger:
text=f"<@{sample_user_value}> submitted the following :sparkles: "
+ f"hopes and dreams :sparkles:: \n\n {sample_input_value}",
)
except Exception as e:
logger.error(e)
except Exception:
logger.exception("Error handling sample view submission")
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pytest==9.1.1
ruff==0.15.20
ruff==0.16.0
slack-bolt==1.30.0
1 change: 0 additions & 1 deletion tests/listeners/commands/test_sample_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from listeners.commands.sample_command import sample_command_callback


test_logger = logging.getLogger(__name__)


Expand Down
1 change: 0 additions & 1 deletion tests/listeners/messages/test_sample_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from listeners.messages.sample_message import sample_message_callback


test_logger = logging.getLogger(__name__)


Expand Down
1 change: 0 additions & 1 deletion tests/listeners/shortcuts/test_sample_shortcut.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from listeners.shortcuts.sample_shortcut import sample_shortcut_callback


test_logger = logging.getLogger(__name__)


Expand Down
1 change: 0 additions & 1 deletion tests/listeners/views/test_sample_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from listeners.views.sample_view import sample_view_callback


test_logger = logging.getLogger(__name__)


Expand Down