Skip to content

100 stars!

Camilo Sperberg edited this page Jun 20, 2017 · 1 revision

A bit of history

Ah... PHP7. What a fine release!

So, december 2015: PHP 7 was just shiny and all new (And astonishing the world by being 80%+ faster than 5.6!), I wanted to know it a bit better, so... I needed a project to work on! The other thing that was just as innovative at the time, was the bot platform launched by Telegram just a few months earlier.

So, this project was born! At the beginning (see v0.0.1) I just didn't know yet where to begin: what was going to be the structure of the project itself?

After some research and looking at other similar projects, I decided to just go for a native approach, trying to respect the structure Telegram itself had set up: v0.0.2 was born.

At the time however, I had only implemented 2 methods: SendMessage and GetMe (lol), so a few commits later, I had already implemented the vast majority of the API. Version v0.1.0 was born when I was finally ready with the rest.

I decided it was time for some tests: before launching a stable version which started with 1, I wanted to actually be able to detect whether I was introducing some BC before creating a new version. So, I began writing tests for the most important parts and ended up with a test suite I was finally happy with and v1.0.0 was born!

However, this wasn't the end of the road! At this point, I had already decided that I was going to implement the totality of Telegram's API... and just a few days earlier Telegram had launched a pretty big update to their platform: the inline mode for bots, so it was time to go back to the drawing board and check how I would implement this.

Time passed by and by the end of January 2016, 20 days after Telegram had launched their inline mode, v1.1.0 was released, which implemented the totality of Telegram's Bot API. It was time to make some improvements to the API itself instead of implementing more methods, so in version v1.2.0 the PSR-3 integration was completed. This would allow me to write another library, the Monolog Telegram integration.

Being stable enough, I decided to go for some BC changes now. The name of the main namespace changed from unreal4u\ to unreal4u\TelegramAPI\ (quite handy if you use multiple packages from the same author) and because the inline mode was growing, the need for better namespacing in that area was also added. The biggest change however, was non-visible for the end-user: it allowed me to add new methods and types much more faster than ever before, which paid off in subsequent releases.

One of those subsequent releases came just 3 days after launching v2.0.0: Telegram launched their Bot API v2.3 which, once again, was a huge improvement from their previous version. Fortunately, implementing those changes was a piece of cake and just a few hours later I launched v2.1.0 which implemented almost all of Telegram's 2.3 API. (Except for the gaming platform, which was quite the exception).

From that point on, adding new functionality was a piece of cake and finally v2.3.0 was launched, which implemented once again 100% of the Telegram Bot API.

At this point, I was getting already a lot more traffic, mainly because I was added at the bot samples page on Telegram. Sadly though, having implemented the totality of the API, there wasn't much work left to do. Some bugs were created, but were also quickly solved.

Up until may 2017 everything was nice and quiet, but then came the release of Bot API 3.0! This was, as always, quite a big release but here is where things got a bit more serious: Telegram was introducing a payment platform.

Fortunately, due to the structure of the project, just 2 hours after Telegram announced their new API (ok, I must confess however that I suspected something was going on because I had received some warnings from my bots about unknown new fields earlier that day, remember the Telegram Monolog integration class I was talking about?) I was able to release v2.4.0 which implemented... you'll guess it: the totality of the Bot API 3.0!

This was quite special however, because it was actually the first PHP library to implement it 💪 , a record held up onto today.

What now?

Well, this library will keep growing on for the time being: the first thing I want to do is be able to find some time to play with the payment system and implement unit tests for all the payment options.

And what about the 100 stars?

Well, I was thinking of a method which would allow you to send a message 100 times in a row (you know, just to be sure it arrived), but I figured that might activate some of the spam systems implemented by Telegram, so desisted from that idea. It would also break backwards compatibility once I decided to get it out, so yeah... definitively not a good idea.

However, the other idea I came up with, was to create an official logo! So, I asked my wife (graphic designer) to put together a very simple logo (she said that technically it ain't a logo) with the very same elements this API is composed of: Telegram, Bot API and well, PHP 7. I hope you like it!