Laravel Telegram Bot Development - Store User Chat IDs and Ethereum Wallet Addresses in Database

I’m trying to create a Telegram bot using Laravel framework that can collect and store user information in a database. Specifically, I need to capture each user’s chat ID and their Ethereum wallet address when they interact with the bot.

I want to avoid using Node.js for this project and stick with PHP/Laravel instead. So far I’ve experimented with Google Sheets integration and tried a couple of different SDKs for Telegram bot development, but I’m having trouble getting the data to save properly to my database tables.

Has anyone successfully built something similar? What’s the best approach to handle webhook requests from Telegram and process the incoming messages to extract and store this information? Any recommendations for reliable Laravel packages or implementation strategies would be really helpful.

same here! the telegram-bot-sdk works really well. just watch how you validate wallet addresses. webhook setup can be tricky - make sure your route handles POST requests correctly and remember to exempt it from csrf protection!

I’ve been building Telegram bots with Laravel and the biggest pain point is message parsing. People always forget Telegram sends different update types - check if it’s a message, callback query, or inline query before doing anything else. For wallet addresses, add validation middleware to check the format before it hits your database. Set up rate limiting on your webhook endpoint too or you’ll get spammed to death. Pro tip: log all incoming webhook data at first so you can see what Telegram’s actually sending vs what you think it should send. And make sure your database migrations index chat_id since you’ll be hitting that constantly.

Built a similar bot last year for a crypto project. The key is getting your webhook endpoint right in Laravel - create a controller that handles Telegram updates. For the database, I’d make a users table with chat_id and wallet_address columns, then use Eloquent’s updateOrCreate for new users and updates. Validating Ethereum addresses was the tricky bit - used a simple regex to check format before storing. Don’t forget to add your bot token to .env and use Laravel’s HTTP client for responses back to Telegram. Everything flows much better once you nail the webhook setup.