Skip to content

Commit cb5cdba

Browse files
committed
chore: Revert "chore(deps): migrate to @slack/bolt@4"
This reverts commit d2faee8.
1 parent d2faee8 commit cb5cdba

File tree

8 files changed

+378
-326
lines changed

8 files changed

+378
-326
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@navikt/next-logger": "^1.34.0",
2929
"@navikt/oasis": "^3.4.0",
3030
"@prisma/client": "5.21.1",
31-
"@slack/bolt": "^4.0.1",
31+
"@slack/bolt": "^3.22.0",
3232
"@slack/logger": "^4.0.0",
3333
"@slack/types": "^2.14.0",
3434
"clsx": "^2.1.1",

src/bot/commands/commands-handler.ts

-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ export function configureCommandsHandler(app: App): void {
121121

122122
await app.client.chat.postMessage({
123123
channel: team.id,
124-
thread_ts: ask.messageTs,
125124
text: `Svar på ukentlig helsesjekk for ${team.name}`,
126125
blocks: createScoreBlocks(team, ask, scoredAsk, previousScoredAsk),
127126
reply_broadcast: true,

src/bot/events/healthcheck/healthcheck-modal-builder.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { InputBlock, ModalView, Option, Block, KnownBlock } from '@slack/types'
1+
import { Block, KnownBlock } from '@slack/types'
2+
import { InputBlock, ModalView, Option } from '@slack/bolt'
23
import { groupBy } from 'remeda'
34

45
import { AnswerLevel, Team, Asked, QuestionAnswer } from '../../../db'

src/bot/events/modal-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HeaderBlock, SectionBlock } from '@slack/types'
1+
import { HeaderBlock, SectionBlock } from '@slack/bolt'
22

33
export function plainHeader(text: string): HeaderBlock {
44
return {

src/bot/events/settings/settings-modal-builder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { InputBlock, ModalView, Option, PlainTextOption, SectionBlock } from '@slack/types'
1+
import { InputBlock, ModalView, Option, PlainTextOption, SectionBlock } from '@slack/bolt'
22
import { Block, KnownBlock } from '@slack/types'
33

44
import { Team } from '../../../db'

src/bot/messages/message-poster.ts

+4-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { logger } from '@navikt/next-logger'
2-
31
import { App } from '../app'
42
import { questionsFromJsonb } from '../../questions/jsonb-utils'
53
import { markAskedRevealed, createAsked, getActiveAsk, Team, getPreviousAsk, markAskedAsNagged } from '../../db'
@@ -119,25 +117,13 @@ export async function revealTeam(team: Team, client: App['client']): Promise<boo
119117
const scoredAsk = scoreAsked(asked)
120118
const previousScoredAsk = previousAsked ? scoreAsked(previousAsked) : null
121119

122-
const postMessageBase = {
120+
await client.chat.postMessage({
123121
channel: team.id,
122+
thread_ts: message.ts,
124123
text: `Svar på ukentlig helsesjekk for ${team.name}`,
125124
blocks: createScoreBlocks(team, asked, scoredAsk, previousScoredAsk),
126-
} as const
127-
128-
if (message.ts == null) {
129-
logger.error(
130-
`Found no ts for message when trying to reveal team ${team.name}, posting as root message to channel`,
131-
)
132-
await client.chat.postMessage(postMessageBase)
133-
} else {
134-
await client.chat.postMessage({
135-
...postMessageBase,
136-
thread_ts: message.ts,
137-
reply_broadcast: true,
138-
})
139-
}
140-
125+
reply_broadcast: true,
126+
})
141127
await markAskedRevealed(asked.id)
142128

143129
return true

src/utils/bolt-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PlainTextElement } from '@slack/types'
1+
import { PlainTextElement } from '@slack/bolt'
22

33
export function text(text: string): PlainTextElement {
44
return {

0 commit comments

Comments
 (0)