Crates.io | admin_bot |
lib.rs | admin_bot |
version | 0.1.0 |
source | src |
created_at | 2017-12-05 18:30:33.02124 |
updated_at | 2017-12-05 18:30:33.02124 |
description | A telegram bot to assist with administration of chats |
homepage | |
repository | https://github.com/asonix/telegram-admin-bot |
max_upload_size | |
id | 41848 |
size | 57,917 |
AdminBot was created to assist in managing a series of related groupchats on Telegram.
/relay
with thatever it is you want to tell the admins and the bot will forward what you said to a designated admin chat./admins
First, make sure you talk to @BotFather to get a bot token. Add your bot to the admin chat, and then send a message.
Go to https://api.telegram.org/bot<YourBOTToken>/getUpdates
to view the current updates for your bot, and get the chat ID. It should be a negative number.
copy .env.sample to .env and set the required values.
TELEGRAM_BOT_TOKEN="123456789:ABCDEFGHIJK_LMNOPQRSTUVWXYZ123456"
ADMIN_CHAT_ID="-123456789"
Run cargo run
from the project directory to run the project.
If you want to install this binary directly with cargo install
, make sure the TELEGRAM_BOT_TOKEN
and ADMIN_CHAT_ID
environment variables are set.
Here is an example Systemd Unit file
[Unit]
Description=A bot to help with adminning Coconuts
After=network.target
[Service]
Type=simple
User=admins
Group=admins
Environment="TELEGRAM_BOT_TOKEN=123456789:ABCDEFGHIJK_LMNOPQRSTUVWXYZ123456"
Environment="ADMIN_CHAT_ID=-123456789"
Environment="RUST_BACKTRACE=1"
Environment="RUST_LOG=admin_bot=debug"
ExecStart=/home/admins/.cargo/bin/admin_bot
TimeoutSec=90
Restart=always
[Install]
WantedBy=default.target
AdminBot is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
AdminBot is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. This file is part of AdminBot
You should have received a copy of the GNU General Public License along with AdminBot If not, see http://www.gnu.org/licenses/.