https://github.com/nmasse-itix/telegram-photo-album-bot
A Telegram Bot for collecting the photos of your children
https://github.com/nmasse-itix/telegram-photo-album-bot
telegram-bot
Last synced: 2 months ago
JSON representation
A Telegram Bot for collecting the photos of your children
- Host: GitHub
- URL: https://github.com/nmasse-itix/telegram-photo-album-bot
- Owner: nmasse-itix
- Created: 2019-12-20T00:08:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-12-14T09:56:13.000Z (over 3 years ago)
- Last Synced: 2025-04-02T09:14:40.540Z (3 months ago)
- Topics: telegram-bot
- Language: Go
- Size: 248 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Security: security.go
Awesome Lists containing this project
README
# The Photo-Album Bot for Telegram
## Compilation
Pack all web files
```sh
go generate
```Compile for your target platform (example given for a Raspberry PI 3).
```sh
GOOS=linux GOARCH=arm64 go build -o photo-bot
```## Create a Bot
Talk to [BotFather](https://core.telegram.org/bots#6-botfather) to create your bot.
```
/newbot
```Keep your bot token secure and safe!
## Create an OpenID Connect client
Follow the steps described in [Use your Google Account as an OpenID Connect provider](https://www.itix.fr/blog/use-google-account-openid-connect-provider/) to use your Google Suite with OpenID Connect.
## Installation
On your Raspberry PI.
```sh
mkdir -p /opt/photo-bot/bin
mkdir -p /opt/photo-bot/etc
mkdir -p /srv/photo-bot
useradd -d /srv/photo-bot -s /bin/false -m -r bot
chown bot:bot /srv/photo-bot
``````sh
scp photo-bot [email protected]:/opt/photo-bot/bin/
```Create a file named `photo-bot.yaml` in `/opt/photo-bot/etc/`, using the [provided config sample](configs/photo-bot.yaml) as a starting base.
**Note:** the Authentication and Encryption Keys can be created using `openssl rand -base64 32`
```sh
chown bot:bot /opt/photo-bot/etc/photo-bot.yaml
chmod 600 /opt/photo-bot/etc/photo-bot.yaml
```Start the bot manually.
```sh
sudo -u bot /opt/photo-bot/bin/photo-bot
```Create the startup script in `/etc/init.d/photo-bot`.
A sample init script is [provided in the init folder](init/photo-bot).```sh
chmod 755 /etc/init.d/photo-bot
service photo-bot enable
service photo-bot start
```## Useful notes
Video autoplay is tricky:
- On Firefox, you have to interact with the page first (click somewhere in the page)
- On Safari, you have to [explicitly enable auto-play for this website](https://support.apple.com/fr-fr/guide/safari/ibrw29c6ecf8/mac)
- On Chrome, it seems to be enabled out-of-the-box## Documentation
- https://core.telegram.org/bots/api
- https://go-telegram-bot-api.github.io
- https://github.com/go-telegram-bot-api/telegram-bot-api