树莓自动化库与语音识别
raspauto的Python项目详细描述
拉斯帕托
智能技术远程管理
您可以在线访问和控制树莓的引脚和设置。
- 你可以用Telegram跟我谈谈。在
- 使用Telegram获取想法。在
- 请使用"Github Issues"报告错误。在
目录
创建电报机器人
要创建我们自己的bot帐户,我们需要开始与BotFather聊天。单击BotFather链接,然后按START
按钮,您将开始讲话。您将收到BotFather的帮助消息。您可以通过阅读此消息创建自己的机器人程序。
在以消息形式发送/newbot
命令后,它将询问bot的名称。现在我们把它命名为我的电报机器人。你可以给任何你想要的名字。然后,它会要求您输入电报机器人的用户名。只有两个条件。它以Bot or _bot
结尾。例如,应该使用MyTelegramBot
,mytelegram_bot
等用户名。在
选择用户名后,BotFather将向您发送一条消息,其中包含bot的电报url
和{/help
命令作为消息发送,BotFather将发送帮助您做什么的消息。在
如何安装?在
这个库与python3一起工作。请安装Python3。在
sudo apt-get install python3
让我们用pip加载Raspauto库。在
sudo pip3 install raspauto
创建一个python文件并在底部编写代码
importraspautora=raspauto.set("telegram_bot_token","bot_password")ra.start()
Bot Password:设置Bot使用的密码。在
记住:您必须以纯文本形式发送第一次使用时设置的密码。在
如何将其添加到开头?在
下载服务文件。在
wget hhttps://raw.githubusercontent.com/aattk/raspauto/master/demo/ra.service
执行复制操作以添加到开头。在
sudo cp ra.service /etc/systemd/system/ra.service
python文件名必须是ra.py
,此进程才能工作。另外,ra.py
文件应该在文件夹“`/home/pi”下。如果你想自己改变它。您可以查看demo文件夹下的示例服务文件。在
电报机器人命令
Command | Function | Usage |
---|---|---|
Every key press | It sends the defined pin lists as a button. | - |
/start | It sends the defined pin lists as a button. | ^{ |
/pinadd | Adds pin information to the system | ^{ |
/pinlist | It shows the pin information attached to the system. | ^{ |
/pindelete | Deletes all registered pins | ^{ |
/userdelete | Deletes all registered users | ^{ |
/pinset | It is used to set up timed messages from Telegram. | ^{ |
/photo | Takes and sends photos. | ^{ |
/help | Defined functions | ^{ |
/temp | Give Temp | ^{ |
/restart | Restart Raspberry | ^{ |
/libupdate | Update Raspauto and Reboot | ^{ |
/code | You use it to execute code | ^{ |
版本列表
版本0.2.0.2
- 现在可以用Bot运行代码了。/代码
- 回复每封邮件都已删除。相反,它开始响应一个字母、数字或/start命令。在
- /命令功能已编辑
- 修复了小错误。在
- 重新启动功能已修复。在
版本0.2.0.1
- 修复了小错误。在
版本0.1.9.9
- 添加了库更新功能。在
版本0.1.8.9
- 添加了温度功能。在
版本0.1.8.8
- 重新启动命令已运行。在
版本0.1.8.6
- 描述已经创建。在
版本0.1.8.5
- 已添加摄像头支持
版本0.1.8.0
- 增加了电报按钮的使用。在
- 通过电报添加用户
- 用户通过电报删除
- 通过电报增加了附加pin
- 通过电报添加了删除pin
版本0.1.6.5
- 火力基地支援已被电报取代。在
- 项目
标签: