tg_d 0.0.1

A library for creating Telegram bots


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

A DLang library for creating telegram bots

Features

  • Unified request execution method - execute
  • Unified types struct - abstract TelegramType
  • Full Telegram types support
  • Widespread use of exceptions

Todo

  • [ ] Webhook support
  • [ ] Full methods implementation
  • [ ] Write more examples
  • [ ] Updates checking loop
  • [ ] Signals for updtaes processing

The basics

Types

Every telegram type has 2 method for simple data sending/recieving

    TelegramType.getAsJson(); // Returns the type as a JSON record
    TelegramType.setFromJson(); // Init type`s values from server`s JSON response

Bot creating

    TelegramBot bot = new TelegramBot(bot_api);

File sending

    // There is a special type for sending files

    TelegramInputFile id = TelegramInputFile.createFromId(id); // Creates file for sending from already downloaded to the server file by it`s id
    TelegramInputFile url = TelegramInputFile.createFromUrl(url); // Creates file for sending from file form the Internek
    TelegramInputFile local = TelegramInputFile.createFromFile(path); // Creates file for sending from local file

Generating types implementation

You can regenerate types by this repo

Authors:
  • KonstantIMP
Dependencies:
requests
Versions:
0.0.8 2021-Oct-01
0.0.7 2021-Oct-01
0.0.6 2021-Aug-26
0.0.5 2021-Aug-26
0.0.4 2021-Aug-24
Show all 8 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 31 downloads total

Score:
0.4
Short URL:
tg_d.dub.pm