Telegram Bot Platform is dying

栏目: IT技术 · 发布时间: 4年前

内容简介:The design of the API is garbage and does not follow any REST design patterns. From the above image, it is clear that the design of the API is a disaster in its current form. Instead of utilising existingSome essentialThe Telegram Bot ecosystem is severely

Telegram Bot Platform is dying

May 2 ·4min read

Telegram Bot Platform is dying

Photo by Christian Wiediger on Unsplash

Once upon a time in June 2015, Telegram launched the Bot API . Chat bots seemed to be taking off in different messengers, and were promised to be the new way in which people would use web services, interact with businesses — it was supposed to replace most of what we do, such as ordering a pizza or tracking a package. Somewhere along the way, we have gone past the hype curve and are now on our way to the slope of enlightenment . We realised that we should stop seeing everything as a nail, and instead focus on solving actual problems. I will mostly be focusing on the Telegram Bot platform .

Finding the Bot API on the Telegram website is a nightmare. If you go to https://core.telegram.org/ and try to click links mentioned the Bot API, you will just see marketing pages with lists of features. It does not help that the Telegram API (for building custom Telegram clients) the Bot API and the Payments API are jumbled on the same page, adding to the confusion.

Telegram Bot Platform is dying

https://core.telegram.org/api

There are no code examples , curl or similar. All you get is a bunch of tables with parameter names and types. While this might be acceptable for experienced developers, this can be discouraging for beginner developers. I am also very happy when curl blocks are provided, as you can easily copy and paste them into your favourite REST client like Postman or Insomnia and start experimenting right away. Here is an example of it by Cloudflare .

Telegram Bot Platform is dying

https://core.telegram.org/bots/api

The structure of the API docs is a mess . It feels like it was made by an engineer for machines, because that is exactly how well a human being can interpret it. It is just one long list of methods in no particular order: setters mixed with getters and deleter methods, with no functional grouping. Leaving it up to people’s brains to perform simple hierarchical nesting just demonstrates ignorance from the creators.

Telegram Bot Platform is dying

The design of the API is garbage and does not follow any REST design patterns. From the above image, it is clear that the design of the API is a disaster in its current form. Instead of utilising existing HTTP methods (e.g. POST , GET , DELETE etc.), Telegram has decided to re-implement them by putting the method names in the resource URL, and accepting only GET and POST HTTP methods in requests. This is confusing, non-standard, and creates additional complexity. E.g. GET: /getUpdates vs GET: /updates .

Telegram Bot API designers don’t know about the existence of HTTP headers . Bots are authorised by generating symmetric auth tokens:

Telegram Bot Platform is dying

However, this approach of including a token in the URL path is unconventional and prone to errors . A much better approach would be at least adding it as a query param or ideally as a standard Authorization: Bearer token header value.

Some essential methods are simply non-existent as of the time of writing. For example, an issue I encountered is that it is impossible to get an array of chat members, but you can get an array of administrators?

The Telegram Bot ecosystem is severely fragmented . There is no dedicated official website for bots, there is no official list of all known, active and working bots. There are no provided ways of getting metrics directly from Telegram — it is up to developers. There is no clear way in which people can monetise their bots, or why they should even bother — Telegram isn’t sponsoring any library or bot developers, or doing any active promotions. Instead they decided it was more important to add a dart sticker rather than fix their API docs.

This is not to say that Telegram Bots are completely dead. There are many use-cases for businesses and communities, and it is an open platform that is easy to sign up for. But ifTelegram Messenger wants to grow the ecosystem, it is time to start paying more attention, listening to developers, and stop going off the beaten track just for the sake of being “different”. I am not complaining about choosing MTProto , but avoiding usage of proper HTTP methods is unacceptable.


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

C语言接口与实现

C语言接口与实现

(美)David R. Hanson / 人民邮电出版社 / 2010-8 / 79.00元

可重用的软件模块是构建大规模可靠应用程序的基石,创建可重用的软件模块是每个程序员和项目经理必须掌握的技能。C语言对创建可重用的API提供的语言和功能支持非常少,虽然C程序员写应用时都会用到API和库,但却很少有人去创建和发布新的能广泛应用的API。本书介绍用一种基于接口的设计方法创建可重用的API,这一方法将接口与实现分离开来,且与语言无关。书中详细描述了24个接口及其实现,便于读者深入了解此方法......一起来看看 《C语言接口与实现》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具