在电报或电报API中使用漫游器创建新频道

时间:2020-02-06 04:09:29

标签: node.js telegram telegram-bot

如何使用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

没人能帮我这个忙或给我个主意。非常感谢 。

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:0)

只有用户才能在电报中创建新的组或频道