【发布时间】: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