@azteam/telegram-api
Advanced tools
Comparing version 1.1.83 to 1.1.85
@@ -80,7 +80,6 @@ "use strict"; | ||
}, { | ||
key: "sendInboxMessage", | ||
key: "sendReplyFileBuffer", | ||
value: function () { | ||
var _sendInboxMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(id, message) { | ||
var _sendReplyFileBuffer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(id, replyID, buffer, name) { | ||
var option, | ||
text, | ||
_args3 = arguments; | ||
@@ -90,13 +89,7 @@ return _regeneratorRuntime().wrap(function _callee3$(_context3) { | ||
case 0: | ||
option = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {}; | ||
text = message; | ||
if (Array.isArray(message)) { | ||
text = message.join('\n'); | ||
} | ||
return _context3.abrupt("return", this.client.post("".concat(this.endpoint, "/sendMessage"), _objectSpread({ | ||
chat_id: id, | ||
text: text, | ||
parse_mode: 'HTML' | ||
option = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : {}; | ||
return _context3.abrupt("return", this.sendFileBuffer(id, buffer, name, _objectSpread({ | ||
reply_to_message_id: replyID | ||
}, option))); | ||
case 4: | ||
case 2: | ||
case "end": | ||
@@ -107,12 +100,13 @@ return _context3.stop(); | ||
})); | ||
function sendInboxMessage(_x5, _x6) { | ||
return _sendInboxMessage.apply(this, arguments); | ||
function sendReplyFileBuffer(_x5, _x6, _x7, _x8) { | ||
return _sendReplyFileBuffer.apply(this, arguments); | ||
} | ||
return sendInboxMessage; | ||
return sendReplyFileBuffer; | ||
}() | ||
}, { | ||
key: "sendReplyInboxMessage", | ||
key: "sendInboxMessage", | ||
value: function () { | ||
var _sendReplyInboxMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(id, replyID, message) { | ||
var _sendInboxMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(id, message) { | ||
var option, | ||
text, | ||
_args4 = arguments; | ||
@@ -122,7 +116,13 @@ return _regeneratorRuntime().wrap(function _callee4$(_context4) { | ||
case 0: | ||
option = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : {}; | ||
return _context4.abrupt("return", this.sendInboxMessage(id, message, _objectSpread({ | ||
reply_to_message_id: replyID | ||
option = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {}; | ||
text = message; | ||
if (Array.isArray(message)) { | ||
text = message.join('\n'); | ||
} | ||
return _context4.abrupt("return", this.client.post("".concat(this.endpoint, "/sendMessage"), _objectSpread({ | ||
chat_id: id, | ||
text: text, | ||
parse_mode: 'HTML' | ||
}, option))); | ||
case 2: | ||
case 4: | ||
case "end": | ||
@@ -133,11 +133,11 @@ return _context4.stop(); | ||
})); | ||
function sendReplyInboxMessage(_x7, _x8, _x9) { | ||
return _sendReplyInboxMessage.apply(this, arguments); | ||
function sendInboxMessage(_x9, _x10) { | ||
return _sendInboxMessage.apply(this, arguments); | ||
} | ||
return sendReplyInboxMessage; | ||
return sendInboxMessage; | ||
}() | ||
}, { | ||
key: "editMessage", | ||
key: "sendReplyInboxMessage", | ||
value: function () { | ||
var _editMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(id, messageId, message) { | ||
var _sendReplyInboxMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(id, replyID, message) { | ||
var option, | ||
@@ -150,3 +150,3 @@ _args5 = arguments; | ||
return _context5.abrupt("return", this.sendInboxMessage(id, message, _objectSpread({ | ||
message_id: messageId | ||
reply_to_message_id: replyID | ||
}, option))); | ||
@@ -159,12 +159,13 @@ case 2: | ||
})); | ||
function editMessage(_x10, _x11, _x12) { | ||
return _editMessage.apply(this, arguments); | ||
function sendReplyInboxMessage(_x11, _x12, _x13) { | ||
return _sendReplyInboxMessage.apply(this, arguments); | ||
} | ||
return editMessage; | ||
return sendReplyInboxMessage; | ||
}() | ||
}, { | ||
key: "sendCallback", | ||
key: "sendEditMessage", | ||
value: function () { | ||
var _sendCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(id, message, menu) { | ||
var _sendEditMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(id, messageId, message) { | ||
var option, | ||
text, | ||
_args6 = arguments; | ||
@@ -175,4 +176,35 @@ return _regeneratorRuntime().wrap(function _callee6$(_context6) { | ||
option = _args6.length > 3 && _args6[3] !== undefined ? _args6[3] : {}; | ||
return _context6.abrupt("return", this.client.post("".concat(this.endpoint, "/sendMessage"), _objectSpread({ | ||
text = message; | ||
if (Array.isArray(message)) { | ||
text = message.join('\n'); | ||
} | ||
return _context6.abrupt("return", this.client.post("".concat(this.endpoint, "/editMessageText"), _objectSpread({ | ||
chat_id: id, | ||
text: text, | ||
parse_mode: 'HTML', | ||
message_id: messageId | ||
}, option))); | ||
case 4: | ||
case "end": | ||
return _context6.stop(); | ||
} | ||
}, _callee6, this); | ||
})); | ||
function sendEditMessage(_x14, _x15, _x16) { | ||
return _sendEditMessage.apply(this, arguments); | ||
} | ||
return sendEditMessage; | ||
}() | ||
}, { | ||
key: "sendCallback", | ||
value: function () { | ||
var _sendCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(id, message, menu) { | ||
var option, | ||
_args7 = arguments; | ||
return _regeneratorRuntime().wrap(function _callee7$(_context7) { | ||
while (1) switch (_context7.prev = _context7.next) { | ||
case 0: | ||
option = _args7.length > 3 && _args7[3] !== undefined ? _args7[3] : {}; | ||
return _context7.abrupt("return", this.client.post("".concat(this.endpoint, "/sendMessage"), _objectSpread({ | ||
chat_id: id, | ||
text: message, | ||
@@ -189,7 +221,7 @@ parse_mode: 'HTML', | ||
case "end": | ||
return _context6.stop(); | ||
return _context7.stop(); | ||
} | ||
}, _callee6, this); | ||
}, _callee7, this); | ||
})); | ||
function sendCallback(_x13, _x14, _x15) { | ||
function sendCallback(_x17, _x18, _x19) { | ||
return _sendCallback.apply(this, arguments); | ||
@@ -202,10 +234,10 @@ } | ||
value: function () { | ||
var _sendReplyCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(id, replyID, message, menu) { | ||
var _sendReplyCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(id, replyID, message, menu) { | ||
var option, | ||
_args7 = arguments; | ||
return _regeneratorRuntime().wrap(function _callee7$(_context7) { | ||
while (1) switch (_context7.prev = _context7.next) { | ||
_args8 = arguments; | ||
return _regeneratorRuntime().wrap(function _callee8$(_context8) { | ||
while (1) switch (_context8.prev = _context8.next) { | ||
case 0: | ||
option = _args7.length > 4 && _args7[4] !== undefined ? _args7[4] : {}; | ||
return _context7.abrupt("return", this.sendCallback(id, message, menu, _objectSpread({ | ||
option = _args8.length > 4 && _args8[4] !== undefined ? _args8[4] : {}; | ||
return _context8.abrupt("return", this.sendCallback(id, message, menu, _objectSpread({ | ||
reply_to_message_id: replyID | ||
@@ -215,7 +247,7 @@ }, option))); | ||
case "end": | ||
return _context7.stop(); | ||
return _context8.stop(); | ||
} | ||
}, _callee7, this); | ||
}, _callee8, this); | ||
})); | ||
function sendReplyCallback(_x16, _x17, _x18, _x19) { | ||
function sendReplyCallback(_x20, _x21, _x22, _x23) { | ||
return _sendReplyCallback.apply(this, arguments); | ||
@@ -222,0 +254,0 @@ } |
{ | ||
"name": "@azteam/telegram-api", | ||
"version": "1.1.83", | ||
"version": "1.1.85", | ||
"description": "N/A", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -34,2 +34,9 @@ import HttpClient from '@azteam/http-client'; | ||
async sendReplyFileBuffer(id, replyID, buffer, name, option = {}) { | ||
return this.sendFileBuffer(id, buffer, name, { | ||
reply_to_message_id: replyID, | ||
...option, | ||
}); | ||
} | ||
async sendInboxMessage(id, message, option = {}) { | ||
@@ -56,4 +63,12 @@ let text = message; | ||
async editMessage(id, messageId, message, option = {}) { | ||
return this.sendInboxMessage(id, message, { | ||
async sendEditMessage(id, messageId, message, option = {}) { | ||
let text = message; | ||
if (Array.isArray(message)) { | ||
text = message.join('\n'); | ||
} | ||
return this.client.post(`${this.endpoint}/editMessageText`, { | ||
chat_id: id, | ||
text, | ||
parse_mode: 'HTML', | ||
message_id: messageId, | ||
@@ -60,0 +75,0 @@ ...option, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28266
481