You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though I cant figure out how to set a handler for this.
$bot->onText('/\bhttps?:\/\/\S+/i', function (Nutgram $bot, $n) {
$bot->sendMessage($n);
});
$bot->onMessageType(MessageEntityType::URL, function (Nutgram $bot) {
$url = $bot->message()->url;
$bot->sendMessage('I love this song!');
});
I could pass params to a conversation class and determine if its a URL. Though itd be cleaner if I can just pass a URL. I see MessageEntityType has a casing for URL, but MessageType does not.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm wondering If its possible to automatically detect an incoming URL. I see in the log if I send a URL its detected
Though I cant figure out how to set a handler for this.
I could pass params to a conversation class and determine if its a URL. Though itd be cleaner if I can just pass a URL. I see MessageEntityType has a casing for URL, but MessageType does not.
Beta Was this translation helpful? Give feedback.
All reactions