pre release 0.0.1
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Struchkov Mark 2023-03-15 20:43:53 +03:00
parent cc655a1bce
commit 2dc7f11e4e
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6
4 changed files with 46 additions and 1 deletions

View File

@ -204,6 +204,6 @@ steps:
# path: /drone/volume/mkdocs_cache/gitlab_notification # path: /drone/volume/mkdocs_cache/gitlab_notification
--- ---
kind: signature kind: signature
hmac: cf1bd0800e8f6bb49dae0a6c5f607676b87d5ee713f4203f4f1ed08a17f71f68 hmac: e7f6553e0e0ffb44294dfee170fd01441b54cd56a5f4c70638486ac37fcdf047
... ...

View File

@ -12,5 +12,6 @@ import org.springframework.stereotype.Component;
public class AppProperty { public class AppProperty {
private String telegramId; private String telegramId;
private String version;
} }

View File

@ -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);
}
}

View File

@ -1,5 +1,6 @@
app: app:
telegram-id: ${TELEGRAM_ID} telegram-id: ${TELEGRAM_ID}
version: 0.0.1-SNAPShOT
telegram: telegram:
bot: bot:
username: ${TELEGRAM_BOT_USERNAME} username: ${TELEGRAM_BOT_USERNAME}