Mirror to contribute to upstream.
Telegram bridge to republish Gancio events
https://framagit.org/bcn.convocala/gancio-plugin-telegram-bridge/
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
When the server's locale and/or timezone are different from that in Gancio, weird things were happening. While there, we make `renderEvent` a tad more modular so that potentially new settings can be introduced in the future. Introduced changes: - `renderEventDateTime` uses both Gancio's locale and timezone, this has the effect that (in theory! please test) no matter the server's timezone, the message will be rendered according to Gancio's settings (which is, I'd argue, an admin's expectation) - `renderEventTitle` generates a link to Gancio's event, which people can use to get more info - I noticed while importing events that sometimes the `description` field could be prefilled with `null` as a string, while this might be a Gancio bug to fix, we can also skip those descriptions New boolean configuration options: - `skip_link_to_gancio`: it skips the final link to Gancio making the message slightly shorter - `tags_link_to_gancio`: it affects `renderEventTags`, which by default allows Telegram to handle tags. When this option is applied, tags link instead to their Gancio site, which lists all related events on the instance |
6 months ago | |
---|---|---|
conf | 6 months ago | |
data | 1 year ago | |
.gitignore | 1 year ago | |
LICENSE | 1 year ago | |
README.md | 8 months ago | |
index.js | 6 months ago | |
package.json | 7 months ago |
README.md
Telegram bridge for Gancio
This is an attempt to create a plugin for Gancio that republishes content to Telegram channels or groups. The goal is to spread the info of our networks to the capitalist cyberspace, and pull otherwise isolated people to our radical and free part of the internet.
Clone this repo to your Gancio
I don't know how to install this plugin side by side to other plugins. So let's do it like this by now:
# assuming docker installation as per https://gancio.org/install/docker
$ cd /opt/gancio/data
$ git clone https://framagit.org/bcn.convocala/gancio-plugin-telegram-bridge.git
$ mv gancio-plugin-telegram-bridge plugins
$ cd plugins/gancio-plugin-telegram-bridge
$ npm i
Configuration
Once the plugin is installed, navigate to your instance plugins tab of the admin interface. Enable the plugin, and add the required data:
- Your Telegram's bot token you want to impersonate with this plugin. Help on telegram bots
- The channel/group id where to publish the messages. Help on getting chat ids
Try
- Restart your gancio instance and look at the logs for any message saying that this plugin has been loaded.
- Edit an existing event and save it just like that (this counts as an update)
- Check your telegram channel for new activities
Rough roadmap
v0.1.0
- Send plain text messages with event info
- Send photos with event info
v1.0.0
- Test plugin with public instance. Event URLs from dev env are unreachable for telegram to retrieve info.
- Check for Telegram API limits: image size, description text lenght
- Ensure gancio event description text is cleaned for limited html telegram support (like
<p>
and<h1>
) - Ignore update and delete by now.
More
- Register created or modified events to an sqlite db
- Use telegram edit feature to modify sent events
- Use telegram delete feature to remove deleted events
- Register commands to edit config, and to add and remove bot admin telegram accounts
- Fill properly npm package.json
- Add tests
- Allow to send to multiple channels
- Allow to send from multiple bots