A Telegram bot that manages user input and stores it in Google Sheets. This bot is capable of adding, editing, and deleting entries while offering a daily summary feature. Deploy it with Google Apps Script to create your own bot-powered management tool!
Follow these steps to get your bot up and running on Google Apps Script:
- Open Telegram and search for the BotFather.
- Use the command
/newbotto create a new bot. - Set the bot name and username, then copy the generated API Token.
- Create a new Google Spreadsheet.
- Note the Spreadsheet ID from the URL, which looks like:
https://docs.google.com/spreadsheets/d/{SPREADSHEET_ID}.
- Open Google Apps Script.
- Create a new project, and replace the code with the script provided.
- In the code, replace:
TELEGRAM_BOT_TOKENwith your bot token.SPREADSHEET_IDwith your Google Spreadsheet ID.GROUP_IDwit your Telegram Group ID.
- Click Deploy > New Deployment and select Web App.
- Set access to Anyone, then deploy.
- Copy the Web App URL.
Use the following URL to set the webhook for your bot:
https://api.telegram.org/bot<YOUR_TELEGRAM_BOT_TOKEN>/setWebhook?url=<YOUR_WEB_APP_URL>Replace <YOUR_TELEGRAM_BOT_TOKEN> with your bot token and <YOUR_WEB_APP_URL> with the Google Apps Script Web App URL.
Here are the commands and features you can use with your bot:
| Command | Description |
|---|---|
/start |
Starts the bot and creates a personal sheet for the user. |
/add |
Initiates the process to add new data (Name, Type, URL). |
/edit |
Allows the user to edit existing data in their personal sheet. |
/del |
Allows the user to delete data from their sheet. |
/daily |
Posts a daily recap of user data to the group (admins only). |
/cancel |
Cancels the current process. |
- Inline Keyboard for Confirmations: When adding or editing data, users are prompted with a confirmation message and interactive buttons to proceed or cancel.
- Data Persistence: All user data is stored in Google Sheets for easy access and management.
- Group Admin Commands: Certain commands like
/dailyare restricted to admins, ensuring control over group functionality.
- Logging: Each action is logged into a dedicated
Logsheet to track errors and successful actions. - Inline Editing and Deleting: Users can easily select which data to edit or delete via interactive inline buttons.
- Multi-step Input: Data is entered in steps (Name, Type, URL) ensuring a structured and organized input process.
This bot is created and maintained by @cryptofinderid. Feel free to reach out for any inquiries or improvements!
This project is open source and available under the MIT License.
Bot Telegram ini mengelola input pengguna dan menyimpan data di Google Sheets. Bot ini mendukung penambahan, pengeditan, penghapusan data, dan fitur rekap harian yang bisa digunakan dalam grup.
Ikuti langkah-langkah di bawah ini untuk menjalankan bot:
- Buka Telegram dan cari BotFather.
- Gunakan perintah
/newbotuntuk membuat bot baru. - Tentukan nama dan username bot, lalu salin Token API yang dihasilkan.
- Buat Spreadsheet baru di Google Sheets.
- Catat Spreadsheet ID dari URL seperti:
https://docs.google.com/spreadsheets/d/{SPREADSHEET_ID}.
- Buka Google Apps Script.
- Buat proyek baru, dan ganti kode dengan script yang disediakan.
- Ganti:
TELEGRAM_BOT_TOKENdengan token bot Anda.SPREADSHEET_IDdengan Spreadsheet ID Google Anda.GROUP_IDdengan Telegram ID Grup Anda.
- Klik Deploy > New Deployment dan pilih Web App.
- Set akses menjadi Anyone, kemudian deploy.
- Salin Web App URL.
Gunakan URL berikut untuk mengatur webhook bot:
https://api.telegram.org/bot<YOUR_TELEGRAM_BOT_TOKEN>/setWebhook?url=<YOUR_WEB_APP_URL>Ganti <YOUR_TELEGRAM_BOT_TOKEN> dengan token bot Anda dan <YOUR_WEB_APP_URL> dengan URL Web App Google Apps Script.
Berikut adalah perintah yang bisa Anda gunakan:
| Perintah | Deskripsi |
|---|---|
/start |
Memulai bot dan membuat sheet personal untuk pengguna. |
/add |
Memulai proses menambahkan data baru (Nama, Tipe, URL). |
/edit |
Memungkinkan pengguna mengedit data yang sudah ada di sheet mereka. |
/del |
Memungkinkan pengguna menghapus data dari sheet mereka. |
/daily |
Mengirimkan rekap harian dari data pengguna ke grup (hanya admin). |
/cancel |
Membatalkan proses saat ini. |
- Keyboard Inline untuk Konfirmasi: Pengguna mendapatkan pesan konfirmasi dengan tombol interaktif untuk melanjutkan atau membatalkan proses.
- Penyimpanan Data: Semua data pengguna disimpan di Google Sheets untuk akses dan manajemen yang mudah.
- Perintah Admin Grup: Beberapa perintah seperti
/dailyhanya bisa dijalankan oleh admin untuk menjaga kendali fungsi grup.
- Logging: Setiap tindakan dicatat di sheet
Loguntuk memantau kesalahan dan tindakan sukses. - Pengeditan dan Penghapusan Inline: Pengguna dapat memilih data untuk diedit atau dihapus melalui tombol interaktif.
- Input Multi-tahap: Data dimasukkan secara bertahap (Nama, Tipe, URL) agar lebih terstruktur.
Dibuat oleh @cryptofinderid. Jangan ragu untuk menghubungi untuk pertanyaan atau saran perbaikan!
Berikut adalah beberapa contoh tampilan fitur yang tersedia pada bot.
Enjoy building your Telegram bot!



