Skip to content

Repository files navigation

Lost&Found Telegram Bot

Lots of schools face a problem with not having organised system for finding lost things. Our project proposes solution to it - Lost&Found bot which helps with filtering, storing and managing everything.

HM

if you'll find my project interestnig or will end up using or forking it, or if you'll have any problems, questions or advice - text me in telegram @miha19652010 or via mail mikhail.mezh@icloud.com

Functionality

User commands

Command Front Back
/start sends user greeting and navigates to help bar saves user id in database for stats and further commands
/help introduces list of commands user can use nothing interesting
/found guides user to fill out a form sends consecutive messages and then saves submitted message info in database
/lost asks user for category and time range, returns all corresponding results sorts out all completed orders by date and category, returns list of message ids
/notification lets user sub or unsub to particular category (sub means to get notifications if new order's added) stores user id and category name he wants to get notified about

Examples

/start

start command

/help

help command

/found

completed form looks like this

found command

/lost

category choice

lost command

time frame

lost command

returned results

lost command

/notification

notification command

subscribe

subscribe command

subscribe command

unsubscribe

unsubscribe command

Admin commands

Command Front Back
/showall sends admin all stored orders with delete button underneath (deletes order forever) goes through all message ids as well as deletes the ones user chose
/sendall asks admin for text/photo to broadcast to all bot user sends admin's message to all users stored
/quickstart turns on a broadcast mode: all photos and photos with captions sent will be stored in daily broadcasts category stores all sent messages ids under daily broadcasts category
/quickstop turns broadcasting mode off nothing interesting

/showall is pretty self explanatory

showall command

each order is displayed this way, and you can delete it by clicking button below

/sendall

sendall command

These commands are only included in letovo_edition

/quickstart and /quickstop

quick command

after this message admin proceeds to send photos (captions are optional), until /quickstop is sent

all messages sent in this mode will be saved under daily broadcasts category. you can find it in Обход дежурного менеджера category in /lost

if user wants to look at these broadcasts, he will choose which date broadcast was made with interactive calendar and receive all broadcasts on this day

quick command

red crosses are the days without broadcasts

Set up your own bot

if you'll have any questions or problems regarding our bot, contact me via telegram

1. Create your bot

Go to https://t.me/BotFather

Send /newbot command:

  • Fill name (you can change it later)
  • Fill username
  • Grab a token

Then send /mybots and choose your bot → Bot settings → Inline mode → Turn on → Edit inline placeholder → write a message which will be shown whenever user chooses category

In Edit Bot you can set its picture, description, etc.

2. Set up a helper channel

Send /start command to your bot

In telegram, click New Channel. Make it Public

In Add members choose your bot, make it Admin and save

3. Run the bot

Run the following command in terminal

pip install -r https://raw.githubusercontent.com/CrazyMikha2010/lost_and_found_tg_bot/main/requirements.txt

Then copy the code from

a) bot_en.py for english lang bot

b) bot_rus.py for russian lang bot

c) bot_letovo_edition.py for more commands (look into functionality documentation)

In code replace all

  • @help_channel_name to channel username you created prior

  • yout_databse_name.db to any name you want to call your databse file, just put .db at the end

  • YOUR BOT TOKEN HERE to your actual bot token

To add admins you need to visit https://t.me/getmyid_bot from account you want to make admin and get their id. Then paste it into ADMIN_IDS list

You can run this code manually on your local machine (but it will stop whenever you turn off youe pc or stop the code)

Also you can run it on remote server 24/7, but you'll either have to pay for it or set up your own

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

LICENSE

MIT License

Copyright (c) 2025 CrazyMikha2010

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

PS

more about the creation of my project you can read in my process journal

About

Lost&Found Telegram bot for schools

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages