Skip to content

Conversation

@oliveratgithub
Copy link

@oliveratgithub oliveratgithub commented Dec 1, 2025

New config setting: IRC_SEND_PHOTO=true

All photos which the Telegram Bot receives are uploaded to imgur, and an imgur-link is then posted to IRC.

NEW: Optionally disable the Imgur image uploads of all Telegram photos by setting IRC_SEND_PHOTO to false

+ Additional changes

  • telegram stickerHandler: disabled if existing .env option is false
  • telegram documentHandler:
    • disabled if existing .env option is false
    • also changed the .env option by default to OFF (false), following to the docs remark
  • telegram locationHandler: adds Debug log entry if skipped
  • Updates the relevant User docs

oliveratgithub and others added 7 commits November 14, 2025 19:51
* Test fix to for pushing to GHCR

* Update circleCI template

* docker(build): Updates to `golang:1.25-alpine`

* docker-compose(environment): Supports ENV vars

Allows building docker image using `docker compose` remotely, and adds support for passable process ENVIRONMENT variables - not failing when no dedicated .env-file is being mapped / available.

While it should however retain the backwards-compatibility for still using a .env config file, but ideally using:
- a) the CLI argument `--env-file /path/to/.env`,
- or b) a `volumes:`-mapping on the docker compose service definition.

* circleci: Uses golangci-lint v2.6.1 for `go_1-25`

* circleci(go_1-25): Tries to replace codeclimate

CodeClimate seems to be no longer existing, «Qlty is from the makers of Code Climate, who built the first cloud-based code quality platform in 2011.»: https://codeclimate.com/blog/code-climate-quality-is-now-qlty-software

---------

Co-authored-by: Tim Zabel <[email protected]>
Allows disabling either bridge to go just "one-way": Telegram → IRC, and IRC → Telegram

Each are naturally ENABLED by default, but can be individually be disabled using:
- a) the CLI arguments `--noirc` and `--notelegram`,
- b) via settings env vars `DISABLE_RELAY_TO_IRC=true` and `DISABLE_RELAY_TO_TELEGRAM=true`
* telegram: Adds option to put IRC nickname in quote

Introduces a new optional `QUOTE_NICKNAME=true` setting, that adjusts how IRC messages - particularly the nickname part - are rendered when bridged to Telegram: instead of a whole unformatted string, it uses the supported `<blockquote>`-formatting for the Telegram messages. This results in the sending IRC nickname to be better visible, but also clearly distinguishable from the IRC user's effective Text Message.

- Telegram message default behaviour / before:

`<ircnick> Hello from IRC to Telegram`

- New behaviour and format, if this mode is enabled, will rather look as follows:

```
> <ircnick>
Hello from IRC to Telegram
```

For this to work:
- the message's parse_mode has to be set to `HTML`
- and this requires proper HTML-escaping / HTML-tag removal on the IRC nickname & message parts, before calling the Telegram Bot API sendMessage command.
- The StripHTML() func invoked for that, was taken from here: https://go.dev/play/p/fqHzlCJa9ta (L31-35)

* irc(messageHandler): Adds also html.EscapeString()

+ A few Go syntax validation improvements
On Telegram the username is a must-have when creating an account, whereas «First name» (and «Last name») are freely adjustable at any time.

By adding a new setting `PREFER_FIRSTNAME=true` it is possible to obfuscate the Telegram user's actual \@usernames - preventing potential leakage of them to IRC channels.
Additional changes:
- telegram `stickerHandler`: disabled if existing .env option is `false`
- telegram `documentHandler`:
  - disabled if existing .env option is `false`
  - also changed the .env option by default to OFF (`false`), following to the docs remark
- telegram `locationHandler`: adds Debug log entry if skipped
- Updates the relevant User docs
Discards any Messages form non-bridged Telegram Chat IDs the Bot «can read», but are not in scope.
Better early prevention to process any arbitrary messages or objects.

Allows reusing an existing Telegram Bot, which is connected to multiple Chats.
Could also make the last step of the Quick Start Guide «Create bot with BotFather» obsolete / less critical:
~Send /setjoingroups to @Botfather, change to Disable~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant