@aracna/telegram-bot 2.0.9 → 2.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/apis/telegram-api.d.ts +1 -1
  2. package/apis/telegram-api.js +1 -64
  3. package/apis/telegram-file-api.d.ts +1 -1
  4. package/apis/telegram-file-api.js +1 -24
  5. package/classes/client.d.ts +2 -2
  6. package/classes/client.js +1 -420
  7. package/definitions/constants.d.ts +1 -1
  8. package/definitions/constants.js +1 -57
  9. package/definitions/enums.js +1 -7
  10. package/definitions/interfaces.d.ts +1 -1
  11. package/definitions/interfaces.js +0 -2
  12. package/definitions/types.d.ts +1 -1
  13. package/definitions/types.js +0 -2
  14. package/index.cjs +1 -1
  15. package/index.js +1 -273
  16. package/loggers/class-logger.js +1 -6
  17. package/package.json +1 -1
  18. package/requests/add-requests.d.ts +1 -1
  19. package/requests/add-requests.js +1 -14
  20. package/requests/answer-requests.d.ts +1 -1
  21. package/requests/answer-requests.js +1 -23
  22. package/requests/approve-requests.d.ts +1 -1
  23. package/requests/approve-requests.js +1 -7
  24. package/requests/ban-requests.d.ts +1 -1
  25. package/requests/ban-requests.js +1 -11
  26. package/requests/business-requests.d.ts +1 -1
  27. package/requests/business-requests.js +1 -63
  28. package/requests/close-requests.d.ts +1 -1
  29. package/requests/close-requests.js +1 -11
  30. package/requests/copy-requests.d.ts +1 -1
  31. package/requests/copy-requests.js +1 -11
  32. package/requests/create-requests.d.ts +1 -1
  33. package/requests/create-requests.js +1 -30
  34. package/requests/decline-requests.d.ts +1 -1
  35. package/requests/decline-requests.js +1 -7
  36. package/requests/delete-requests.d.ts +1 -1
  37. package/requests/delete-requests.js +1 -35
  38. package/requests/download-requests.d.ts +1 -1
  39. package/requests/download-requests.js +1 -29
  40. package/requests/edit-requests.d.ts +2 -2
  41. package/requests/edit-requests.js +1 -50
  42. package/requests/export-requests.d.ts +1 -1
  43. package/requests/export-requests.js +1 -7
  44. package/requests/forward-requests.d.ts +1 -1
  45. package/requests/forward-requests.js +1 -11
  46. package/requests/get-requests.d.ts +1 -1
  47. package/requests/get-requests.js +1 -88
  48. package/requests/gift-requests.d.ts +1 -1
  49. package/requests/gift-requests.js +1 -27
  50. package/requests/hide-requests.d.ts +1 -1
  51. package/requests/hide-requests.js +1 -7
  52. package/requests/leave-requests.d.ts +1 -1
  53. package/requests/leave-requests.js +1 -7
  54. package/requests/log-requests.d.ts +1 -1
  55. package/requests/log-requests.js +1 -7
  56. package/requests/pin-requests.d.ts +1 -1
  57. package/requests/pin-requests.js +1 -7
  58. package/requests/promote-requests.d.ts +1 -1
  59. package/requests/promote-requests.js +1 -7
  60. package/requests/refund-requests.d.ts +1 -1
  61. package/requests/refund-requests.js +1 -7
  62. package/requests/reopen-requests.d.ts +1 -1
  63. package/requests/reopen-requests.js +1 -11
  64. package/requests/replace-requests.d.ts +1 -1
  65. package/requests/replace-requests.js +1 -14
  66. package/requests/restrict-requests.d.ts +1 -1
  67. package/requests/restrict-requests.js +1 -7
  68. package/requests/revoke-requests.d.ts +1 -1
  69. package/requests/revoke-requests.js +1 -7
  70. package/requests/save-requests.d.ts +1 -1
  71. package/requests/save-requests.js +1 -7
  72. package/requests/send-requests.d.ts +1 -1
  73. package/requests/send-requests.js +1 -106
  74. package/requests/set-requests.d.ts +1 -1
  75. package/requests/set-requests.js +1 -99
  76. package/requests/stop-requests.d.ts +1 -1
  77. package/requests/stop-requests.js +1 -11
  78. package/requests/story-requests.d.ts +1 -1
  79. package/requests/story-requests.js +1 -15
  80. package/requests/unban-requests.d.ts +1 -1
  81. package/requests/unban-requests.js +1 -11
  82. package/requests/unhide-requests.d.ts +1 -1
  83. package/requests/unhide-requests.js +1 -7
  84. package/requests/unpin-requests.d.ts +1 -1
  85. package/requests/unpin-requests.js +1 -19
  86. package/requests/upload-requests.d.ts +1 -1
  87. package/requests/upload-requests.js +1 -7
  88. package/requests/verification-requests.d.ts +1 -1
  89. package/requests/verification-requests.js +1 -19
  90. package/requests/webhook-requests.d.ts +1 -1
  91. package/requests/webhook-requests.js +1 -20
  92. package/utils/callback-query-utils.d.ts +1 -1
  93. package/utils/callback-query-utils.js +1 -25
  94. package/utils/command-utils.d.ts +1 -1
  95. package/utils/command-utils.js +1 -28
  96. package/utils/context-utils.d.ts +2 -2
  97. package/utils/context-utils.js +1 -42
  98. package/utils/html-utils.js +1 -18
  99. package/utils/inline-keyboard-utils.d.ts +1 -1
  100. package/utils/inline-keyboard-utils.js +1 -43
  101. package/utils/reply-to-message-utils.d.ts +1 -1
  102. package/utils/reply-to-message-utils.js +1 -36
  103. package/utils/start-message-utils.d.ts +1 -1
  104. package/utils/start-message-utils.js +1 -40
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pinChatMessage = pinChatMessage;
4
- const telegram_api_1 = require("../apis/telegram-api");
5
- async function pinChatMessage(body, config) {
6
- return telegram_api_1.TelegramAPI.post('pinChatMessage', body, config);
7
- }
1
+ import{TelegramAPI as a}from"../apis/telegram-api.js";async function t(e,r){return a.post("pinChatMessage",e,r)}export{t as pinChatMessage};
@@ -1,4 +1,4 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { PromoteChatMember } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function promoteChatMember(body: PromoteChatMember, config?: TelegramApiConfig): Promise<boolean | FetchError>;
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promoteChatMember = promoteChatMember;
4
- const telegram_api_1 = require("../apis/telegram-api");
5
- async function promoteChatMember(body, config) {
6
- return telegram_api_1.TelegramAPI.post('promoteChatMember', body, config);
7
- }
1
+ import{TelegramAPI as o}from"../apis/telegram-api.js";async function m(e,r){return o.post("promoteChatMember",e,r)}export{m as promoteChatMember};
@@ -1,4 +1,4 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { RefundStarPayment } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function refundStarPayment(body: RefundStarPayment, config?: TelegramApiConfig): Promise<boolean | FetchError>;
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.refundStarPayment = refundStarPayment;
4
- const telegram_api_1 = require("../apis/telegram-api");
5
- async function refundStarPayment(body, config) {
6
- return telegram_api_1.TelegramAPI.post('refundStarPayment', body, config);
7
- }
1
+ import{TelegramAPI as t}from"../apis/telegram-api.js";async function n(e,r){return t.post("refundStarPayment",e,r)}export{n as refundStarPayment};
@@ -1,5 +1,5 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { ReopenForumTopic, ReopenGeneralForumTopic } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function reopenForumTopic(body: ReopenForumTopic, config?: TelegramApiConfig): Promise<boolean | FetchError>;
5
5
  export declare function reopenGeneralForumTopic(body: ReopenGeneralForumTopic, config?: TelegramApiConfig): Promise<boolean | FetchError>;
@@ -1,11 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reopenForumTopic = reopenForumTopic;
4
- exports.reopenGeneralForumTopic = reopenGeneralForumTopic;
5
- const telegram_api_1 = require("../apis/telegram-api");
6
- async function reopenForumTopic(body, config) {
7
- return telegram_api_1.TelegramAPI.post('reopenForumTopic', body, config);
8
- }
9
- async function reopenGeneralForumTopic(body, config) {
10
- return telegram_api_1.TelegramAPI.post('reopenGeneralForumTopic', body, config);
11
- }
1
+ import{TelegramAPI as r}from"../apis/telegram-api.js";async function p(o,e){return r.post("reopenForumTopic",o,e)}async function i(o,e){return r.post("reopenGeneralForumTopic",o,e)}export{p as reopenForumTopic,i as reopenGeneralForumTopic};
@@ -1,4 +1,4 @@
1
1
  import { type FetchError } from '@aracna/core';
2
2
  import type { ReplaceStickerInSet } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function replaceStickerInSet(body: ReplaceStickerInSet, config?: TelegramApiConfig): Promise<boolean | FetchError>;
@@ -1,14 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.replaceStickerInSet = replaceStickerInSet;
4
- const telegram_api_1 = require("../apis/telegram-api");
5
- async function replaceStickerInSet(body, config) {
6
- return telegram_api_1.TelegramAPI.post('replaceStickerInSet', {
7
- ...body,
8
- sticker: {
9
- ...body.sticker,
10
- sticker: body.sticker.sticker instanceof Blob ? `attach://sticker_blob` : body.sticker.sticker
11
- },
12
- ...(body.sticker.sticker instanceof Blob && { sticker_blob: body.sticker.sticker })
13
- }, config);
14
- }
1
+ import{TelegramAPI as r}from"../apis/telegram-api.js";async function o(e,t){return r.post("replaceStickerInSet",{...e,sticker:{...e.sticker,sticker:e.sticker.sticker instanceof Blob?"attach://sticker_blob":e.sticker.sticker},...e.sticker.sticker instanceof Blob&&{sticker_blob:e.sticker.sticker}},t)}export{o as replaceStickerInSet};
@@ -1,4 +1,4 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { RestrictChatMember } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function restrictChatMember(body: RestrictChatMember, config?: TelegramApiConfig): Promise<boolean | FetchError>;
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.restrictChatMember = restrictChatMember;
4
- const telegram_api_1 = require("../apis/telegram-api");
5
- async function restrictChatMember(body, config) {
6
- return telegram_api_1.TelegramAPI.post('restrictChatMember', body, config);
7
- }
1
+ import{TelegramAPI as t}from"../apis/telegram-api.js";async function a(e,r){return t.post("restrictChatMember",e,r)}export{a as restrictChatMember};
@@ -1,4 +1,4 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { ChatInviteLink, RevokeChatInviteLink } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function revokeChatInviteLink(body: RevokeChatInviteLink, config?: TelegramApiConfig): Promise<ChatInviteLink | FetchError>;
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.revokeChatInviteLink = revokeChatInviteLink;
4
- const telegram_api_1 = require("../apis/telegram-api");
5
- async function revokeChatInviteLink(body, config) {
6
- return telegram_api_1.TelegramAPI.post('revokeChatInviteLink', body, config);
7
- }
1
+ import{TelegramAPI as i}from"../apis/telegram-api.js";async function n(e,t){return i.post("revokeChatInviteLink",e,t)}export{n as revokeChatInviteLink};
@@ -1,4 +1,4 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { SavePreparedInlineMessage } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function savePreparedInlineMessage(body: SavePreparedInlineMessage, config?: TelegramApiConfig): Promise<boolean | FetchError>;
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.savePreparedInlineMessage = savePreparedInlineMessage;
4
- const telegram_api_1 = require("../apis/telegram-api");
5
- async function savePreparedInlineMessage(body, config) {
6
- return telegram_api_1.TelegramAPI.post('savePreparedInlineMessage', body, config);
7
- }
1
+ import{TelegramAPI as a}from"../apis/telegram-api.js";async function o(e,r){return a.post("savePreparedInlineMessage",e,r)}export{o as savePreparedInlineMessage};
@@ -1,6 +1,6 @@
1
1
  import { type FetchError } from '@aracna/core';
