我正在创建一个在在线词典中搜索单词的电报机器人,当我需要在 Telegram 中创建用于在该词典中搜索的命令时,问题就出现了,此时我有这个:
from rae import Drae
drae = Drae()
if text.startswith('/'):
if text =='/define':
drae.search(u' ') # The problem is here, I don't know how to implement the command and the word who the client wants to search.
setEnabled(chat_id, True)
- 我在 Python 中使用这个 Telegram API:https ://github.com/yukuku/telebot
- 这个字典 API:https ://github.com/dialelo/rae-1