Coder Social home page Coder Social logo

evilsprut / nestjs-telegram Goto Github PK

View Code? Open in Web Editor NEW
92.0 92.0 23.0 1.24 MB

šŸ¤– A NestJS Telegram module for using the Telegram Bot API

License: MIT License

TypeScript 99.50% JavaScript 0.18% Shell 0.32%
bot nest nestjs telegram telegram-api telegram-bot-api

nestjs-telegram's Introduction

Hi there šŸ‘‹

nestjs-telegram's People

Contributors

andrewgrow avatar dependabot-preview[bot] avatar dependabot[bot] avatar evilsprut avatar jmcdo29 avatar rupikz avatar saeedsoltoon avatar severindk avatar xaosaki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nestjs-telegram's Issues

How does the sendDocument method work?

Does not work:

this.telegramService.sendDocument({
  chat_id: 100500,
  document: fs.createReadStream('error.txt') // <--- need to have Buffer here, tried a lot of ways to make it
}).subscribe()

Telegram API answers with code 400 without explanation.

Works:

import * as FormData from 'form-data';
...
const form = new FormData();
form.append('chat_id', chat_id);
form.append('document', Buffer.alloc(text.length, text), {filename: 'error.txt'});
form.submit(`https://api.telegram.org/bot${settings.telegramBot.key}/sendDocument`, function(err, response) {
 console.log(err, response);
});

Nest can't resolve dependencies of the TELEGRAM_MODULE_OPTIONS

Hi, when I follow steps from the readme I got following error:

ERROR [ExceptionHandler] Nest can't resolve dependencies of the TELEGRAM_MODULE_OPTIONS (?). 
Please make sure that the argument ConfigService at index [0] is available in the TelegramModule context.

Latest release

Please publish the latest release for the master branch

Correct type imports

Now, when i import some type, code for it looks like import { TelegramUser } from 'nestjs-telegram/dist/interfaces/telegramTypes.interface';, seems direct link to dist folder is not correct approach.

May be should change it to something like import { TelegramUser } from 'nestjs-telegram'?

Unexpected crush

Can't understand what happened.

[Error: ENOENT: no such file or directory, chmod 'node_modules/nestjs-telegram/node_modules/rxjs/migrations/update-6_0_0/.index.js 3.map.icloud'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'chmod',
  path: 'node_modules/nestjs-telegram/node_modules/rxjs/migrations/update-6_0_0/.index.js 3.map.icloud'
}

Node v15.4.0
Latest NestJS
Mac OS

Where is getUpdates method?

Hello, i can't find getUpdates method? Do you forget add it or you have some reasons to not implement it. Seems it is very common and helpful method.

Dependabot couldn't find the branch dev

Dependabot was set up to create pull requests against the branch dev, but couldn't find it.

If the branch has been permanently deleted you can update Dependabot's target branch from your dashboard.

You can mention @dependabot in the comments below to contact the Dependabot team.

this.url undefined

When I try to make a request axios dosen't get the first part of url from:

this.url = https://api.telegram.org/bot${this.options.botKey}/;

when I move that line to constructor from on moduleInit it works fine.

sendMessage work only once

there is a problem in sending messages, if you use sendMessaage for once, it work ok and fine but if you try that for second time in the same response such as:

.. SOMEā€ŒCALCULATIONS...
await this.telegram.sendMessage({
      chat_id: message.chat.id,
      text: 'MESSAGE',
      parse_mode: 'markdown',
});
.. SOMEOTHERā€ŒCALCULATIONS...
await this.telegram.sendMessage({ <-- this call will be ignored!
      chat_id: message.chat.id,
      text: 'ANOTHER_MESSAGE',
      parse_mode: 'markdown',
    });

also if you could handle long messages to split them and send them in order would be nice.

thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.