tg-d ~16-add-more-contracts-to-prevent-errors

To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

tg.d pipeline statuscoverage report

tg.d is a Telegram Bot API client implementation built to make fast and safe bots with the help of the D programming language.


API reference is available here.

Getting updates

Currently, only long polling is supported. Use TelegramBot.pollUpdates which provides high-level abstraction over TelegramBot.getUpdates.

import tg.d;

void main() {
	while(true) {
		foreach(update; TelegramBot("token").pollUpdates) {
			// Do something with `update`

Notice that everything is done in while(true) loop. It's possible because TelegramBot.pollUpdates defines timeout of 3 seconds by default which means that it'll block the running thread for 3-ish seconds.

  • Pavel Chebotarev
  • Anton Fediushin
vibe-d:data, vibe-d:tls, vibe-core, vibe-d:http
0.0.2 2018-Sep-06
0.0.1 2018-Aug-17
~master 2020-Mar-21
~16-add-more-contracts-to-prevent-errors 2018-Aug-16
Show all 4 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 66 downloads total

Short URL: