denvit's avatar

denvit liked a comment+100 XP

3mos ago

Quick note! At 13:07, we use the Bot's chat id to compare it to the authorized user id. Technically, this works for a private chat with the Bot. However, we should handle the possibility of group chats and channels by instead fetching the user directly. It's more clear that way, anyhow.

Use $bot->user()->id instead of $bot->chat()->id.

if ($bot->user()->id !== config('nutgram.authorized_user') {
	$bot->sendMessage('You are not authorized to use this bot.');
}
denvit's avatar

denvit wrote a comment+100 XP

3mos ago

Thanks for this great tutorial @JeffreyWay.

Really great to see how easy it is to set up a Telegram bot. Very useful!