yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.3k stars 1.5k forks source link

feat: Telegram Bot API v6.3 #1020

Closed danielperez9430 closed 1 year ago

danielperez9430 commented 1 year ago

Description

Add the support for Telegram Bot API v6.3

References

Use example:

bot.onText(/\/opentopic/, (msg) => {
    console.log("opentopic", msg)
    if (msg?.is_topic_message) { // Check if the message is from a chat forum (topic)
        bot.createForumTopic(msg.chat.id, "Test topic")
    }
})

bot.onText(/\/closeTopic/, (msg) => {
    if (msg?.is_topic_message) {
        bot.closeForumTopic(msg.chat.id, msg.message_thread_id)
    }
})

bot.onText(/\/reopenForumTopic/, (msg) => {
    if (msg?.is_topic_message) {
        bot.reopenForumTopic(msg.chat.id, msg.message_thread_id)
    }
})

bot.onText(/\/deleteForumTopic/, (msg) => {
    if (msg?.is_topic_message) {
        bot.deleteForumTopic(msg.chat.id, msg.message_thread_id)
    }
})

bot.onText(/\/unpinAllForumTopicMessages/, (msg) => {
    if (msg?.is_topic_message) {
        bot.unpinAllForumTopicMessages(msg.chat.id, msg.message_thread_id)
    }
})

bot.onText(/\/getForumTopicIconStickers/, (msg) => {
    if (msg?.is_topic_message) {
        bot.getForumTopicIconStickers(msg.chat.id).then(resp => {
            console.dir(resp)
        })
    }
})