Skip to content

Commit

Permalink
build(deps): bump @slack/bolt from 4.1.1 to 4.2.0 (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Jan 7, 2025
1 parent b820f1f commit 7a31c7c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 127 deletions.
18 changes: 9 additions & 9 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const assistant = new Assistant({
* This can happen via DM with the app or as a side-container within a channel.
* https://api.slack.com/events/assistant_thread_started
*/
threadStarted: async ({ event, say, setSuggestedPrompts, saveThreadContext }) => {
threadStarted: async ({ event, logger, say, setSuggestedPrompts, saveThreadContext }) => {
const { context } = event.assistant_thread;

try {
Expand Down Expand Up @@ -81,7 +81,7 @@ const assistant = new Assistant({
*/
await setSuggestedPrompts({ prompts, title: 'Here are some suggested options:' });
} catch (e) {
console.error(e);
logger.error(e);
}
},

Expand All @@ -92,12 +92,12 @@ const assistant = new Assistant({
* method (either the DefaultAssistantContextStore or custom, if provided).
* https://api.slack.com/events/assistant_thread_context_changed
*/
threadContextChanged: async ({ saveThreadContext }) => {
threadContextChanged: async ({ logger, saveThreadContext }) => {
// const { channel_id, thread_ts, context: assistantContext } = event.assistant_thread;
try {
await saveThreadContext();
} catch (e) {
console.error(e);
logger.error(e);
}
},

Expand All @@ -106,7 +106,7 @@ const assistant = new Assistant({
* be deduced based on their shape and metadata (if provided).
* https://api.slack.com/events/message
*/
userMessage: async ({ client, message, getThreadContext, say, setTitle, setStatus }) => {
userMessage: async ({ client, logger, message, getThreadContext, say, setTitle, setStatus }) => {
const { channel, thread_ts } = message;

try {
Expand Down Expand Up @@ -146,7 +146,7 @@ const assistant = new Assistant({
limit: 50,
});
} else {
console.error(e);
logger.error(e);
}
}

Expand Down Expand Up @@ -204,7 +204,7 @@ const assistant = new Assistant({
// Provide a response to the user
await say({ text: llmResponse.choices[0].message.content });
} catch (e) {
console.error(e);
logger.error(e);

// Send message to advise user and clear processing status if a failure occurs
await say({ text: 'Sorry, something went wrong!' });
Expand All @@ -218,8 +218,8 @@ app.assistant(assistant);
(async () => {
try {
await app.start();
console.log('⚡️ Bolt app is running!');
app.logger.info('⚡️ Bolt app is running!');
} catch (error) {
console.error('Failed to start the app', error);
app.logger.error('Failed to start the app', error);
}
})();
154 changes: 37 additions & 117 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"url": "https://github.com/slack-samples/bolt-js-assistant-template/issues"
},
"dependencies": {
"@slack/bolt": "^4.1.1",
"@slack/bolt": "^4.2.0",
"dotenv": "~16.4.7",
"openai": "^4.74.0"
},
Expand Down

0 comments on commit 7a31c7c

Please sign in to comment.