nitreojs / puregram Goto Github PK
View Code? Open in Web Editor NEWpowerful and modern telegram bot api sdk for node.js and typescript π
Home Page: https://puregram.cool
License: Do What The F*ck You Want To Public License
powerful and modern telegram bot api sdk for node.js and typescript π
Home Page: https://puregram.cool
License: Do What The F*ck You Want To Public License
ΠΡΠ΅ΡΠ° Ρ ΠΌΠ΅Π½Ρ Π² ΠΎΡΠΈΡΠΈΠ°Π»ΡΠ½ΠΎΠΉ Π±Π΅ΡΠ΅Π΄Π΅, Π±ΡΠ» Π±ΠΎΠ»ΡΡΠΎΠΉ Π½Π°ΠΏΠ»ΡΠ² Π½ΠΎΠ²ΡΡ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΉ, ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»ΠΈ Π½Π°ΡΠ°Π»ΠΈ Π°ΠΊΡΠΈΠ²Π½ΠΎ ΠΏΠΈΡΠ°ΡΡ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ, ΡΠ½Π°ΡΠ°Π»Π° Π±ΡΠ»ΠΈ Π»ΠΈΠΌΠΈΡΡ, ΠΏΠΎΡΠΎΠΌ Π²ΠΎΠΎΠ±ΡΠ΅ ΠΏΠ΅ΡΠ΅ΡΡΠ°Π»ΠΎ ΠΎΠ±ΡΠ°Π±Π°ΡΡΠ²Π°ΡΡ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ ΠΎΡ Π½ΠΈΡ ΠΈ Π½ΠΈΠΊΠ°ΠΊΠΈΠ΅ ΠΎΡΠΈΠ±ΠΊΠΈ Π½Π΅ Π²ΡΡ ΠΎΠ΄ΠΈΠ»ΠΈ. Π£ ΠΌΠ΅Π½Ρ Π²ΡΠ΅ ΠΏΡΠ΅ΠΊΡΠ°ΡΠ½ΠΎ ΡΠ°Π±ΠΎΡΠ°Π΅Ρ, Π° Ρ Π΄ΡΡΠ³ΠΈΡ Π»ΡΠ΄Π΅ΠΉ Π½Π΅Ρ ΠΏΠΎΡΠ΅ΠΌΡ-ΡΠΎ, Π΄ΡΠΌΠ°Π» ΠΏΡΠΎΠ±Π»Π΅ΠΌΠ° Π² ΠΌΠΎΠ΅ΠΌ ΠΊΠΎΠ΄Π΅, Π½ΠΎ Π² ΠΠ‘ Ρ Π΄ΡΡΠ³ΠΈΡ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΉ ΠΊΠ°ΠΊ ΠΎΠΊΠ°Π·Π°Π»ΠΎΡΡ Π²ΡΠ΅ ΡΠ°Π±ΠΎΡΠ°Π΅Ρ, ΠΏΠ»ΡΡ ΠΊΠΎΠ³Π΄Π° ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»ΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡΡ ΠΈΠ½Π»Π°ΠΉΠ½-ΠΊΠ½ΠΎΠΏΠΊΠΈ, ΠΏΠΎΡΠ»Π΅ ΠΌΠΎΠ΅Π³ΠΎ Π²Π²ΠΎΠ΄Π° ΠΊΠΎΠΌΠ°Π½Π΄Ρ, Ρ Π½ΠΈΡ ΠΎΠ½ ΠΎΡΠΊΠ»ΠΈΠΊΠ°Π΅ΡΡΡ, Π² ΡΠ΅ΠΌ ΠΌΠΎΠΆΠ΅Ρ Π±ΡΡΡ ΠΏΡΠΈΡΠΈΠ½Π°?
Π‘Π½Π°ΡΠ°Π»Π° ΠΏΡΠΈΠ»Π΅ΡΠ°Π΅Ρ
puregram:api/getUpdates response: {"ok":false,"error_code":409,"description":"Conflict: terminated by setWebhook request"}
ΠΠΎΡΠΎΠΌ Π±Π΅ΡΠΊΠΎΠ½Π΅ΡΠ½ΠΎ ΠΏΠΎΠ²ΡΠΎΡΡΡΡΡΡ ΠΎΡΠΈΠ±ΠΊΠΈ
puregram:updates:startFetchLoop an error has occurred: TypeError: Cannot read properties of null (reading 'error')
puregram:api/getUpdates response: {"ok":false,"error_code":409,"description":"Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}
ΠΡΠ»ΠΈ Π²ΡΡΡΠ°Π²ΠΈΡΡ apiRetryLimit Π½Π΅Π±ΠΎΠ»ΡΡΠΎΠΉ, ΡΠΎ ΡΡΠΎ Π² ΡΠ΅Π»ΠΎΠΌ ΡΠ΅ΡΠ°Π΅Ρ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ, Π½ΠΎ ΠΊΠΎΡΡΡΠ»ΡΠ½ΠΎ, Π²ΡΠ΅ ΡΠ°Π²Π½ΠΎ ΠΎΡΠ΅Π½Ρ ΠΌΠ½ΠΎΠ³ΠΎ Π·Π°ΠΏΡΠΎΡΠΎΠ² ΡΠ»Π΅Ρ ΠΈ ΠΎΡΠΈΠ±ΠΊΠΈ ΡΡΠΏΠΈΡ
puregram:updates:startFetchLoop tried to reconnect 10 times but it didn't work, cya next time
steps to reproduce the behavior:
await this.telegram.updates.startPolling();
await delay(10000);
this.telegram.updates.stopPolling();
await this.telegram.api.setWebhook({ url });
stopPolling Π΄ΠΎΠ»ΠΆΠ΅Π½ Π±ΡΡΡ Π°ΡΠΈΠ½Ρ ΡΠΎΠ½Π½ΡΠΌ ΠΈ ΠΆΠ΄Π°ΡΡ ΠΎΠΊΠΎΠ½ΡΠ°Π½ΠΈΡ ΡΠΈΠΊΠ»Π° ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΡ
package | version |
---|---|
puregram |
2.25.1 |
node |
latest |
TypeScript |
latest |
yarn or npm |
latest |
ΠΠΎΠ³ΠΈΠΊΠ° stopPolling ΠΏΠ»ΠΎΡ ΠΎ ΡΠ΅Π°Π»ΠΈΠ·ΠΎΠ²Π°Π½Π°, ΠΎΠ½ Π½Π΅ Π°ΡΠΈΠ½Ρ ΡΠΎΠ½Π΅Π½, ΠΊΠ°ΠΊ Π² ΠΏΡΠΈΠΌΠ΅ΡΠ΅, ΠΈ Π½Π΅ ΠΆΠ΄Π΅Ρ ΠΎΠΊΠΎΠ½ΡΠ°Π½ΠΈΡ ΡΠΈΠΊΠ»Π° ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΡ, ΡΡΠΎ ΠΏΡΠΈΠ²ΠΎΠ΄ΠΈΡ ΠΊ Π±Π΅ΡΠΊΠΎΠ½Π΅ΡΠ½ΡΠΌ ΠΎΡΠΈΠ±ΠΊΠ°ΠΌ (ΠΏΡΠΈ Π΄Π΅ΡΠΎΠ»ΡΠ½ΠΎΠΌ apiRetryLimit = -1)
ΠΏΠΎΠ»Π΅ isStarted ΠΏΡΠΈΠ²Π°ΡΠ½ΠΎΠ΅, ΠΏΠΎΡΡΠΎΠΌΡ Π±Π΅Π· ΠΊΠΎΡΡΡΠ»Π΅ΠΉ Π²Π½Π΅ΡΠ½ΡΡ Π»ΠΎΠ³ΠΈΠΊΡ ΠΏΡΠΎΠ²Π΅ΡΠΊΠΈ ΠΎΠΊΠΎΠ½ΡΠ°Π½ΠΈΡ ΡΠΈΠΊΠ»Π° ΠΆΠΈΠ·Π½ΠΈ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΡ Π½Π΅ ΠΏΠΎΠ»ΡΡΠΈΡΡΡ ΡΠ΄Π΅Π»Π°ΡΡ
Π‘Π½ΠΎΠ²Π° Π·Π΄ΡΠ°Π²ΡΡΠ²ΡΠΉ. ΠΡΡΠ°ΡΡΡ ΠΎΠ±ΡΠ°Π±ΠΎΡΠ°ΡΡ Π΄Π°Π½Π½ΡΠ΅ ΠΈΠ· ΡΠ΅ΡΡΠΈΠΈ Π² ΡΠΎΠ±ΡΡΠΈΠΈ callback_query, ΡΠΎ Π΅ΡΡΡ ΠΏΠΎΡΠ»Π΅ Π½Π°ΠΆΠ°ΡΠΈΡ ΠΊΠ½ΠΎΠΏΠΊΠΈ.
ΠΠΎ ΠΊΠ°ΠΊ Ρ ΠΏΠΎΠ½ΡΠ», Π²ΠΈΠ΄ΠΈΠΌΠΎ ΡΡΠΎ ΡΠ°ΠΊ ΠΈ Π΄ΠΎΠ»ΠΆΠ½ΠΎ Π±ΡΡΡ, ΡΠ΅ΡΡΠΈΠΈ Π΄ΠΎΡΡΡΠΏΠ½Ρ ΡΠΎΠ»ΡΠΊΠΎ Π² ΡΠΎΠ±ΡΡΠΈΡΡ
message, Π²Π΅ΡΠ½ΠΎ?
Π’ΠΎΠ³Π΄Π° ΠΊΠ°ΠΊ ΡΠ°Π±ΠΎΡΠ°ΡΡ Ρ Π½ΠΈΠΌΠΈ Π² Π΄ΡΡΠ³ΠΈΡ
ΡΠΎΠ±ΡΡΠΈΡΡ
? ΠΠ°ΠΏΡΠΈΠΌΠ΅Ρ ΠΌΠ½Π΅ Π½ΡΠΆΠ½ΠΎ Π²ΡΠΏΠΎΠ»Π½ΠΈΡΡ Π΄Π΅ΠΉΡΡΠ²ΠΈΠ΅ ΡΠ²ΡΠ·Π°Π½Π½ΠΎΠ΅ Ρ ΡΠ΅ΡΡΠΈΠ΅ΠΉ, ΠΏΠΎΡΠ»Π΅ Π½Π°ΠΆΠ°ΡΠΈΡ ΠΊΠ½ΠΎΠΏΠΊΠΈ.
steps to reproduce the behavior:
get message.forwardOrigin will throw error TypeError: Cannot read properties of undefined (reading 'type')
use this.payload.forward_origin.type
package | version |
---|---|
puregram |
2.25.1 |
node |
latest |
TypeScript |
latest |
yarn or npm |
latest |
ΠΠΌΠ΅ΡΡΠΎ this.payload.origin Π²Π΅ΡΠΎΡΡΠ½ΠΎ Π½Π°Π΄ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ forward_origin (this.payload.forward_origin)
https://core.telegram.org/bots/api#message
ΠΡ ΠΏΠ΅ΡΠ΅ΡΠ»Π°Π½Π½ΠΎΠ³ΠΎ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ ΠΈΠ· Π΄ΡΡΠ³ΠΎΠ³ΠΎ ΡΠ°ΡΠ° ΠΊΡΠ°ΡΠΈΡΡΡ ΡΡΠ»Π» ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅, ΠΏΠΎΡΠΎΠΌΡ ΡΡΠΎ memoizeGetters Π² ΠΊΠ°ΠΊΠΎΠΌ-ΡΠΎ ΠΌΠ΅ΡΡΠ΅ ΠΏΡΡΠ°Π΅ΡΡΡ Π²Π·ΡΡΡ forwardOrigin, ΠΊΠΎΡΠΎΡΡΠΉ Π² ΡΠ²ΠΎΡ ΠΎΡΠ΅ΡΠ΅Π΄Ρ ΡΡΠΏΠ΅Ρ ΠΎΡΠΈΠ±ΠΊΡ
ΠΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ Π² memoizeGetters ΡΡΠΎΠΈΡ Π΅ΡΠ΅ ΠΏΠΎΠ²Π΅ΡΠΈΡΡ try catch, ΡΡΠΎΠ±Ρ ΠΏΡΠΎΡΡΠΎ ΡΠ°ΠΊ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Π½Π΅ ΠΏΠ°Π΄Π°Π»ΠΎ, Π΅ΡΠ»ΠΈ ΡΡΠΎΡ ΡΡΠ½ΠΊΡΠΈΠΎΠ½Π°Π» Π½Π΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ (Ρ forwardOrigin Π½ΠΈΠ³Π΄Π΅ Π½Π΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡ, Π½ΠΎ ΠΏΡΠΎΡΡΠΎ ΠΎΡ ΠΏΡΠΈΠ»Π΅ΡΠ° ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ ΠΎΡΠΈΠ±ΠΊΠ° Π»ΠΎΠ²ΠΈΡΡΡ ΡΠΆΠ΅ Π½Π° process.on("uncaughtException", ...), Π΄Π°ΠΆΠ΅ Π½Π΅ Π² telegram.onError(...) )
koa
does not accept Updates.getKoaMiddleware()
because it returns Function
type and throwing this error
message.forwardedMessage.chat
resolve to undefined
Steps to reproduce the behavior:
console.log("fwc", update.message.forwardedMessage?.chat);
Expect forwardedMessage?.chat
to resolve to { id: -1001997091997, title: 'tgdaddytest', type: 'channel' }
Update message contains forward_from_chat, but fwc is undefined
package | 2.20.1 |
---|---|
puregram |
X.Y.Z |
node |
X.Y.Z |
TypeScript |
X.Y.Z |
yarn or npm |
X.Y.Z |
Add any other context about the problem here.
The code runs inside AWS lambda
SendMediaGroupParams['media']
type is wrong. Currently it is:
export interface SendMediaGroupParams {
...
media: Interfaces.TelegramInputMediaAudio | Interfaces.TelegramInputMediaDocument | Interfaces.TelegramInputMediaPhoto | Interfaces.TelegramInputMediaVideo[];
}
and should be:
export interface SendMediaGroupParams {
...
media: (Interfaces.TelegramInputMediaAudio | Interfaces.TelegramInputMediaDocument | Interfaces.TelegramInputMediaPhoto | Interfaces.TelegramInputMediaVideo)[];
}
notice the parenthesis
package | version |
---|---|
puregram |
2.2.0 |
ΠΡΠΈ ΠΏΠ΅ΡΠ΅Π΄Π°ΡΠ΅ Π² ctx.sendVoice Π±ΡΡΠ΅ΡΠ° Π°ΡΠ΄ΠΈΠΎ ΡΠ΅ΡΠ΅Π· MediaSource.buffer, Π»ΠΈΠ±Π° Π²ΡΠ΄Π°ΡΡ ΠΎΡΠΈΠ±ΠΊΡ
Steps to reproduce the behavior:
ctx.sendVoice(MediaSource.buffer(audioBuffer))
ΠΠΎΡ ΠΎΡΠΏΡΠ°Π²ΠΈΡ Π³ΠΎΠ»ΠΎΡΠΎΠ²ΠΎΠ΅ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅ Ρ Π½ΡΠΆΠ½ΡΠΌ ΠΌΠ½Π΅ Π°ΡΠ΄ΠΈΠΎ.
package | version |
---|---|
puregram |
2.9.8 |
node |
16.16.0 |
yarn or npm |
8.11.0 |
edited_channel_post
Π½Π΅ Π»ΠΎΠ²ΠΈΡ Π°ΠΏΠ΄Π΅ΠΉΡΡ ΠΏΡΠΈ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΈ ΠΏΠΎΡΡΠ°.
steps to reproduce the behavior:
ΠΏΡΠΈΠ»Π΅ΡΠΈΡ Π°ΠΏΠ΄Π΅ΠΉΡ
package | version |
---|---|
puregram |
2.26.1 |
node |
20.12.2 |
yarn or npm |
10.5.0 |
ΠΏΠ°Π²Π΅Π» Π΄ΡΡΠΎΠ² ΠΏΠΈΠ΄Π°ΡΠ°Ρ
Add the ability to change the API root (useful for Russian users who can run a proxy server for requests)
the bug is described as follows in the title
package | version |
---|---|
puregram |
2.2.0 |
TypeScript |
4.5.3 |
When i upload a file use Bun runtime i get AbortError
import { MediaSource, Telegram } from "puregram";
const bot = Telegram.fromToken(
""
);
await bot.api
.sendDocument({
chat_id: -1001996532865,
message_thread_id: 4,
document: MediaSource.path(
"some path",
)
})
I tried run it in Node and Bun. And when i run with node it's work
package | version |
---|---|
puregram |
2.23.1 |
TypeScript |
5.3.3 |
bun |
1.0.17 |
ΠΠ΅ΡΠ΅Π΄Π°Ρ suppress: true Π² context.replyWithMediaGroup(mediaGroup, { suppress: true }); ΡΡΠΎΠ±Ρ ΠΎΡΠ»ΠΎΠ²ΠΈΡΡ WEBPAGE_CURL_FAILED, ΠΎΡΠΈΠ±ΠΊΠ° ΡΡΠΏΠΏΡΠ΅ΡΠΈΡΡΡ, Π½ΠΎ Π΄Π°Π»ΡΡΠ΅ Π² ΠΊΠΎΠ΄Π΅ response.map Π²ΡΠ΄Π°Π΅Ρ ΠΎΡΠΈΠ±ΠΊΡ, ΡΠ°ΠΊ ΠΊΠ°ΠΊ ΡΠ΅ΡΠΏΠΎΠ½Ρ Π½Π΅ Π² ΡΠ°ΠΊΠΎΠΌ Π²ΠΈΠ΄Π΅, ΠΊΠ°ΠΊΠΎΠΌ ΠΎΠ½ ΠΆΠ΄Π°Π»
Π² ΠΌΠ΅ΡΠΎΠ΄Π°Ρ , Π³Π΄Π΅ Π²Π½ΡΡΡΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ response, Π½Π°Π΄ΠΎ Π΄Π΅Π»Π°ΡΡ Π²Π½ΡΡΡΠ΅Π½Π½ΡΡ ΠΏΡΠΎΠ²Π΅ΡΠΊΡ Π½Π° ΠΎΡΠΈΠ±ΠΊΡ ΠΈΠ»ΠΈ ΡΡΠΏΡΠ΅ΡΡ ΠΏΠΎ Π΄ΡΡΠ³ΠΎΠΌΡ Ρ Π΅Π½Π΄Π»ΠΈΡΡ
package | version |
---|---|
puregram |
X.Y.Z |
node |
X.Y.Z |
TypeScript |
X.Y.Z |
yarn or npm |
X.Y.Z |
Reply to user operation trying... (attempt 1)
2024-02-04T19:02:53.687Z puregram:api/sendMediaGroup HTTP βΊ
2024-02-04T19:02:53.691Z puregram:api/sendMediaGroup url: https://api.telegram.org/bot[token]/sendMediaGroup?chat_id=***&reply_parameters=%7B%22message_id%22%3A***%7D&suppress=true
2024-02-04T19:02:53.691Z puregram:api/sendMediaGroup params: {"chat_id":"***","reply_parameters":"{\"message_id\":***}","suppress":"true"}
2024-02-04T19:02:55.695Z puregram:api/sendMediaGroup βΉ HTTP 400
2024-02-04T19:02:55.695Z puregram:api/sendMediaGroup response: {"ok":false,"error_code":400,"description":"Bad Request: failed to send message #1 with the error message \"WEBPAGE_CURL_FAILED\""}
Error on first reply
TypeError: response.map is not a function
at MessageContext.sendMediaGroup (/app/node_modules/puregram/lib/contexts/mixins/send.js:209:25)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
attemptNumber: 1,
retriesLeft: 3
}
yes
add @puregram/markup
support for TelegramInputMessageContent
, that contains message_text
and entities
fields
bot.updates.on('inline_query', (c) => (
c.answerInlineQuery([
{
id: 'penis',
title: 'title',
type: 'article',
input_message_content: {
message_text: format`test ${bold('message')}`
}
}
])
));
ΠΎΡΠΈΠ±ΠΊΠ° Π²ΠΎΠ·Π½ΠΈΠΊΠ°Π΅Ρ ΠΊΠΎΠ³Π΄Π° ΡΠ΅Π»ΠΎΠ²Π΅ΠΊ ΠΎΡΡΠ°Π²Π»ΡΠ΅Ρ Π² ΡΠ°ΡΠ΅ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ Π² ΠΎΡΠ²Π΅Ρ Π½Π° ΠΏΠΎΡΡ Π² ΠΊΠ°Π½Π°Π»Π΅.
ΡΠ°ΠΊΠΎΠ΅ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅ Π½Π΅ ΠΎΡΠΎΠ±ΡΠ°Π·ΠΈΡΡΡ Π² update ΠΈΠ·-Π·Π° Error [ERR_INTERNAL_ASSERTION]: TypeError: Cannot read properties of undefined (reading 'type')
ΠΡΠ΅ΠΌΠ΅Π½Π½ΠΎΠ΅ ΡΠ΅ΡΠ΅Π½ΠΈΠ΅:
mediaGroup ΠΎΠ±ΡΠ΅ΠΊΡ Π»ΠΎΠΌΠ°Π΅ΡΡΡ ΠΏΠΎΡΠ»Π΅ Π΅Π³ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ Π² context.replyWithMediaGroup
Π΄ΠΎ: [{ type: 'video', media: { type: 'url', value: '***'; } } ]
ΠΏΠΎΡΠ»Π΅ [{ type: 'video', media: '***'; }]
(Ρ ΠΏΠΎΠ»Π΅ΠΌ media ΡΡΠΎ-ΡΠΎ ΡΡΡΠ°Π½Π½ΠΎΠ΅ ΠΏΡΠΎΠΈΡΡ ΠΎΠ΄ΠΈΡ)
steps to reproduce the behavior:
console.log("Π΄ΠΎ", mediaGroup)
await context.replyWithMediaGroup(mediaGroup) // Ρ ΠΌΠ΅Π½Ρ ΡΡΡ ΠΎΡΠΈΠ±ΠΊΠ° ΠΈΠ½ΠΎΠ³Π΄Π° Π²ΡΠ»Π΅Π·Π°Π΅Ρ ΠΈ Ρ
ΠΎΡΡ ΠΏΠ΅ΡΠ΅ΠΎΡΠΏΡΠ°Π²ΠΈΡΡ Π·Π°ΠΏΡΠΎΡ
console.log("ΠΏΠΎΡΠ»Π΅", mediaGroup)
ΠΎΡ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ mediaGroup, Π½Π΅ ΠΎΠ½ Π½Π΅ Π΄ΠΎΠ»ΠΆΠ΅Π½ ΠΌΠ΅Π½ΡΡΡΡΡ ΠΏΠΎ ΡΠ΅ΡΡ
package | version |
---|---|
puregram |
X.Y.Z |
node |
X.Y.Z |
TypeScript |
X.Y.Z |
yarn or npm |
X.Y.Z |
Ρ Π½Π΅ ΡΠΌΠΎΠ³ ΡΡΠ΅ΠΉΡΠ½ΡΡΡ ΠΎΡΠΈΠ±ΠΊΡ Π² ΠΊΠΎΠ΄Π΅ Ρ ΡΠ΅Π±Ρ, Π½Π°Π΄ΠΎ ΡΠ΅ΠΊΠ°ΡΡ Π±ΠΎΠ»Π΅Π΅ Π΄Π΅ΡΠ°Π»ΡΠ½ΠΎ, ΠΏΠΎΠΊΠ° Π΄Π΅ΡΡΠΈ ΡΠΈΠΊΡ ΠΏΠΎΠ²Π΅ΡΠΈΠ»
static fixUrl(mediaGroup: SendMediaGroupParams["media"]) {
mediaGroup.forEach((inputMedia) => Object.assign(
inputMedia,
typeof inputMedia.media === "string" ||
inputMedia.media instanceof String
? {
media: MediaSource.url(
inputMedia.media as unknown as string,
),
}
: {},
));
}
ΡΠ·Π΅ΡΠΊΠ΅ΠΉΡ ΡΠ°ΠΊΠΎΠΉ:
ΠΏΠΎΠΏΡΠΎΠ±ΠΎΠ²Π°ΡΡ ΠΎΡΠΏΡΠ°Π²ΠΈΡΡ url ΠΏΡΠΎΡΡΠΎ, ΠΈΠ½ΠΎΠ³Π΄Π° Π² ΡΠ΅Π»Π΅Π³Π΅ Π½Π΅ ΠΏΡΠΎΡ
ΠΎΠ΄ΠΈΡ, Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ ΡΡΠΏΠ΅Ρ ΠΎΡΠΈΠ±ΠΊΡ WEBPAGE_CURL_FAILED ΠΈΠ»ΠΈ Wrong file identifier/HTTP URL specified, ΠΏΡΠΎΠ±ΡΡ ΠΏΠ΅ΡΠ΅ΠΎΡΠΏΡΠ°Π²ΠΈΡΡ Ρ ΡΠ΅ΠΌ ΠΆΠ΅ mediaGroup - Π»ΠΎΠ²Π»Ρ ΠΎΡΠΈΠ±ΠΊΡ Error on reply TypeError: expected media to be created via MediaSource at Telegram.createAttachMediaInput (/app/node_modules/puregram/lib/telegram.js:257:19)
, Π΅ΡΠ»ΠΈ Π΅ΡΠ΅ ΡΠ°Π· Π·Π°ΠΏΡΠΎΡ Π½Π΅ ΠΏΡΠΎΠΉΠ΄Π΅Ρ, ΡΠΎ ΠΏΠ΅ΡΠ΅ΠΎΡΠΏΡΠ°Π²ΠΈΡΡ Ρ forceUpload: true (Π½Ρ ΡΡΡ Ρ ΡΠΆΠ΅ ΠΊΠΎΠ½Π²Π΅ΡΡΠ°Ρ, Π½ΠΎ Π² ΡΠΎΠΌ ΡΠΈΡΠ»Π΅, ΠΏΡΠΎΡΠ»ΡΠΉ mediaGroup Π½Π΅ΡΠ·Π°Π±Π΅Π»ΡΠ½ΡΠΉ)
ΠΏΠ»ΡΡ Π΅ΡΠ΅ ΡΡΡΠ°Π½Π½ΠΎ ΡΡΠΎ ΡΠ°ΠΉΠΏΡΠΊΡΠΈΠΏΡ Π½Π΅ ΡΠΏΠ°Ρ Π½Π° Π±ΠΈΠ»Π΄Π΅, ΠΏΠΎΡΠΎΠΌΡ ΡΡΠΎ media ΡΡΠ°Π½ΠΎΠ²ΠΈΡΡΡ ΡΡΡΠΎΠΊΠΎΠΉ ΠΊΠ°ΠΊ Ρ ΠΏΠΎΠ½ΡΠ» ΠΈ ΡΠ°ΠΌ Π΅Π³ΠΎ Π²ΠΎΠΎΠ±ΡΠ΅ Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ Π±ΡΡΡ, ΠΏΠΎ ΡΠΈΠΏΠ°ΠΌ
Repository doesn't contain a license file.
If the project is published without a license, then by default, all rights to the code remain the property of the author (All rights reserved).
ΠΡΠΈΠ±ΠΊΠ° ΡΠΈΠΏΠΈΠ·Π°ΡΠΈΠΈ ΠΏΡΠΈ ΡΠ±ΠΎΡΠΊΠ΅ ΠΏΡΠΎΠ΅ΠΊΡΠ°.
10 export declare type HearConditions<T> = (AllowArray<HearCondition<T, string | undefined>> | AllowArray<HearObjectCondition<T>>);
~
node_modules/.pnpm/@[email protected][email protected]/node_modules/@puregram/hear/lib/types.d.ts:10:36
10 export declare type HearConditions<T> = (AllowArray<HearCondition<T, string | undefined>> | AllowArray<HearObjectCondition<T>>);
~
This type parameter might need an `extends Record<string, any>` constraint.
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/common/message-entities.d.ts:28:5 - error TS2416: Property 'with' in type 'MessageEntities' is not assignable to the same property in base type 'MessageEntity[]'.
Type '(payload: Partial<Known<TelegramMessageEntity>>) => MessageEntities' is not assignable to type '(index: number, value: MessageEntity) => MessageEntity[]'.
Types of parameters 'payload' and 'index' are incompatible.
Type 'number' has no properties in common with type 'Partial<Known<TelegramMessageEntity>>'.
28 with(payload: Partial<Known<Interfaces.TelegramMessageEntity>>): MessageEntities;
~~~~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/common/structures/composer.d.ts:3:22 - error TS2417: Class static side 'typeof import("/root/titsex/telegram-image-bot/node_modules/.pnpm/[email protected]/node_modules/puregram/lib/common/structures/composer").Composer' incorrectly extends base class static side 'typeof import("/root/titsex/telegram-image-bot/node_modules/.pnpm/[email protected]/node_modules/middleware-io/lib/composer").Composer'.
The types of 'builder().middlewares' are incompatible between these types.
Type 'import("/root/titsex/telegram-image-bot/node_modules/.pnpm/[email protected]/node_modules/middleware-io/lib/types").Middleware<import("/root/titsex/telegram-image-bot/node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/context").Context>[]' is not assignable to type 'import("/root/titsex/telegram-image-bot/node_modules/.pnpm/[email protected]/node_modules/middleware-io/lib/types").Middleware<Context>[]'.
Type 'import("/root/titsex/telegram-image-bot/node_modules/.pnpm/[email protected]/node_modules/middleware-io/lib/types").Middleware<import("/root/titsex/telegram-image-bot/node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/context").Context>' is not assignable to type 'import("/root/titsex/telegram-image-bot/node_modules/.pnpm/[email protected]/node_modules/middleware-io/lib/types").Middleware<Context>'.
Type 'Context' is not assignable to type 'import("/root/titsex/telegram-image-bot/node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/context").Context'.
Type 'UnknownObject' is missing the following properties from type 'Context': telegram, updateType, is, [Symbol.toStringTag]
3 export declare class Composer<T extends Context> extends MiddlewareComposer<T> {
~~~~~~~~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/common/structures/composer.d.ts:3:77 - error TS2344: Type 'T' does not satisfy the constraint 'UnknownObject'.
Type 'Context' is not assignable to type 'UnknownObject'.
Index signature for type 'string' is missing in type 'Context'.
3 export declare class Composer<T extends Context> extends MiddlewareComposer<T> {
~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/chat-join-request.d.ts:21:11 - error TS2320: Interface 'ChatJoinRequestContext' cannot simultaneously extend types 'ChatJoinRequest' and 'ChatInviteControlMixin'.
Named property 'from' of types 'ChatJoinRequest' and 'ChatInviteControlMixin' are not identical.
21 interface ChatJoinRequestContext extends Constructor<ChatJoinRequestContext>, ChatJoinRequest, TargetMixin, SendMixin, ChatActionMixin, ChatInviteControlMixin, CloneMixin<ChatJoinRequestContext, ChatJoinRequestContextOptions> {
~~~~~~~~~~~~~~~~~~~~~~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/chat-join-request.d.ts:21:11 - error TS2320: Interface 'ChatJoinRequestContext' cannot simultaneously extend types 'ChatJoinRequest' and 'TargetMixin'.
Named property 'from' of types 'ChatJoinRequest' and 'TargetMixin' are not identical.
21 interface ChatJoinRequestContext extends Constructor<ChatJoinRequestContext>, ChatJoinRequest, TargetMixin, SendMixin, ChatActionMixin, ChatInviteControlMixin, CloneMixin<ChatJoinRequestContext, ChatJoinRequestContextOptions> {
~~~~~~~~~~~~~~~~~~~~~~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/chat-member.d.ts:20:11 - error TS2320: Interface 'ChatMemberContext' cannot simultaneously extend types 'ChatMemberUpdated' and 'ChatControlMixin'.
Named property 'from' of types 'ChatMemberUpdated' and 'ChatControlMixin' are not identical.
20 interface ChatMemberContext extends Constructor<ChatMemberContext>, ChatMemberUpdated, TargetMixin, SendMixin, ChatActionMixin, ChatControlMixin, CloneMixin<ChatMemberContext, ChatMemberContextOptions> {
~~~~~~~~~~~~~~~~~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/chat-member.d.ts:20:11 - error TS2320: Interface 'ChatMemberContext' cannot simultaneously extend types 'ChatMemberUpdated' and 'TargetMixin'.
Named property 'from' of types 'ChatMemberUpdated' and 'TargetMixin' are not identical.
20 interface ChatMemberContext extends Constructor<ChatMemberContext>, ChatMemberUpdated, TargetMixin, SendMixin, ChatActionMixin, ChatControlMixin, CloneMixin<ChatMemberContext, ChatMemberContextOptions> {
~~~~~~~~~~~~~~~~~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/chosen-inline-result.d.ts:25:11 - error TS2320: Interface 'ChosenInlineResultContext' cannot simultaneously extend types 'ChosenInlineResult' and 'ChatActionMixin'.
Named property 'senderId' of types 'ChosenInlineResult' and 'ChatActionMixin' are not identical.
25 interface ChosenInlineResultContext extends Constructor<ChosenInlineResultContext>, ChosenInlineResult, SendMixin, ChatActionMixin, CloneMixin<ChosenInlineResultContext, ChosenInlineResultContextOptions> {
~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/chosen-inline-result.d.ts:25:11 - error TS2320: Interface 'ChosenInlineResultContext' cannot simultaneously extend types 'ChosenInlineResult' and 'SendMixin'.
Named property 'senderId' of types 'ChosenInlineResult' and 'SendMixin' are not identical.
25 interface ChosenInlineResultContext extends Constructor<ChosenInlineResultContext>, ChosenInlineResult, SendMixin, ChatActionMixin, CloneMixin<ChosenInlineResultContext, ChosenInlineResultContextOptions> {
~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/poll-answer.d.ts:21:11 - error TS2320: Interface 'PollAnswerContext' cannot simultaneously extend types 'PollAnswer' and 'ChatActionMixin'.
Named property 'senderId' of types 'PollAnswer' and 'ChatActionMixin' are not identical.
21 interface PollAnswerContext extends Constructor<PollAnswerContext>, PollAnswer, SendMixin, ChatActionMixin, CloneMixin<PollAnswerContext, PollAnswerContextOptions> {
~~~~~~~~~~~~~~~~~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/poll-answer.d.ts:21:11 - error TS2320: Interface 'PollAnswerContext' cannot simultaneously extend types 'PollAnswer' and 'SendMixin'.
Named property 'senderId' of types 'PollAnswer' and 'SendMixin' are not identical.
21 interface PollAnswerContext extends Constructor<PollAnswerContext>, PollAnswer, SendMixin, ChatActionMixin, CloneMixin<PollAnswerContext, PollAnswerContextOptions> {
~~~~~~~~~~~~~~~~~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/pre-checkout-query.d.ts:24:11 - error TS2320: Interface 'PreCheckoutQueryContext' cannot simultaneously extend types 'PreCheckoutQuery' and 'ChatActionMixin'.
Named property 'senderId' of types 'PreCheckoutQuery' and 'ChatActionMixin' are not identical.
24 interface PreCheckoutQueryContext extends Constructor<PreCheckoutQueryContext>, PreCheckoutQuery, SendMixin, ChatActionMixin, CloneMixin<PreCheckoutQueryContext, PreCheckoutQueryContextOptions> {
~~~~~~~~~~~~~~~~~~~~~~~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/pre-checkout-query.d.ts:24:11 - error TS2320: Interface 'PreCheckoutQueryContext' cannot simultaneously extend types 'PreCheckoutQuery' and 'SendMixin'.
Named property 'senderId' of types 'PreCheckoutQuery' and 'SendMixin' are not identical.
24 interface PreCheckoutQueryContext extends Constructor<PreCheckoutQueryContext>, PreCheckoutQuery, SendMixin, ChatActionMixin, CloneMixin<PreCheckoutQueryContext, PreCheckoutQueryContextOptions> {
~~~~~~~~~~~~~~~~~~~~~~~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/shipping-query.d.ts:17:11 - error TS2320: Interface 'ShippingQueryContext' cannot simultaneously extend types 'ShippingQuery' and 'ChatActionMixin'.
Named property 'senderId' of types 'ShippingQuery' and 'ChatActionMixin' are not identical.
17 interface ShippingQueryContext extends Constructor<ShippingQueryContext>, ShippingQuery, SendMixin, ChatActionMixin, CloneMixin<ShippingQueryContext, ShippingQueryContextOptions> {
~~~~~~~~~~~~~~~~~~~~
node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/shipping-query.d.ts:17:11 - error TS2320: Interface 'ShippingQueryContext' cannot simultaneously extend types 'ShippingQuery' and 'SendMixin'.
Named property 'senderId' of types 'ShippingQuery' and 'SendMixin' are not identical.
17 interface ShippingQueryContext extends Constructor<ShippingQueryContext>, ShippingQuery, SendMixin, ChatActionMixin, CloneMixin<ShippingQueryContext, ShippingQueryContextOptions> {
~~~~~~~~~~~~~~~~~~~~
Found 16 errors in 9 files.
Errors Files
1 node_modules/.pnpm/@[email protected][email protected]/node_modules/@puregram/hear/lib/types.d.ts:10
1 node_modules/.pnpm/[email protected]/node_modules/puregram/lib/common/message-entities.d.ts:28
2 node_modules/.pnpm/[email protected]/node_modules/puregram/lib/common/structures/composer.d.ts:3
2 node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/chat-join-request.d.ts:21
2 node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/chat-member.d.ts:20
2 node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/chosen-inline-result.d.ts:25
2 node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/poll-answer.d.ts:21
2 node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/pre-checkout-query.d.ts:24
2 node_modules/.pnpm/[email protected]/node_modules/puregram/lib/contexts/shipping-query.d.ts:17```
ΠΠ΅ΠΊΠΎΡΡΠ΅ΠΊΡΠ½Π°Ρ ΡΠ°Π±ΠΎΡΠ° ΠΌΠΎΠ΄ΡΠ»Ρ @puregram/markup
import { bold, code, format, italic, hooks as markupHooks } from '@puregram/markup'
telegram.useHooks(markupHooks())
const message = format`
π» ${bold`ΠΠΎΠΌΠ°Π½Π΄Π° Π½Π΅ Π½Π°ΠΉΠ΄Π΅Π½Π°!`}
β ${italic`ΠΠΎΠΏΡΠΎΠ±ΡΠΉΡΠ΅ Π²Π²Π΅ΡΡΠΈ ${code`/start`}, ΡΡΠΎΠ±Ρ Π½Π°ΡΠ°ΡΡ Π·Π°Π½ΠΎΠ²ΠΎ!`}
`
await context.send(message)
ΠΠΎΡΠΌΠ°Π»ΡΠ½ΠΎΠ΅ ΡΠΎΡΠΌΠ°ΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅, Π½Π΅ Π΄ΠΎΠ»ΠΆΠ½ΠΎ ΡΡΡΠΈΠΏΠ°ΡΡ newline (afaik Π΄ΠΎΠ»ΠΆΠ½ΠΎ Π΄Π΅Π»Π°ΡΡ strip indent/s) ΠΈ Π΄ΠΎΠ»ΠΆΠ½ΠΎ ΠΏΡΠ°Π²ΠΈΠ»ΡΠ½ΠΎ ΡΠ°ΡΡΡΠ°Π²Π»ΡΡΡ entities.
package | version |
---|---|
@puregram/markup |
1.2.0 |
node |
latest as of 04.01.2024 |
TypeScript |
5.3.3 |
yarn or npm |
latest as of 04.01.2024 |
ΠΡΡΠ°ΡΡΡ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ @puregram/sessions, ΠΊΠ°ΠΊ Π»ΡΠ±ΠΎΠΉ ΡΠ°Π·ΡΠ°Π±ΠΎΡΡΠΈΠΊ, ΡΡΠΎΠ±Ρ ΠΏΠΎΠ½ΡΡΡ, ΠΊΠ°ΠΊ ΠΌΠ½Π΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΡΠΎΡ ΠΈΠ»ΠΈ ΠΈΠ½ΠΎΠΉ ΠΏΠ°ΠΊΠ΅Ρ, Ρ ΠΏΠΎΠ»Π΅Π· Π² Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ.
Π‘Π½Π°ΡΠ°Π»Π° Ρ Π·Π°Π»Π΅Π· Π² examples/session.js, Π³Π΄Π΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ SessionManager ΠΈ Π²ΡΡΡΠΎΠ΅Π½Π½ΡΠΉ middleware, Π½ΠΎ ΡΠ°ΠΊ ΠΊΠ°ΠΊ Ρ ΡΠ°Π±ΠΎΡΠ°Ρ Ρ typescript, ΠΏΠ΅ΡΠ΅ΡΠ΅Π» Π² packages/session ΠΈ ΡΠ°ΠΌ ΡΠΆΠ΅ Π² README Π²ΠΈΠ΄ΠΈΠΌΠΎ ΡΡΠ°ΡΠ°Ρ Π²Π°ΡΠΈΠ°ΡΠΈΡ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ ΡΠ΅ΡΡΠΈΠΉ, Π²Π΅Π΄Ρ ΠΈΠΌΠΏΠΎΡΡΠΈΡΡΠ΅ΡΡΡ ΠΈΠ· Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠΈ ΠΊΠ°ΠΊΠΎΠΉ-ΡΠΎ ΠΌΠ΅ΡΠΎΠ΄ session.
Π‘ΠΎΠ±ΡΡΠ²Π΅Π½Π½ΠΎ, Π²ΠΎΡ examples/session:
Π£ ΠΏΠ°ΡΡ Π²ΠΎΠΏΡΠΎΡΠΎΠ², ΠΊΠΎΡΠΎΡΡΠ΅ ΠΈΡΡ ΠΎΠ΄Ρ ΠΈΠ· ΡΠ°Π·Π»ΠΈΡΠΈΠΉ Π² ΠΏΡΠΈΠΌΠ΅ΡΠ°Ρ ΠΈ Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ, Ρ Π½Π΅ ΠΏΠΎΠ½ΡΠ»:
when calling any method with entities
/caption_entities
parameters (example) and providing them as MessageEntity[]
, TypeScript tells me that these types are incompatible, but they should be
package | version |
---|---|
puregram |
2.2.0 |
TypeScript |
4.3.4 |
https://github.com/nitreojs/puregram/blob/lord/scripts/generate-interfaces/index.ts#L135
ΠΡΠΈ { parse_mode: 'markdownv2' } ΠΈ ΠΏΡΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠΈ ΡΠΎΡΠΊΠΈ Π² ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠΈ Π²ΡΠ»Π΅ΡΠ°Π΅Ρ ΠΎΡΠΈΠ±ΠΊΠ°.
Steps to reproduce the behavior:
ΠΡΠΏΡΠ°Π²ΠΊΠ° ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ Ρ ΠΆΠΈΡΠ½ΡΠΌ ΡΠ΅ΠΊΡΡΠΎΠΌ.
package | version |
---|---|
puregram |
2.11.0 |
node |
16.16.0 |
TypeScript |
NOT_USED |
yarn or npm |
8.11.0 |
critical Π±Π°Π³ ΠΈΡΠΏΡΠ°Π²ΡΡΠ΅ ΠΏΠΆ ΠΎΠ½ Π»ΠΎΠΌΠ°Π΅Ρ ΡΠΈΡΡΠ΅ΠΌΡ Π·Π°ΡΠΈΡΡ ΠΌΠ°ΠΉΠΊΡΠΎΡΠΎΡΡ
i can't chang keybord layout help plz
Π±Π΅ΡΠΏΠ»Π°ΡΠ½ΡΠΉ ΡΠ°ΠΉ Ρ Π±ΡΠ»ΠΎΡΠΊΠΎΠΉ
package | version |
---|---|
windows |
2000 |
node |
1.2.5 |
minecraft |
1.5.2 |
yarn or npm |
wtf is that |
videocard |
rtx 3060 mobile π |
Ρ Ρ ΠΎΡΡ ΠΏΠ΅ΡΠ΅Π΄Π°ΡΡ ΠΏΡΠΈΠ²Π΅Ρ Π²ΡΠ΅ΠΌ ΠΏΠΎΠ΄ΠΏΠΈΡΡΠΈΠΊΠ°ΠΌ ΠΌΠΎΠ΅Π³ΠΎ ΠΏΠ°Π±Π»ΠΈΠΊΠ° Π²ΠΊΠΎΠ½ΡΠ°ΠΊΡΠ΅!!
Is your feature request related to a problem? Please describe.
THERE is a PROBLEm.
Right now, default branch called 'lord'. That's not a problem.
Problem is that it's not called 'megatron'? thanks.
Describe the solution you'd like
Call 911 the default branch megatron.
Describe alternatives you've considered
Or maybe kuulilennuteetunneliluuk
Additional context
I also like bananas.
ΠΡΠ»ΠΈ ΠΏΡΠΈ ΠΏΠΎΠ΄ΠΊΠ»ΡΡΠ΅Π½ΠΈΠΈ ΠΊ LongPoll Π½Π΅ ΡΠ΄Π°Π»ΠΎΡΡ ΠΏΠΎΠ»ΡΡΠΈΡΡ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ ΠΎ Π±ΠΎΡΠ΅ (Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ Telegam Π·Π°Π±Π»ΠΎΠΊΠΈΡΠΎΠ²Π°Π½ Ρ ΠΎΠΏΠ΅ΡΠ°ΡΠΎΡΠ°, Π»ΠΈΠ±ΠΎ Π»ΡΠ±Π°Ρ Π΄ΡΡΠ³Π°Ρ ΠΏΡΠΈΡΠΈΠ½Π°), ΡΠΎ ΠΏΡΠΎΠΌΠΈΡ startPolling Π½Π΅ Π²ΡΠ±ΡΠ°ΡΡΠ²Π°Π΅Ρ ΡΠΎΠΎΡΠ²Π΅ΡΡΡΠ²Π΅Π½Π½ΡΡ ΠΎΡΠΈΠ±ΠΊΡ.
package | version |
---|---|
puregram |
2.1.0 |
node |
16.4.1 |
TypeScript |
4.3.2 |
yarn or npm |
7.18.1 |
https://github.com/nitreojs/puregram/blob/master/packages/puregram/src/updates.ts#L342-L348
telegram.updates.on('inline_query', (context) => {
console.log(message);
return message.answerInlineQuery([{
type: 'article',
title: 'foo bar baz',
input_message_content: {
message_text: 'fiz'
}
}]);
});
sending an inline query result
APIError: Bad Request: can't parse inline query result: Can't find field "id"
package | version |
---|---|
puregram |
2.0.4 & 2.2.0 |
when handling messages and forwarding some bot message with url buttons in it, there is no replyMarkup
in logs; however, the property does exist and works fine
package | version |
---|---|
puregram |
2.2.0 |
The typescript does not compile when I have used the Puregram package for the TelegramBot.
Steps to reproduce the behavior:
Typescript builds without errors.
package | version |
---|---|
puregram |
2.9.8 |
node |
18.12.1 |
TypeScript |
4.7.4 |
yarn |
1.22.19 |
` node_modules/puregram/lib/common/structures/composer.d.ts:3:22 - error TS2417: Class static side 'typeof import("/path/to/my/app/node_modules/puregram/lib/common/structures/composer").Composer' incorrectly extends base class static side 'typeof import("/path/to/my/app/node_modules/middleware-io/lib/composer").Composer'.
The types of 'builder().middlewares' are incompatible between these types.
Type 'import("/path/to/my/app/node_modules/middleware-io/lib/types").Middleware<import("/path/to/my/app/node_modules/puregram/lib/contexts/context").Context>[]' is not assignable to type 'import("/path/to/my/app/node_modules/middleware-io/lib/types").Middleware[]'.
Type 'import("/path/to/my/app/node_modules/middleware-io/lib/types").Middleware<import("/path/to/my/app/node_modules/puregram/lib/contexts/context").Context>' is not assignable to type 'import("/path/to/my/app/node_modules/middleware-io/lib/types").Middleware'.
Type 'Context' is not assignable to type 'import("/path/to/my/app/node_modules/puregram/lib/contexts/context").Context'.
Type 'UnknownObject' is missing the following properties from type 'Context': telegram, updateType, is, [Symbol.toStringTag]
3 export declare class Composer extends MiddlewareComposer {
~~~~~~~~
node_modules/puregram/lib/common/structures/composer.d.ts:3:77 - error TS2344: Type 'T' does not satisfy the constraint 'UnknownObject'.
Type 'Context' is not assignable to type 'UnknownObject'.
Index signature for type 'string' is missing in type 'Context'.
3 export declare class Composer extends MiddlewareComposer {
~
node_modules/puregram/lib/contexts/chat-join-request.d.ts:17:11 - error TS2320: Interface 'ChatJoinRequestContext' cannot simultaneously extend types 'ChatJoinRequest' and 'TargetMixin'.
Named property 'from' of types 'ChatJoinRequest' and 'TargetMixin' are not identical.
17 interface ChatJoinRequestContext extends Constructor, ChatJoinRequest, TargetMixin, SendMixin, CloneMixin<ChatJoinRequestContext, ChatJoinRequestContextOptions> {
~~~~~~~~~~~~~~~~~~~~~~
node_modules/puregram/lib/contexts/chat-member.d.ts:20:11 - error TS2320: Interface 'ChatMemberContext' cannot simultaneously extend types 'ChatMemberUpdated' and 'TargetMixin'.
Named property 'from' of types 'ChatMemberUpdated' and 'TargetMixin' are not identical.
20 interface ChatMemberContext extends Constructor, ChatMemberUpdated, TargetMixin, SendMixin, CloneMixin<ChatMemberContext, ChatMemberContextOptions> {
~~~~~~~~~~~~~~~~~
node_modules/puregram/lib/contexts/chosen-inline-result.d.ts:25:11 - error TS2320: Interface 'ChosenInlineResultContext' cannot simultaneously extend types 'ChosenInlineResult' and 'SendMixin'.
Named property 'senderId' of types 'ChosenInlineResult' and 'SendMixin' are not identical.
25 interface ChosenInlineResultContext extends Constructor, ChosenInlineResult, SendMixin, CloneMixin<ChosenInlineResultContext, ChosenInlineResultContextOptions> {
~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/puregram/lib/contexts/poll-answer.d.ts:17:11 - error TS2320: Interface 'PollAnswerContext' cannot simultaneously extend types 'PollAnswer' and 'SendMixin'.
Named property 'senderId' of types 'PollAnswer' and 'SendMixin' are not identical.
17 interface PollAnswerContext extends Constructor, PollAnswer, SendMixin, CloneMixin<PollAnswerContext, PollAnswerContextOptions> {
~~~~~~~~~~~~~~~~~
node_modules/puregram/lib/contexts/pre-checkout-query.d.ts:24:11 - error TS2320: Interface 'PreCheckoutQueryContext' cannot simultaneously extend types 'PreCheckoutQuery' and 'SendMixin'.
Named property 'senderId' of types 'PreCheckoutQuery' and 'SendMixin' are not identical.
24 interface PreCheckoutQueryContext extends Constructor, PreCheckoutQuery, SendMixin, CloneMixin<PreCheckoutQueryContext, PreCheckoutQueryContextOptions> {
~~~~~~~~~~~~~~~~~~~~~~~
node_modules/puregram/lib/contexts/shipping-query.d.ts:17:11 - error TS2320: Interface 'ShippingQueryContext' cannot simultaneously extend types 'ShippingQuery' and 'SendMixin'.
Named property 'senderId' of types 'ShippingQuery' and 'SendMixin' are not identical.
17 interface ShippingQueryContext extends Constructor, ShippingQuery, SendMixin, CloneMixin<ShippingQueryContext, ShippingQueryContextOptions> { `
A clear and concise description of what the bug is.
Steps to reproduce the behavior:
started bot
https://pastenow.ru/6024c955b2e8921638db5d9033d5219e
package | version |
---|---|
puregram |
^2.8.2 |
node |
14.20.0 |
TypeScript |
not use |
yarn or npm |
npm |
Add any other context about the problem here.
I'm trying to handle pre_checkout_query updates and I have this code which throws an error
TypeError: Cannot read properties of undefined (reading 'telegram')
at answerPreCheckoutQuery (file:///var/task/src/functions/shopTelegramWebhook/handler.mjs:37707:21)
at handleUpdate (file:///var/task/src/functions/shopTelegramWebhook/handler.mjs:66424:11)
at Runtime.handler (file:///var/task/src/functions/shopTelegramWebhook/handler.mjs:66369:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Code:
async function handleUpdate({
update,
telegram,
}: {
update: TelegramUpdate;
telegram: Telegram;
}) {
const context = telegram.updates.handleUpdate(update);
if (context?.is("pre_checkout_query")) {
console.log(context.invoicePayload);
await context.answerPreCheckoutQuery({ ok: true });
}
}
Note the invoicePayload is correctly logged from the context.
steps to reproduce the behavior:
context.answerPreCheckoutQuery({ ok: true })
Expect the call to not throw an error
package | version |
---|---|
puregram |
2.25.1 |
TypeScript |
5 |
ΡΠΈΡΡΠΊΠ° ΠΏΠΈΡΡΠΊΠ° ΠΊΠΈΡΠΊΠ° ΠΆΠΎΠΏΠ°
as follows in the title
I shidded my pant
Steps to reproduce:
ECONNRESET wtf how to start a b0t
I started using puregram recently (yesterday) and I'm trying to migrate the method I used in telegraf, where when forwarding a media group to the bot it would send the media to some channels.
I've tried several different ways but I always end up getting the error TypeError: Cannot read properties of undefined (reading 'thumb')
I'm not an expert, so I'd like to know what I'm doing wrong.
const getFilesInMediaGroup = async (attachments) => {
const extractedMedia = [];
attachments.forEach(attachment => {
if (attachment.mimeType && attachment.mimeType.slice(0, attachment.mimeType.lastIndexOf('/')) == 'video') {
//extractedMedia.push(InputMedia.video(MediaSource.fileId(attachment.fileId)))
extractedMedia.push({
media: attachment.fileId,
type: 'video',
caption: "**My caption\\!**",
parse_mode: "MarkdownV2",
});
}
if (attachment.bigSize) {
//extractedMedia.push(InputMedia.photo(MediaSource.fileId(attachment.bigSize.fileId)))
extractedMedia.push({
media: attachment.bigSize.fileId,
type: 'photo',
});
}
});
return extractedMedia;
}
bot.updates.on('message', async (context) => {
if (context.isMediaGroup()) {
let chat_id = '-100******';
let mediaGroup = await getFilesInMediaGroup(context.mediaGroup.attachments);
bot.api.sendMediaGroup(chat_id, mediaGroup, {});
//bot.api.call('sendMediaGroup', { chat_id, mediaGroup });
}
});
Π ΡΠ½ΠΎΠ²Π° ΠΏΡΠΈΠ²Π΅Ρ. ΠΡΡΠ°ΡΡΡ Π² ΠΊΠ°ΡΠ΅ΡΡΠ²Π΅ storage ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ Redis. ΠΠΈΡΡ ΡΠ²ΠΎΠΉ ΠΊΠ»Π°ΡΡ ΠΈΠΌΠΏΠ»Π΅ΠΌΠ΅Π½ΡΠΈΡΡΡΡΠΈΠΉ ΠΌΠ΅ΡΠΎΠ΄Ρ SessionStorage ΠΈ Π½Π°ΡΡΠΊΠ°ΡΡΡ Π½Π° Π½Π΅ΠΊΠΎΡΠΎΡΡΠ΅ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ Ρ ΡΠΈΠΏΠ°ΠΌΠΈ ΠΈ ΠΎΡΠ»ΠΈΡΠΈΠ΅ ΠΎΡ ΡΠΎΠ³ΠΎ, ΡΡΠΎ Π½Π° Π³ΠΈΡΡ Π°Π±Π΅.
Π ΠΈΡΡ
ΠΎΠ΄Π½ΠΎΠΌ ΠΊΠΎΠ΄Π΅ Π½Π° Π³ΠΈΡΡ
Π°Π±Π΅, ΠΈΠ½ΡΠ΅ΡΡΠ΅ΠΉΡ ΠΈΠΌΠ΅Π΅Ρ ΠΏΡΠ°Π²ΠΈΠ»ΡΠ½ΡΡ ΡΠΈΠΏΠΈΠ·Π°ΡΠΈΡ (ΡΠ°ΠΊ Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ, get ΠΌΠ΅ΡΠΎΠ΄ Π²ΠΎΠ·Π²ΡΠ°ΡΠ°Π΅Ρ any ΠΈΠ»ΠΈ undefined).
ΠΠΎ Π² Π°ΠΊΡΡΠ°Π»ΡΠ½ΠΎΠΉ Π²Π΅ΡΡΠΈΠΈ ΡΠΈΠΏΠΈΠ·Π°ΡΠΈΡ ΠΎΡΠ΅Π½Ρ ΡΡΡΠ°Π½Π½Π°Ρ. ΠΠ½ ΠΎΠΆΠΈΠ΄Π°Π΅Ρ ΠΎΠ±ΡΠ΅ΠΊΡ (ΠΏΡΠΎΡΡΠΎ ΠΎΠ±ΡΠ΅ΠΊΡ) ΠΈΠ»ΠΈ Π½ΠΈΡΠ΅Π³ΠΎ.
Π ΠΈΠ·-Π·Π° ΡΡΠΎΠ³ΠΎ ΠΏΡΠΈΡ
ΠΎΠ΄ΠΈΡΡΡ Π΄Π΅Π»Π°ΡΡ Π²ΠΎΡ ΡΠ°ΠΊΠΈΠ΅ ΠΊΠΎΡΡΡΠ»ΠΈ =)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.