Automattic / wp-telegram-bot

A telegram bot for WordPress.com
16 stars 5 forks source link

Handle improperly formatted URLs #16

Open hoverduck opened 6 years ago

hoverduck commented 6 years ago

What I expected To be able to type @WordPressDotComBot follow newestdomainsiteintheworld.com and follow the blog

What actually happened Nothing, not even an error. Instead I need to include the http[s]:// on the front of the URL.

The bot should be able to more accurately detect a URL, and also provide an error response when a non-URL argument is given

rachelmcr commented 6 years ago

+1 to this. I tried the same thing and expected at least an error message with details about what I needed to fix, or better yet handling the domain on its own.

markryall commented 6 years ago

Yes - i did find having to type the protocol pretty annoying.

If we make the regexp to detect the follow and unfollow commands a bit more specific then i think dropping the protocol would make sense. The corresponding xmpp commands ignore the protocol