首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在没有“/”的情况下用简单的文字回复?

如何在没有“/”的情况下用简单的文字回复?
EN

Stack Overflow用户
提问于 2018-07-26 08:16:33
回答 1查看 0关注 0票数 0

我尝试2个不同的代码,但是idk为什么那个机器人仍然可以用/首先回复,我只需要机器人回复当我说哇,机器人说哇,当我说/哇那个机器人没有回复,但在这个追逐这个机器人 仍然可以回复/

代码语言:txt
复制
import telebot
import telegram
import time
from telegram.ext import Updater, CommandHandler

bot = telebot.TeleBot("TOKEN")

#ex1:wow
@bot.message_handler(func=lambda msg:['wow'])
def at_answer(message):
    bot.reply_to(message, 'wow!')

#ex2:halo
def halo(bot, update):
    update.message.reply_text('Haloe!')
updater.dispatcher.add_handler(MessageHandler(Filters.regex('halo'), halo))

bot.polling()
EN

Stack Overflow用户

发布于 2018-07-26 17:51:10

你必须设置/setprivacy在里面

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/-100005821

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档