我用的是非常基本的电报机器人。当直接向bot发送消息时,响应非常好。同时,bot只对组中的命令作出响应。
有任何选项可以使用所有的bot特性吗?
const config = require('./config.json')
const Telegraf = require('telegraf')
const bot = new Telegraf(config.token);
bot.start((ctx) => ctx.reply('Welcome'))
bot.help((ctx) => ctx.reply('Send me a sticker'))
bot.on('sticker', (ctx) => ctx.reply(''))
bot.hears('hi', (ctx) => ctx.reply('Hey there'))
bot.hears(/buy/i, (ctx) => ctx.reply('Buy-buy'))
bot.command('oldschool', (ctx) => ctx.reply('Hello'))
bot.command('modern', ({ reply }) => reply('Yo'))
bot.command('hipster', Telegraf.reply('λ'))
bot.startPolling()发布于 2018-08-16 23:01:29
默认情况下,电报组聊天中的机器人被放置在隐私模式中--它们只接收包含/commands或对机器人自身消息的回复的消息的回调。(它们还将接收服务消息的回调,比如用户加入或离开组时。)
组管理员需要禁用机器人的隐私模式以接收组中的所有消息。
https://stackoverflow.com/questions/51886000
复制相似问题