【问题标题】:Create new channel using bot in telegram or telegram api在电报或电报 api 中使用机器人创建新频道
【发布时间】:2023-12-13 21:19:02
【问题描述】:

如何在 Telegram 或 Telegram api 中使用机器人创建新频道?

我使用了 lib 'telegram-mtproto'。我在https://core.telegram.org/methods 中使用了“channels.createChannel”的方法,这是我的代码

import MTProto from 'telegram-mtproto'

const api = {
    layer: 57,
    // initConnection: 0x69796de9,
    api_id: 1153141
}

const server = {
    dev: true //We will connect to the test server.
} //Any empty configurations fields can just not be specified

const client = MTProto({ server, api })

export const connect = async () => {
    const result = await client('channels.createChannel', {
        title: 'This is title',
        about: 'This is description',
        address: 't.me/test123456'
    })
    console.log('TCL: result', result)
}

我明白了

Error 401 AUTH_KEY_UNREGISTERED 2 2
(node:14408) UnhandledPromiseRejectionWarning: Error: 401 AUTH_KEY_UNREGISTERED CODE#401 AUTH_KEY_UNREGISTERED

没有人可以帮助我或给我一个想法。非常感谢 。

【问题讨论】:

    标签: node.js telegram telegram-bot


    【解决方案1】:

    只有用户可以在电报中创建新组或频道

    【讨论】:

      【解决方案2】:

      机器人无法创建群组/频道。只有用户可以。您可以通过以用户身份登录来尝试此操作。

      【讨论】: