Open
Conversation
- Add `--chat-id <chat-id>` flag to override the default chat id. - Add `--alias <string>` flag to use predefined chat ids from the `[aliases]` config section. - Support negative chat IDs by correctly casting them to integers. - Update `README.md` with usage and configuration examples. Co-authored-by: scartill <1055918+scartill@users.noreply.github.com>
…110979254301145609 Add `--chat-id` and `--alias` CLI parameters
Allow configuring and running telegram-send using the TELEGRAM_BOT_TOKEN environment variable to avoid storing the bot token in a plain-text configuration file. Co-authored-by: scartill <1055918+scartill@users.noreply.github.com>
Allow configuring and running telegram-send using the TELEGRAM_BOT_TOKEN environment variable to avoid storing the bot token in a plain-text configuration file. Also amend README.md to document the new usage. Co-authored-by: scartill <1055918+scartill@users.noreply.github.com>
…7065284436081288010 feat: use TELEGRAM_BOT_TOKEN environment variable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This Pull Request introduces the ability to send messages to specific chat IDs or predefined aliases without modifying the configuration file. It also adds support for securely configuring the bot token via an environment variable.
Changes
New CLI Arguments:
--chat-id <ID>: Sends a message directly to the specified chat ID, overriding the configured one.--alias <ALIAS>: Sends a message to a predefined alias mapping (stored in the[aliases]block in the configuration file).Environment Variable for Bot Token:
TELEGRAM_BOT_TOKENenvironment variable.--configurewith this variable set bypasses the interactive prompt, allowing for secure token usage without storing it in a plain-text configuration file.Documentation Updates:
README.mdto document the new--chat-idand--aliasfeatures, along with an example[aliases]block configuration.README.mdto document the newTELEGRAM_BOT_TOKENenvironment variable behavior.