Actualizacion de seguridad

This commit is contained in:
Pablinux
2024-07-13 00:27:32 -05:00
parent 90f05f7ad0
commit fa92efc258
186 changed files with 75113 additions and 17648 deletions

150
node_modules/telegraf/telegram.js generated vendored
View File

@@ -54,17 +54,12 @@ class Telegram extends ApiClient {
})
}
setWebhook (url, certificate, maxConnections, allowedUpdates) {
return this.callApi('setWebhook', {
url,
certificate,
max_connections: maxConnections,
allowed_updates: allowedUpdates
})
setWebhook (url, extra) {
return this.callApi('setWebhook', { url, ...extra })
}
deleteWebhook () {
return this.callApi('deleteWebhook')
deleteWebhook (extra) {
return this.callApi('deleteWebhook', extra)
}
sendMessage (chatId, text, extra) {
@@ -180,7 +175,11 @@ class Telegram extends ApiClient {
}
getChatMembersCount (chatId) {
return this.callApi('getChatMembersCount', { chat_id: chatId })
return this.callApi('getChatMemberCount', { chat_id: chatId })
}
getChatMemberCount (chatId) {
return this.callApi('getChatMemberCount', { chat_id: chatId })
}
answerInlineQuery (inlineQueryId, results, extra) {
@@ -191,8 +190,12 @@ class Telegram extends ApiClient {
return this.callApi('setChatPermissions', { chat_id: chatId, permissions })
}
banChatMember (chatId, userId, extra) {
return this.callApi('banChatMember', { chat_id: chatId, user_id: userId, ...extra })
}
kickChatMember (chatId, userId, untilDate) {
return this.callApi('kickChatMember', { chat_id: chatId, user_id: userId, until_date: untilDate })
return this.callApi('banChatMember', { chat_id: chatId, user_id: userId, until_date: untilDate })
}
promoteChatMember (chatId, userId, extra) {
@@ -207,6 +210,14 @@ class Telegram extends ApiClient {
return this.callApi('setChatAdministratorCustomTitle', { chat_id: chatId, user_id: userId, custom_title: title })
}
banChatSenderChat (chatId, senderChatId) {
return this.callApi('banChatSenderChat', { chat_id: chatId, sender_chat_id: senderChatId })
}
unbanChatSenderChat (chatId, senderChatId) {
return this.callApi('unbanChatSenderChat', { chat_id: chatId, sender_chat_id: senderChatId })
}
exportChatInviteLink (chatId) {
return this.callApi('exportChatInviteLink', { chat_id: chatId })
}
@@ -231,16 +242,20 @@ class Telegram extends ApiClient {
return this.callApi('pinChatMessage', { chat_id: chatId, message_id: messageId, ...extra })
}
unpinChatMessage (chatId) {
return this.callApi('unpinChatMessage', { chat_id: chatId })
unpinChatMessage (chatId, extra) {
return this.callApi('unpinChatMessage', { chat_id: chatId, ...extra })
}
unpinAllChatMessages (chatId) {
return this.callApi('unpinAllChatMessages', { chat_id: chatId })
}
leaveChat (chatId) {
return this.callApi('leaveChat', { chat_id: chatId })
}
unbanChatMember (chatId, userId) {
return this.callApi('unbanChatMember', { chat_id: chatId, user_id: userId })
unbanChatMember (chatId, userId, extra) {
return this.callApi('unbanChatMember', { chat_id: chatId, user_id: userId, ...extra })
}
answerCbQuery (callbackQueryId, text, showAlert, extra) {
@@ -292,7 +307,8 @@ class Telegram extends ApiClient {
chat_id: chatId,
message_id: messageId,
inline_message_id: inlineMessageId,
parse_mode: extra.parse_mode,
...extra.parse_mode && { parse_mode: extra.parse_mode },
...extra.caption_entities && { caption_entities: extra.caption_entities },
reply_markup: extra.parse_mode || extra.reply_markup ? extra.reply_markup : extra
})
}
@@ -302,7 +318,12 @@ class Telegram extends ApiClient {
chat_id: chatId,
message_id: messageId,
inline_message_id: inlineMessageId,
media: { ...media, parse_mode: extra.parse_mode },
media: {
...media,
parse_mode: extra.parse_mode,
caption: extra.caption,
caption_entities: extra.caption_entities
},
reply_markup: extra.reply_markup ? extra.reply_markup : extra
})
}
@@ -316,14 +337,14 @@ class Telegram extends ApiClient {
})
}
editMessageLiveLocation (latitude, longitude, chatId, messageId, inlineMessageId, markup) {
editMessageLiveLocation (chatId, messageId, inlineMessageId, latitude, longitude, extra) {
return this.callApi('editMessageLiveLocation', {
latitude,
longitude,
chat_id: chatId,
message_id: messageId,
inline_message_id: inlineMessageId,
reply_markup: markup
latitude,
longitude,
...extra
})
}
@@ -398,12 +419,16 @@ class Telegram extends ApiClient {
return this.callApi('deleteStickerFromSet', { sticker })
}
getMyCommands () {
return this.callApi('getMyCommands')
getMyCommands (extra) {
return this.callApi('getMyCommands', extra)
}
setMyCommands (commands) {
return this.callApi('setMyCommands', { commands })
setMyCommands (commands, extra) {
return this.callApi('setMyCommands', { commands, ...extra })
}
deleteMyCommands (extra) {
return this.callApi('deleteMyCommands', extra)
}
setPassportDataErrors (userId, errors) {
@@ -417,6 +442,9 @@ class Telegram extends ApiClient {
if (!message) {
throw new Error('Message is required')
}
if (message.chat && message.chat.id && message.message_id) {
return this.copyMessage(chatId, message.chat.id, message.message_id, extra)
}
const type = Object.keys(replicators.copyMethods).find((type) => message[type])
if (!type) {
throw new Error('Unsupported message type')
@@ -428,6 +456,78 @@ class Telegram extends ApiClient {
}
return this.callApi(replicators.copyMethods[type], opts)
}
copyMessage (chatId, fromChatId, messageId, extra) {
return this.callApi('copyMessage', {
chat_id: chatId,
from_chat_id: fromChatId,
message_id: messageId,
...extra
})
}
createChatInviteLink (chatId, name, extra) {
return this.callApi('createChatInviteLink', {
chat_id: chatId,
name: name,
...extra
})
}
editChatInviteLink (chatId, inviteLink, extra) {
return this.callApi('editChatInviteLink', {
chat_id: chatId,
invite_link: inviteLink,
...extra
})
}
revokeChatInviteLink (chatId, inviteLink) {
return this.callApi('revokeChatInviteLink', {
chat_id: chatId,
invite_link: inviteLink
})
}
approveChatJoinRequest (chatId, userId) {
return this.callApi('approveChatJoinRequest', {
chat_id: chatId,
user_id: userId
})
}
declineChatJoinRequest (chatId, userId) {
return this.callApi('declineChatJoinRequest', {
chat_id: chatId,
user_id: userId
})
}
setChatMenuButton (chatId, menuButton) {
return this.callApi('setChatMenuButton', {
chat_id: chatId,
menu_button: menuButton
})
}
getChatMenuButton (chatId) {
return this.callApi('getChatMenuButton', {
chat_id: chatId
})
}
setMyDefaultAdministratorRights (rights, forChannels) {
return this.callApi('setMyDefaultAdministratorRights', {
rights: rights,
for_channels: forChannels
})
}
getMyDefaultAdministratorRights (forChannels) {
return this.callApi('getMyDefaultAdministratorRights', {
for_channels: forChannels
})
}
}
module.exports = Telegram