This commit is contained in:
parent
cc655a1bce
commit
2dc7f11e4e
@ -204,6 +204,6 @@ steps:
|
||||
# path: /drone/volume/mkdocs_cache/gitlab_notification
|
||||
---
|
||||
kind: signature
|
||||
hmac: cf1bd0800e8f6bb49dae0a6c5f607676b87d5ee713f4203f4f1ed08a17f71f68
|
||||
hmac: e7f6553e0e0ffb44294dfee170fd01441b54cd56a5f4c70638486ac37fcdf047
|
||||
|
||||
...
|
||||
|
@ -12,5 +12,6 @@ import org.springframework.stereotype.Component;
|
||||
public class AppProperty {
|
||||
|
||||
private String telegramId;
|
||||
private String version;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
package dev.struchkov.example.bot.unit;
|
||||
|
||||
import dev.struchkov.example.bot.conf.AppProperty;
|
||||
import dev.struchkov.godfather.simple.domain.BoxAnswer;
|
||||
import dev.struchkov.godfather.telegram.simple.context.service.TelegramSending;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.DISABLE_WEB_PAGE_PREVIEW;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class StartNotify {
|
||||
|
||||
private final TelegramSending sending;
|
||||
private final AppProperty appProperty;
|
||||
|
||||
@PostConstruct
|
||||
public void sendStartNotify() {
|
||||
final BoxAnswer boxAnswer = BoxAnswer.builder()
|
||||
.message(MessageFormat.format(
|
||||
"""
|
||||
Hello 👋
|
||||
Your personal ChatGPT bot has been successfully launched.
|
||||
|
||||
Use the help command to find out about the possibilities 🚀
|
||||
-- -- -- -- --
|
||||
🤘 Version: {0}
|
||||
👨💻 Developer: [https://mark.struchkov.dev/](Struchkov Mark)
|
||||
💊 Docs: https://docs.struchkov.dev/chatgpt-telegram-bot
|
||||
""",
|
||||
appProperty.getVersion()
|
||||
))
|
||||
.payload(DISABLE_WEB_PAGE_PREVIEW, true)
|
||||
.build();
|
||||
boxAnswer.setRecipientIfNull(appProperty.getTelegramId());
|
||||
sending.send(boxAnswer);
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
app:
|
||||
telegram-id: ${TELEGRAM_ID}
|
||||
version: 0.0.1-SNAPShOT
|
||||
telegram:
|
||||
bot:
|
||||
username: ${TELEGRAM_BOT_USERNAME}
|
||||
|
Loading…
Reference in New Issue
Block a user