Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add getStarTransactions from Bot API 7.5 #1205

Open
imedfan opened this issue Jun 18, 2024 · 0 comments
Open

add getStarTransactions from Bot API 7.5 #1205

imedfan opened this issue Jun 18, 2024 · 0 comments

Comments

@imedfan
Copy link

imedfan commented Jun 18, 2024

Feature Request

This code adds getStarTransactions method and required type (https://core.telegram.org/bots/api#getstartransactions)

src/telegram.js

  /**
   * Use this method to get the bot's Telegram Star transactions.
   * On success, returns a [StarTransactions](https://core.telegram.org/bots/api#startransactions) object.
   * @param  {Object} [options] Additional Telegram query options
   * @return {Promise}
   * @see https://core.telegram.org/bots/api#startransactions
   */
  getStarTransactions(form = {}) {
      return this._request('getStarTransactions', { form });
  }

test/telegram.js

  describe('#getStarTransactions', function getStarTransactions() {
    before(function before() {
      utils.handleRatelimit(bot, 'getStarTransactions', this);
    });
    it('should return StarTransactions object', function test() {
      return bot.getWebHookInfo().then(resp => {
        assert.ok(is.object(resp));
      });
    });
  });

type definitions index.d.ts (https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-telegram-bot-api)

  interface StarTransaction {
        id: string;
        amount: number;
        date: number;
    }

 getStarTransactions(): Promise<TelegramBot.StarTransaction[]>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant