Telegram bot to search and send videos in any chat (inline, like @gif). Users can upload/edit/delete their own videos.
- Get a Telegram API key at @BotFather via Telegram:
/newbot
- Enable inline mode for your bot at @BotFather via Telegram:
/setinline
- Also enable inline feedback for your bot at @BotFather via Telegram:
/setinlinefeedback
- Clone this repository in your host:
git clone https://github.com/Selutario/videogram.git cd videogram
- Create
.env
file:cp .env.example .env
- Run this to get your UID and GID:
or
id
id -u # UID id -g # GID
- Edit the
.env
file to add the token obtained in step1.
and the UID and GID in step5.
. For example:VIDEOGRAM_TOKEN=6092251042:AAGxRqK5QlZN7AlhBgVQIzSKAEy7nigsW_8 UID=1000 GID=1000
- Build and run the container using docker-compose:
docker compose up -d
The bot is finally running. In order to use it for the first time, you will need to create a Telegram channel where the bot will publish all the new uploaded videos. It doesn't mind whether it is public or private. Then, add the bot to the channel (it must be administrator). Once it is added, a message like this one should appear:
Now is time to upload your first video. Talk to your bot and send /upload
command. It will ask you for some extra information:
All the uploaded videos will be published in the channel that you created before.
Everybody can now query the bot in all conversations to search and send any of the uploaded videos:
The bot will answers to these commands:
/random
: Get a randomly chosen video./upload
: Upload a new video./edit
: Edit the file, title, description or keywords of any previously uploaded video. Only administrator or the user who uploaded the video can edit it./delete
: Delete any video. Only administrators can delete videos by default./get_sent_videos
: Get history of the videos sent by all users./get_db_backup
: Get a backup of the database file.
The configuration file will allow you to modify the administrator users, ban users, change language, enable or disable the uploading, editing or deleting of videos, etc.
The file can be found in the repository under this path:
config/settings/settings.yaml