2
2
  import type { Message, SendAnimation, SendAudio, SendChatAction, SendContact, SendDice, SendDocument, SendGame, SendInvoice, SendLocation, SendMessage, SendPhoto, SendPoll, SendSticker, SendVenue, SendVideo, SendVideoNote, SendVoice } from '@aracna/telegram-bot-types';
3
- import type { SendMediaGroupAlternative, SendPaidMediaAlternative, SendRepliableMessage, TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { SendMediaGroupAlternative, SendPaidMediaAlternative, SendRepliableMessage, TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function sendAnimation(body: SendAnimation, config?: TelegramApiConfig): Promise<Message | FetchError>;
5
5
  export declare function sendAudio(body: SendAudio, config?: TelegramApiConfig): Promise<Message | FetchError>;
6
6
  export declare function sendDocument(body: SendDocument, config?: TelegramApiConfig): Promise<Message | FetchError>;
@@ -1,106 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sendAnimation = sendAnimation;
4
- exports.sendAudio = sendAudio;
5
- exports.sendDocument = sendDocument;
6
- exports.sendChatAction = sendChatAction;
7
- exports.sendContact = sendContact;
8
- exports.sendDice = sendDice;
9
- exports.sendGame = sendGame;
10
- exports.sendInvoice = sendInvoice;
11
- exports.sendLocation = sendLocation;
12
- exports.sendMediaGroup = sendMediaGroup;
13
- exports.sendMessage = sendMessage;
14
- exports.sendMessageHTML = sendMessageHTML;
15
- exports.sendPaidMedia = sendPaidMedia;
16
- exports.sendPhoto = sendPhoto;
17
- exports.sendPoll = sendPoll;
18
- exports.sendRepliableMessage = sendRepliableMessage;
19
- exports.sendSticker = sendSticker;
20
- exports.sendVenue = sendVenue;
21
- exports.sendVideo = sendVideo;
22
- exports.sendVideoNote = sendVideoNote;
23
- exports.sendVoice = sendVoice;
24
- const telegram_api_1 = require("../apis/telegram-api");
25
- const html_utils_1 = require("../utils/html-utils");
26
- const reply_to_message_utils_1 = require("../utils/reply-to-message-utils");
27
- async function sendAnimation(body, config) {
28
- return telegram_api_1.TelegramAPI.post('sendAnimation', body, config);
29
- }
30
- async function sendAudio(body, config) {
31
- return telegram_api_1.TelegramAPI.post('sendAudio', body, config);
32
- }
33
- async function sendDocument(body, config) {
34
- return telegram_api_1.TelegramAPI.post('sendDocument', body, config);
35
- }
36
- async function sendChatAction(body, config) {
37
- return telegram_api_1.TelegramAPI.post('sendChatAction', body, config);
38
- }
39
- async function sendContact(body, config) {
40
- return telegram_api_1.TelegramAPI.post('sendContact', body, config);
41
- }
42
- async function sendDice(body, config) {
43
- return telegram_api_1.TelegramAPI.post('sendDice', body, config);
44
- }
45
- async function sendGame(body, config) {
46
- return telegram_api_1.TelegramAPI.post('sendGame', body, config);
47
- }
48
- async function sendInvoice(body, config) {
49
- return telegram_api_1.TelegramAPI.post('sendInvoice', body, config);
50
- }
51
- async function sendLocation(body, config) {
52
- return telegram_api_1.TelegramAPI.post('sendLocation', body, config);
53
- }
54
- async function sendMediaGroup(body, config) {
55
- return telegram_api_1.TelegramAPI.post('sendMediaGroup', {
56
- ...body,
57
- media: body.media.map((media, index) => ({ ...media, media: `attach://media_${index}` })),
58
- ...body.media.reduce((result, media, index) => ({ ...result, [`media_${index}`]: media.media }), {})
59
- }, config);
60
- }
61
- async function sendMessage(body, config) {
62
- return telegram_api_1.TelegramAPI.post('sendMessage', body, config);
63
- }
64
- async function sendMessageHTML(body, config) {
65
- return sendMessage({ parse_mode: 'HTML', ...body, text: (0, html_utils_1.sanitizeHTML)(body.text) }, config);
66
- }
67
- async function sendPaidMedia(body, config) {
68
- return telegram_api_1.TelegramAPI.post('sendPaidMedia', {
69
- ...body,
70
- media: body.media.map((v, k) => ({ ...v, media: `attach://media_${k}` })),
71
- ...body.media.reduce((r, v, k) => ({ ...r, [`media_${k}`]: v.media }), {})
72
- }, config);
73
- }
74
- async function sendPhoto(body, config) {
75
- return telegram_api_1.TelegramAPI.post('sendPhoto', body, config);
76
- }
77
- async function sendPoll(body, config) {
78
- return telegram_api_1.TelegramAPI.post('sendPoll', body, config);
79
- }
80
- async function sendRepliableMessage(body, config) {
81
- return sendMessage({
82
- parse_mode: 'HTML',
83
- reply_markup: { force_reply: true, selective: true },
84
- ...body,
85
- text: body.text + (0, reply_to_message_utils_1.encodeReplyToMessageBodyToAnchorTag)({ chatID: body.from_chat_id, command: body.command, data: body.data })
86
- }, config);
87
- }
88
- async function sendSticker(body, config) {
89
- return telegram_api_1.TelegramAPI.post('sendSticker', body, config);
90
- }
91
- async function sendVenue(body, config) {
92
- return telegram_api_1.TelegramAPI.post('sendVenue', body, config);
93
- }
94
- async function sendVideo(body, config) {
95
- return telegram_api_1.TelegramAPI.post('sendVideo', {
96
- ...body,
97
- cover: body.cover instanceof Blob ? `attach://cover_blob` : body.cover,
98
- ...(body.cover instanceof Blob ? { cover_blob: body.cover } : {})
99
- }, config);
100
- }
101
- async function sendVideoNote(body, config) {
102
- return telegram_api_1.TelegramAPI.post('sendVideoNote', body, config);
103
- }
104
- async function sendVoice(body, config) {
105
- return telegram_api_1.TelegramAPI.post('sendVoice', body, config);
106
- }
1
+ import{TelegramAPI as o}from"../apis/telegram-api.js";import{sanitizeHTML as a}from"../utils/html-utils.js";import{encodeReplyToMessageBodyToAnchorTag as d}from"../utils/reply-to-message-utils.js";async function u(e,n){return o.post("sendAnimation",e,n)}async function M(e,n){return o.post("sendAudio",e,n)}async function S(e,n){return o.post("sendDocument",e,n)}async function l(e,n){return o.post("sendChatAction",e,n)}async function f(e,n){return o.post("sendContact",e,n)}async function A(e,n){return o.post("sendDice",e,n)}async function P(e,n){return o.post("sendGame",e,n)}async function h(e,n){return o.post("sendInvoice",e,n)}async function C(e,n){return o.post("sendLocation",e,n)}async function T(e,n){return o.post("sendMediaGroup",{...e,media:e.media.map((r,t)=>({...r,media:`attach://media_${t}`})),...e.media.reduce((r,t,i)=>({...r,[`media_${i}`]:t.media}),{})},n)}async function s(e,n){return o.post("sendMessage",e,n)}async function x(e,n){return s({parse_mode:"HTML",...e,text:a(e.text)},n)}async function v(e,n){return o.post("sendPaidMedia",{...e,media:e.media.map((r,t)=>({...r,media:`attach://media_${t}`})),...e.media.reduce((r,t,i)=>({...r,[`media_${i}`]:t.media}),{})},n)}async function E(e,n){return o.post("sendPhoto",e,n)}async function F(e,n){return o.post("sendPoll",e,n)}async function V(e,n){return s({parse_mode:"HTML",reply_markup:{force_reply:!0,selective:!0},...e,text:e.text+d({chatID:e.from_chat_id,command:e.command,data:e.data})},n)}async function y(e,n){return o.post("sendSticker",e,n)}async function I(e,n){return o.post("sendVenue",e,n)}async function _(e,n){return o.post("sendVideo",{...e,cover:e.cover instanceof Blob?"attach://cover_blob":e.cover,...e.cover instanceof Blob?{cover_blob:e.cover}:{}},n)}async function D(e,n){return o.post("sendVideoNote",e,n)}async function G(e,n){return o.post("sendVoice",e,n)}export{u as sendAnimation,M as sendAudio,l as sendChatAction,f as sendContact,A as sendDice,S as sendDocument,P as sendGame,h as sendInvoice,C as sendLocation,T as sendMediaGroup,s as sendMessage,x as sendMessageHTML,v as sendPaidMedia,E as sendPhoto,F as sendPoll,V as sendRepliableMessage,y as sendSticker,I as sendVenue,_ as sendVideo,D as sendVideoNote,G as sendVoice};
@@ -1,6 +1,6 @@
1
1
  import { type FetchError } from '@aracna/core';
2
2
  import type { SetChatAdministratorCustomTitle, SetChatDescription, SetChatMenuButton, SetChatPermissions, SetChatPhoto, SetChatStickerSet, SetChatTitle, SetCustomEmojiStickerSetThumbnail, SetGameScore, SetMessageReaction, SetMyCommands, SetMyDefaultAdministratorRights, SetMyDescription, SetMyName, SetMyShortDescription, SetPassportDataErrors, SetStickerEmojiList, SetStickerKeywords, SetStickerMaskPosition, SetStickerPositionInSet, SetStickerSetThumbnail, SetStickerSetTitle, SetUserEmojiStatus } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function setChatAdministratorCustomTitle(body: SetChatAdministratorCustomTitle, config?: TelegramApiConfig): Promise<boolean | FetchError>;
5
5
  export declare function setChatDescription(body: SetChatDescription, config?: TelegramApiConfig): Promise<boolean | FetchError>;
6
6
  export declare function setChatMenuButton(body: SetChatMenuButton, config?: TelegramApiConfig): Promise<boolean | FetchError>;
@@ -1,99 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setChatAdministratorCustomTitle = setChatAdministratorCustomTitle;
4
- exports.setChatDescription = setChatDescription;
5
- exports.setChatMenuButton = setChatMenuButton;
6
- exports.setChatPermissions = setChatPermissions;
7
- exports.setChatPhoto = setChatPhoto;
8
- exports.setChatStickerSet = setChatStickerSet;
9
- exports.setChatTitle = setChatTitle;
10
- exports.setCustomEmojiStickerSetThumbnail = setCustomEmojiStickerSetThumbnail;
11
- exports.setGameScore = setGameScore;
12
- exports.setMessageReaction = setMessageReaction;
13
- exports.setMyCommands = setMyCommands;
14
- exports.setMyDefaultAdministratorRights = setMyDefaultAdministratorRights;
15
- exports.setMyDescription = setMyDescription;
16
- exports.setMyName = setMyName;
17
- exports.setMyShortDescription = setMyShortDescription;
18
- exports.setPassportDataErrors = setPassportDataErrors;
19
- exports.setStickerEmojiList = setStickerEmojiList;
20
- exports.setStickerKeywords = setStickerKeywords;
21
- exports.setStickerMaskPosition = setStickerMaskPosition;
22
- exports.setStickerPositionInSet = setStickerPositionInSet;
23
- exports.setStickerSetThumbnail = setStickerSetThumbnail;
24
- exports.setStickerSetTitle = setStickerSetTitle;
25
- exports.setUserEmojiStatus = setUserEmojiStatus;
26
- const telegram_api_1 = require("../apis/telegram-api");
27
- async function setChatAdministratorCustomTitle(body, config) {
28
- return telegram_api_1.TelegramAPI.post('setChatAdministratorCustomTitle', body, config);
29
- }
30
- async function setChatDescription(body, config) {
31
- return telegram_api_1.TelegramAPI.post('setChatDescription', body, config);
32
- }
33
- async function setChatMenuButton(body, config) {
34
- return telegram_api_1.TelegramAPI.post('setChatMenuButton', body, config);
35
- }
36
- async function setChatPermissions(body, config) {
37
- return telegram_api_1.TelegramAPI.post('setChatPermissions', body, config);
38
- }
39
- async function setChatPhoto(body, config) {
40
- return telegram_api_1.TelegramAPI.post('setChatPhoto', {
41
- ...body,
42
- photo: body.photo instanceof Blob ? `attach://photo_blob` : body.photo,
43
- ...(body.photo instanceof Blob ? { photo_blob: body.photo } : {})
44
- }, config);
45
- }
46
- async function setChatStickerSet(body, config) {
47
- return telegram_api_1.TelegramAPI.post('setChatStickerSet', body, config);
48
- }
49
- async function setChatTitle(body, config) {
50
- return telegram_api_1.TelegramAPI.post('setChatTitle', body, config);
51
- }
52
- async function setCustomEmojiStickerSetThumbnail(body, config) {
53
- return telegram_api_1.TelegramAPI.post('setCustomEmojiStickerSetThumbnail', body, config);
54
- }
55
- async function setGameScore(body, config) {
56
- return telegram_api_1.TelegramAPI.post('setGameScore', body, config);
57
- }
58
- async function setMessageReaction(body, config) {
59
- return telegram_api_1.TelegramAPI.post('setMessageReaction', body, config);
60
- }
61
- async function setMyCommands(body, config) {
62
- return telegram_api_1.TelegramAPI.post('setMyCommands', body, config);
63
- }
64
- async function setMyDefaultAdministratorRights(body, config) {
65
- return telegram_api_1.TelegramAPI.post('setMyDefaultAdministratorRights', body, config);
66
- }
67
- async function setMyDescription(body, config) {
68
- return telegram_api_1.TelegramAPI.post('setMyDescription', body, config);
69
- }
70
- async function setMyName(body, config) {
71
- return telegram_api_1.TelegramAPI.post('setMyName', body, config);
72
- }
73
- async function setMyShortDescription(body, config) {
74
- return telegram_api_1.TelegramAPI.post('setMyShortDescription', body, config);
75
- }
76
- async function setPassportDataErrors(body, config) {
77
- return telegram_api_1.TelegramAPI.post('setPassportDataErrors', body, config);
78
- }
79
- async function setStickerEmojiList(body, config) {
80
- return telegram_api_1.TelegramAPI.post('setStickerEmojiList', body, config);
81
- }
82
- async function setStickerKeywords(body, config) {
83
- return telegram_api_1.TelegramAPI.post('setStickerKeywords', body, config);
84
- }
85
- async function setStickerMaskPosition(body, config) {
86
- return telegram_api_1.TelegramAPI.post('setStickerMaskPosition', body, config);
87
- }
88
- async function setStickerPositionInSet(body, config) {
89
- return telegram_api_1.TelegramAPI.post('setStickerPositionInSet', body, config);
90
- }
91
- async function setStickerSetThumbnail(body, config) {
92
- return telegram_api_1.TelegramAPI.post('setStickerSetThumbnail', body, config);
93
- }
94
- async function setStickerSetTitle(body, config) {
95
- return telegram_api_1.TelegramAPI.post('setStickerSetTitle', body, config);
96
- }
97
- async function setUserEmojiStatus(body, config) {
98
- return telegram_api_1.TelegramAPI.post('setUserEmojiStatus', body, config);
99
- }
1
+ import{TelegramAPI as o}from"../apis/telegram-api.js";async function n(t,e){return o.post("setChatAdministratorCustomTitle",t,e)}async function s(t,e){return o.post("setChatDescription",t,e)}async function a(t,e){return o.post("setChatMenuButton",t,e)}async function S(t,e){return o.post("setChatPermissions",t,e)}async function c(t,e){return o.post("setChatPhoto",{...t,photo:t.photo instanceof Blob?"attach://photo_blob":t.photo,...t.photo instanceof Blob?{photo_blob:t.photo}:{}},e)}async function m(t,e){return o.post("setChatStickerSet",t,e)}async function l(t,e){return o.post("setChatTitle",t,e)}async function p(t,e){return o.post("setCustomEmojiStickerSetThumbnail",t,e)}async function h(t,e){return o.post("setGameScore",t,e)}async function u(t,e){return o.post("setMessageReaction",t,e)}async function C(t,e){return o.post("setMyCommands",t,e)}async function f(t,e){return o.post("setMyDefaultAdministratorRights",t,e)}async function g(t,e){return o.post("setMyDescription",t,e)}async function b(t,e){return o.post("setMyName",t,e)}async function y(t,e){return o.post("setMyShortDescription",t,e)}async function T(t,e){return o.post("setPassportDataErrors",t,e)}async function P(t,e){return o.post("setStickerEmojiList",t,e)}async function k(t,e){return o.post("setStickerKeywords",t,e)}async function E(t,e){return o.post("setStickerMaskPosition",t,e)}async function M(t,e){return o.post("setStickerPositionInSet",t,e)}async function A(t,e){return o.post("setStickerSetThumbnail",t,e)}async function D(t,e){return o.post("setStickerSetTitle",t,e)}async function F(t,e){return o.post("setUserEmojiStatus",t,e)}export{n as setChatAdministratorCustomTitle,s as setChatDescription,a as setChatMenuButton,S as setChatPermissions,c as setChatPhoto,m as setChatStickerSet,l as setChatTitle,p as setCustomEmojiStickerSetThumbnail,h as setGameScore,u as setMessageReaction,C as setMyCommands,f as setMyDefaultAdministratorRights,g as setMyDescription,b as setMyName,y as setMyShortDescription,T as setPassportDataErrors,P as setStickerEmojiList,k as setStickerKeywords,E as setStickerMaskPosition,M as setStickerPositionInSet,A as setStickerSetThumbnail,D as setStickerSetTitle,F as setUserEmojiStatus};
@@ -1,5 +1,5 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { Message, Poll, StopMessageLiveLocation, StopPoll } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function stopMessageLiveLocation(body: StopMessageLiveLocation, config?: TelegramApiConfig): Promise<Message | boolean | FetchError>;
5
5
  export declare function stopPoll(body: StopPoll, config?: TelegramApiConfig): Promise<Poll | FetchError>;
@@ -1,11 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stopMessageLiveLocation = stopMessageLiveLocation;
4
- exports.stopPoll = stopPoll;
5
- const telegram_api_1 = require("../apis/telegram-api");
6
- async function stopMessageLiveLocation(body, config) {
7
- return telegram_api_1.TelegramAPI.post('stopMessageLiveLocation', body, config);
8
- }
9
- async function stopPoll(body, config) {
10
- return telegram_api_1.TelegramAPI.post('stopPoll', body, config);
11
- }
1
+ import{TelegramAPI as t}from"../apis/telegram-api.js";async function s(o,e){return t.post("stopMessageLiveLocation",o,e)}async function a(o,e){return t.post("stopPoll",o,e)}export{s as stopMessageLiveLocation,a as stopPoll};
@@ -1,6 +1,6 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { DeleteStory, EditStory, PostStory, Story } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function deleteStory(body: DeleteStory, config?: TelegramApiConfig): Promise<boolean | FetchError>;
5
5
  export declare function editStory(body: EditStory, config?: TelegramApiConfig): Promise<Story | FetchError>;
6
6
  export declare function postStory(body: PostStory, config?: TelegramApiConfig): Promise<Story | FetchError>;
@@ -1,15 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteStory = deleteStory;
4
- exports.editStory = editStory;
5
- exports.postStory = postStory;
6
- const telegram_api_1 = require("../apis/telegram-api");
7
- async function deleteStory(body, config) {
8
- return telegram_api_1.TelegramAPI.post('deleteStory', body, config);
9
- }
10
- async function editStory(body, config) {
11
- return telegram_api_1.TelegramAPI.post('editStory', body, config);
12
- }
13
- async function postStory(body, config) {
14
- return telegram_api_1.TelegramAPI.post('postStory', body, config);
15
- }
1
+ import{TelegramAPI as o}from"../apis/telegram-api.js";async function i(t,r){return o.post("deleteStory",t,r)}async function y(t,r){return o.post("editStory",t,r)}async function n(t,r){return o.post("postStory",t,r)}export{i as deleteStory,y as editStory,n as postStory};
@@ -1,5 +1,5 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { UnbanChatMember, UnbanChatSenderChat } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function unbanChatMember(body: UnbanChatMember, config?: TelegramApiConfig): Promise<boolean | FetchError>;
5
5
  export declare function unbanChatSenderChat(body: UnbanChatSenderChat, config?: TelegramApiConfig): Promise<boolean | FetchError>;
@@ -1,11 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unbanChatMember = unbanChatMember;
4
- exports.unbanChatSenderChat = unbanChatSenderChat;
5
- const telegram_api_1 = require("../apis/telegram-api");
6
- async function unbanChatMember(body, config) {
7
- return telegram_api_1.TelegramAPI.post('unbanChatMember', body, config);
8
- }
9
- async function unbanChatSenderChat(body, config) {
10
- return telegram_api_1.TelegramAPI.post('unbanChatSenderChat', body, config);
11
- }
1
+ import{TelegramAPI as r}from"../apis/telegram-api.js";async function t(e,n){return r.post("unbanChatMember",e,n)}async function o(e,n){return r.post("unbanChatSenderChat",e,n)}export{t as unbanChatMember,o as unbanChatSenderChat};
@@ -1,4 +1,4 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { HideGeneralForumTopic } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function unhideGeneralForumTopic(body: HideGeneralForumTopic, config?: TelegramApiConfig): Promise<boolean | FetchError>;
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unhideGeneralForumTopic = unhideGeneralForumTopic;
4
- const telegram_api_1 = require("../apis/telegram-api");
5
- async function unhideGeneralForumTopic(body, config) {
6
- return telegram_api_1.TelegramAPI.post('unhideGeneralForumTopic', body, config);
7
- }
1
+ import{TelegramAPI as o}from"../apis/telegram-api.js";async function n(e,r){return o.post("unhideGeneralForumTopic",e,r)}export{n as unhideGeneralForumTopic};
@@ -1,6 +1,6 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { UnpinAllChatMessages, UnpinAllForumTopicMessages, UnpinAllGeneralForumTopicMessages, UnpinChatMessage } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function unpinAllChatMessages(body: UnpinAllChatMessages, config?: TelegramApiConfig): Promise<boolean | FetchError>;
5
5
  export declare function unpinAllForumTopicMessages(body: UnpinAllForumTopicMessages, config?: TelegramApiConfig): Promise<boolean | FetchError>;
6
6
  export declare function unpinAllGeneralForumTopicMessages(body: UnpinAllGeneralForumTopicMessages, config?: TelegramApiConfig): Promise<boolean | FetchError>;
@@ -1,19 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unpinAllChatMessages = unpinAllChatMessages;
4
- exports.unpinAllForumTopicMessages = unpinAllForumTopicMessages;
5
- exports.unpinAllGeneralForumTopicMessages = unpinAllGeneralForumTopicMessages;
6
- exports.unpinChatMessage = unpinChatMessage;
7
- const telegram_api_1 = require("../apis/telegram-api");
8
- async function unpinAllChatMessages(body, config) {
9
- return telegram_api_1.TelegramAPI.post('unpinAllChatMessages', body, config);
10
- }
11
- async function unpinAllForumTopicMessages(body, config) {
12
- return telegram_api_1.TelegramAPI.post('unpinAllForumTopicMessages', body, config);
13
- }
14
- async function unpinAllGeneralForumTopicMessages(body, config) {
15
- return telegram_api_1.TelegramAPI.post('unpinAllGeneralForumTopicMessages', body, config);
16
- }
17
- async function unpinChatMessage(body, config) {
18
- return telegram_api_1.TelegramAPI.post('unpinChatMessage', body, config);
19
- }
1
+ import{TelegramAPI as o}from"../apis/telegram-api.js";async function r(e,n){return o.post("unpinAllChatMessages",e,n)}async function a(e,n){return o.post("unpinAllForumTopicMessages",e,n)}async function i(e,n){return o.post("unpinAllGeneralForumTopicMessages",e,n)}async function p(e,n){return o.post("unpinChatMessage",e,n)}export{r as unpinAllChatMessages,a as unpinAllForumTopicMessages,i as unpinAllGeneralForumTopicMessages,p as unpinChatMessage};
@@ -1,4 +1,4 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { File, UploadStickerFile } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function uploadStickerFile(body: UploadStickerFile, config?: TelegramApiConfig): Promise<File | FetchError>;
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uploadStickerFile = uploadStickerFile;
4
- const telegram_api_1 = require("../apis/telegram-api");
5
- async function uploadStickerFile(body, config) {
6
- return telegram_api_1.TelegramAPI.post('uploadStickerFile', body, config);
7
- }
1
+ import{TelegramAPI as i}from"../apis/telegram-api.js";async function t(e,r){return i.post("uploadStickerFile",e,r)}export{t as uploadStickerFile};
@@ -1,6 +1,6 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { RemoveChatVerification, RemoveUserVerification, VerifyChat, VerifyUser } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function removeChatVerification(body: RemoveChatVerification, config?: TelegramApiConfig): Promise<boolean | FetchError>;
5
5
  export declare function removeUserVerification(body: RemoveUserVerification, config?: TelegramApiConfig): Promise<boolean | FetchError>;
6
6
  export declare function verifyChat(body: VerifyChat, config?: TelegramApiConfig): Promise<boolean | FetchError>;
@@ -1,19 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeChatVerification = removeChatVerification;
4
- exports.removeUserVerification = removeUserVerification;
5
- exports.verifyChat = verifyChat;
6
- exports.verifyUser = verifyUser;
7
- const telegram_api_1 = require("../apis/telegram-api");
8
- async function removeChatVerification(body, config) {
9
- return telegram_api_1.TelegramAPI.post('removeChatVerification', body, config);
10
- }
11
- async function removeUserVerification(body, config) {
12
- return telegram_api_1.TelegramAPI.post('removeUserVerification', body, config);
13
- }
14
- async function verifyChat(body, config) {
15
- return telegram_api_1.TelegramAPI.post('verifyChat', body, config);
16
- }
17
- async function verifyUser(body, config) {
18
- return telegram_api_1.TelegramAPI.post('verifyUser', body, config);
19
- }
1
+ import{TelegramAPI as o}from"../apis/telegram-api.js";async function t(e,r){return o.post("removeChatVerification",e,r)}async function a(e,r){return o.post("removeUserVerification",e,r)}async function n(e,r){return o.post("verifyChat",e,r)}async function f(e,r){return o.post("verifyUser",e,r)}export{t as removeChatVerification,a as removeUserVerification,n as verifyChat,f as verifyUser};
@@ -1,6 +1,6 @@
1
1
  import type { FetchError } from '@aracna/core';
2
2
  import type { DeleteWebhook, SetWebhook, WebhookInfo } from '@aracna/telegram-bot-types';
3
- import type { TelegramApiConfig } from '../definitions/interfaces';
3
+ import type { TelegramApiConfig } from '../definitions/interfaces.js';
4
4
  export declare function closeWebhook(config?: TelegramApiConfig): Promise<boolean | FetchError>;
5
5
  export declare function deleteWebhook(body?: DeleteWebhook, config?: TelegramApiConfig): Promise<boolean | FetchError>;
6
6
  export declare function getWebhookInfo(config?: TelegramApiConfig): Promise<WebhookInfo | FetchError>;
@@ -1,20 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.closeWebhook = closeWebhook;
4
- exports.deleteWebhook = deleteWebhook;
5
- exports.getWebhookInfo = getWebhookInfo;
6
- exports.setWebhook = setWebhook;
7
- const telegram_api_1 = require("../apis/telegram-api");
8
- const constants_1 = require("../definitions/constants");
9
- async function closeWebhook(config) {
10
- return telegram_api_1.TelegramAPI.post('close', undefined, config);
11
- }
12
- async function deleteWebhook(body, config) {
13
- return telegram_api_1.TelegramAPI.post('deleteWebhook', body, config);
14
- }
15
- async function getWebhookInfo(config) {
16
- return telegram_api_1.TelegramAPI.post('getWebhookInfo', undefined, config);
17
- }
18
- async function setWebhook(body, config) {
19
- return telegram_api_1.TelegramAPI.post('setWebhook', { allowed_updates: constants_1.DEFAULT_ALLOWED_UPDATES, ...body }, config);
20
- }
1
+ import{TelegramAPI as o}from"../apis/telegram-api.js";import{DEFAULT_ALLOWED_UPDATES as t}from"../definitions/constants.js";async function a(e){return o.post("close",void 0,e)}async function p(e,r){return o.post("deleteWebhook",e,r)}async function f(e){return o.post("getWebhookInfo",void 0,e)}async function m(e,r){return o.post("setWebhook",{allowed_updates:t,...e},r)}export{a as closeWebhook,p as deleteWebhook,f as getWebhookInfo,m as setWebhook};
@@ -1,3 +1,3 @@
1
- import type { CallbackQueryBody, EncodeCallbackQueryBodyOptions } from '../definitions/interfaces';
1
+ import type { CallbackQueryBody, EncodeCallbackQueryBodyOptions } from '../definitions/interfaces.js';
2
2
  export declare function decodeCallbackQueryBody<T>(data?: string): CallbackQueryBody<T>;
3
3
  export declare function encodeCallbackQueryBody<T>(options?: EncodeCallbackQueryBodyOptions<T>): string;
@@ -1,25 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decodeCallbackQueryBody = decodeCallbackQueryBody;
4
- exports.encodeCallbackQueryBody = encodeCallbackQueryBody;
5
- const core_1 = require("@aracna/core");
6
- const constants_1 = require("../definitions/constants");
7
- function decodeCallbackQueryBody(data) {
8
- let body;
9
- if (!data) {
10
- return (0, constants_1.DEFAULT_CALLBACK_QUERY_BODY)();
11
- }
12
- body = (0, core_1.tc)(() => (0, core_1.decodeJSON)((0, core_1.decodeText)((0, core_1.decodeBase64)(data)), (0, constants_1.DEFAULT_DECODE_JSON_OPTIONS)()));
13
- if (body instanceof Error)
14
- return (0, constants_1.DEFAULT_CALLBACK_QUERY_BODY)();
15
- return body;
16
- }
17
- function encodeCallbackQueryBody(options) {
18
- let body;
19
- body = {
20
- c: options?.chatID,
21
- d: options?.data,
22
- m: options?.command
23
- };
24
- return (0, core_1.encodeBase64)((0, core_1.encodeText)((0, core_1.encodeJSON)(body, (0, constants_1.DEFAULT_ENCODE_JSON_OPTIONS)(), '{}')));
25
- }
1
+ import{decodeBase64 as d,decodeJSON as c,decodeText as t,encodeBase64 as a,encodeJSON as n,encodeText as y,tc as l}from"@aracna/core";import{DEFAULT_CALLBACK_QUERY_BODY as r,DEFAULT_DECODE_JSON_OPTIONS as i,DEFAULT_ENCODE_JSON_OPTIONS as u}from"../definitions/constants.js";function B(e){let o;return e?(o=l(()=>c(t(d(e)),i())),o instanceof Error?r():o):r()}function C(e){let o;return o={c:e?.chatID,d:e?.data,m:e?.command},a(y(n(o,u(),"{}")))}export{B as decodeCallbackQueryBody,C as encodeCallbackQueryBody};