Skip to content

A simple Telegram bot that eats anonymous channel messages, written in Rust.

License

Notifications You must be signed in to change notification settings

h3a-moe/tgbot-nochanmsg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tgbot-nochanmsg By Asuna

Right Control

When creating your bot from botfather, it's not bad to disable privacy mode, because it needs to access the messages to detect channel messages.

This bot needs the admin right "Delele messages" to be fully functional. If not granted, an error message will pop out in the chat.

Compile

$ cargo build --release 

Remember to move the target build to your desired path, like /usr/bin .

Usage

Very simple.

To use this bot, please set your environment variable first.

$ export TELOXIDE_TOKEN="your bot token here"

Then execute it.

Or just execute it like this:

$ TELOXIDE_TOKEN="your bot token here" /usr/bin/tgbot-nochanmsg

Caution! This will expose your bot token to your shell history.

Don't forget to clean up.

Run as a Service

Here is a typical template.

Similarly, the bot token is set as an environment variable in the file. So, keep it safe.

# /etc/systmd/system/tgbot-nochanmsg.service

[Unit]
Description=tgbot-nochanmsg
Wants=network.target
After=network.target

[Service]
Type=simple
Restart=on-failure
RestartSec=10s
Environment="RUST_LOG=debug"
Environment="TELOXIDE_TOKEN=<Your_Token_here>"
ExecStart=/usr/bin/tgbot-nochanmsg

[Install]
WantedBy=multi-user.target

About

A simple Telegram bot that eats anonymous channel messages, written in Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages