Skip to content

Commit

Permalink
chore: Revert "chore(deps): migrate to @slack/bolt@4"
Browse files Browse the repository at this point in the history
This reverts commit d2faee8.
  • Loading branch information
karl-run committed Oct 31, 2024
1 parent d2faee8 commit cb5cdba
Show file tree
Hide file tree
Showing 8 changed files with 378 additions and 326 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@navikt/next-logger": "^1.34.0",
"@navikt/oasis": "^3.4.0",
"@prisma/client": "5.21.1",
"@slack/bolt": "^4.0.1",
"@slack/bolt": "^3.22.0",
"@slack/logger": "^4.0.0",
"@slack/types": "^2.14.0",
"clsx": "^2.1.1",
Expand Down
1 change: 0 additions & 1 deletion src/bot/commands/commands-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ export function configureCommandsHandler(app: App): void {

await app.client.chat.postMessage({
channel: team.id,
thread_ts: ask.messageTs,
text: `Svar på ukentlig helsesjekk for ${team.name}`,
blocks: createScoreBlocks(team, ask, scoredAsk, previousScoredAsk),
reply_broadcast: true,
Expand Down
3 changes: 2 additions & 1 deletion src/bot/events/healthcheck/healthcheck-modal-builder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { InputBlock, ModalView, Option, Block, KnownBlock } from '@slack/types'
import { Block, KnownBlock } from '@slack/types'
import { InputBlock, ModalView, Option } from '@slack/bolt'
import { groupBy } from 'remeda'

import { AnswerLevel, Team, Asked, QuestionAnswer } from '../../../db'
Expand Down
2 changes: 1 addition & 1 deletion src/bot/events/modal-utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HeaderBlock, SectionBlock } from '@slack/types'
import { HeaderBlock, SectionBlock } from '@slack/bolt'

export function plainHeader(text: string): HeaderBlock {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/bot/events/settings/settings-modal-builder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InputBlock, ModalView, Option, PlainTextOption, SectionBlock } from '@slack/types'
import { InputBlock, ModalView, Option, PlainTextOption, SectionBlock } from '@slack/bolt'
import { Block, KnownBlock } from '@slack/types'

import { Team } from '../../../db'
Expand Down
22 changes: 4 additions & 18 deletions src/bot/messages/message-poster.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { logger } from '@navikt/next-logger'

import { App } from '../app'
import { questionsFromJsonb } from '../../questions/jsonb-utils'
import { markAskedRevealed, createAsked, getActiveAsk, Team, getPreviousAsk, markAskedAsNagged } from '../../db'
Expand Down Expand Up @@ -119,25 +117,13 @@ export async function revealTeam(team: Team, client: App['client']): Promise<boo
const scoredAsk = scoreAsked(asked)
const previousScoredAsk = previousAsked ? scoreAsked(previousAsked) : null

const postMessageBase = {
await client.chat.postMessage({
channel: team.id,
thread_ts: message.ts,
text: `Svar på ukentlig helsesjekk for ${team.name}`,
blocks: createScoreBlocks(team, asked, scoredAsk, previousScoredAsk),
} as const

if (message.ts == null) {
logger.error(
`Found no ts for message when trying to reveal team ${team.name}, posting as root message to channel`,
)
await client.chat.postMessage(postMessageBase)
} else {
await client.chat.postMessage({
...postMessageBase,
thread_ts: message.ts,
reply_broadcast: true,
})
}

reply_broadcast: true,
})
await markAskedRevealed(asked.id)

return true
Expand Down
2 changes: 1 addition & 1 deletion src/utils/bolt-utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PlainTextElement } from '@slack/types'
import { PlainTextElement } from '@slack/bolt'

export function text(text: string): PlainTextElement {
return {
Expand Down
Loading

0 comments on commit cb5cdba

Please sign in to comment.