diff --git a/README.md b/README.md index dbf3e5f..ea66f72 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ SERVER_ADDR=dns:localhost:5230 BOT_TOKEN=your_telegram_bot_token BOT_PROXY_ADDR=https://api.your_proxy_addr.com ALLOWED_USERNAMES=user1,user2,user3 +# APPEND_TEXT=#unchecked_content ``` ### Configuration Options @@ -28,6 +29,7 @@ ALLOWED_USERNAMES=user1,user2,user3 - `BOT_TOKEN`: Your Telegram bot token - `BOT_PROXY_ADDR`: Optional proxy address for Telegram API (leave empty if not needed) - `ALLOWED_USERNAMES`: Optional comma-separated list of allowed usernames (without @ symbol) +- `APPEND_TEXT`: If set, a text to be appended to the user input text (like #unchecked) ### Username Restrictions diff --git a/config.go b/config.go index 3a344db..b187f18 100644 --- a/config.go +++ b/config.go @@ -15,6 +15,7 @@ type Config struct { BotProxyAddr string `env:"BOT_PROXY_ADDR"` Data string `env:"DATA"` AllowedUsernames string `env:"ALLOWED_USERNAMES"` + AppendText string `env:"APPEND_TEXT"` } func getConfigFromEnv() (*Config, error) { diff --git a/memogram.go b/memogram.go index dc3eaf8..72239a4 100644 --- a/memogram.go +++ b/memogram.go @@ -106,6 +106,10 @@ func (s *Service) Start(ctx context.Context) { } func (s *Service) createMemo(ctx context.Context, content string) (*v1pb.Memo, error) { + if s.config.AppendText != "" { + content += "\n" + s.config.AppendText + } + memo, err := s.client.MemoService.CreateMemo(ctx, &v1pb.CreateMemoRequest{ Memo: &v1pb.Memo{ Content: content,