Skip to content

Commit fefb28e

Browse files
authored
chore: message intro with button (#155)
1 parent b2244a9 commit fefb28e

3 files changed

Lines changed: 31 additions & 6 deletions

File tree

apps/atrium-telegram/app/components/StaffBlock.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<div class="max-w-full overflow-x-scroll overflow-y-hidden snap-x hide-scroll">
3-
<div class="w-max flex flex-row flex-wrap gap-3.5">
3+
<div class="w-max flex flex-row flex-wrap gap-1">
44
<div
55
v-for="user in allUsers"
66
:key="user.id"
7-
class="w-14 flex flex-col gap-1 justify-start items-center scroll-ml-6 snap-start motion-preset-slide-right"
7+
class="w-18 flex flex-col gap-1 justify-start items-center scroll-ml-6 snap-start motion-preset-slide-right"
88
@click="handleClick(user.id)"
99
>
1010
<div class="relative">
@@ -26,7 +26,11 @@
2626
</div>
2727
</div>
2828

29-
<p class="text-xs/3 text-muted text-center">
29+
<p class="text-xs/3 font-bold text-center line-clamp-2">
30+
{{ user.name }}
31+
</p>
32+
33+
<p class="text-xs/3 text-muted text-center line-clamp-2">
3034
{{ user.isOnline ? 'Онлайн' : useTimeAgoIntl(new Date(user.onlineAt ?? '')) }}
3135
</p>
3236
</div>

apps/atrium-telegram/app/pages/startapp.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<UIcon name="i-lucide-loader" class="animate-spin" />
2+
<UIcon name="i-lucide-loader" class="size-8 text-primary animate-spin" />
33
</template>
44

55
<script setup lang="ts">
@@ -21,6 +21,10 @@ if (tgWebAppStartParam?.length && tgWebAppStartParam.includes(separator)) {
2121
if (key === 'epic') {
2222
await navigateTo(`/epic/${value}`)
2323
}
24+
25+
if (key === 'flow') {
26+
await navigateTo(`/flow/${value}`)
27+
}
2428
} else {
2529
await navigateTo('/')
2630
}

apps/web-app/server/tasks/ai/daily-report.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,30 @@ export default defineTask({
5555

5656
// Flow item
5757
const date = format(new Date(), 'd MMMM', { locale: ru })
58-
await repository.flow.createItem({
58+
const flowItem = await repository.flow.createItem({
5959
type: 'daily_task_report',
6060
title: `Задачи ${date}`,
6161
description: finalMessage,
6262
})
6363

64-
await useAtriumBot().api.sendMessage(telegram.teamGroupId, finalMessage)
64+
const separator = 'zzzzz'
65+
const startAppData = `flow${separator}${flowItem?.id}`
66+
67+
// Get first words
68+
const messageIntro = finalMessage.split(' ').slice(0, 40).join(' ')
69+
const preparedMessage = `${messageIntro}...\n\nПродолжение внутри Атриума? 🙃`
70+
71+
await useAtriumBot().api.sendMessage(telegram.teamGroupId, preparedMessage, {
72+
link_preview_options: {
73+
is_disabled: true,
74+
},
75+
reply_markup: {
76+
inline_keyboard: [[{
77+
text: '👉 Открыть Атриум',
78+
url: `https://t.me/sushi_atrium_bot/app?startapp=${startAppData}`,
79+
}]],
80+
},
81+
})
6582
} catch (error) {
6683
errorResolver(error)
6784
}

0 commit comments

Comments
 (0)