Node.js 在电报或电报api中使用bot创建新通道

Node.js 在电报或电报api中使用bot创建新通道,node.js,telegram,telegram-bot,Node.js,Telegram,Telegram Bot,如何在电报或电报api中使用bot创建新Channel 我用了lib“电报mtproto”。我在这里使用的“channels.createChannel”方法是我的代码 import MTProto from 'telegram-mtproto' const api = { layer: 57, // initConnection: 0x69796de9, api_id: 1153141 } const server = { dev: true //We wi

如何在电报或电报api中使用bot创建新Channel

我用了lib“电报mtproto”。我在这里使用的“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

没人能帮我做这件事或者给我一个主意。非常感谢你

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

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