动手做个 AI 设备人,帮我回信息!
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">大众</span>好,我是鱼皮,自从做了知识分享,我的<span style="color: black;">微X</span>就没消停过,平均<span style="color: black;">每日</span>会收到几百个<span style="color: black;">信息</span>,大部分都是学编程的<span style="color: black;">伴侣</span>向我咨询编程问题。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">但毕竟我<span style="color: black;">仅有</span>一个人,没法所有<span style="color: black;">信息</span>都一个个回复,<span style="color: black;">因此</span><span style="color: black;">亦</span>是很愧疚和<span style="color: black;">没</span>力吧;<span style="color: black;">另一</span>我<span style="color: black;">发掘</span>,<span style="color: black;">大众</span>的<span style="color: black;">非常多</span>问题是重复的,<span style="color: black;">况且</span>大<span style="color: black;">都数</span>我都专门写<span style="color: black;">文案</span>来回答过。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">因此</span>,我决定自制一个 AI 问答<span style="color: black;">设备</span>人,帮我自动回复<span style="color: black;">大众</span>的<span style="color: black;">平常</span>问题,减少重复工作。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">结果没想到,制作过程中被 Bug 坑惨了,闹了不少笑话,感兴趣的<span style="color: black;">伴侣</span><span style="color: black;">能够</span><span style="color: black;">瞧瞧</span>视频哈哈:</p> <span style="color: black;">位置</span>:<div style="color: black; text-align: left; margin-bottom: 10px;"><a style="color: black;"><span style="color: black;"><span style="color: black;">我竟然被AI<span style="color: black;">设备</span>人送走了?!_哔哩哔哩_bilibili</span><span style="color: black;"><span style="color: black;"></span>www.bilibili.com/video/BV1Vq4y1B7zu/</span></span><span style="color: black;"><img src="https://pic2.zhimg.com/v2-b80f8bf1655d6f9412f9a631654f7129_180x120.jpg" style="width: 50%; margin-bottom: 20px;"></span></a></div>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic3.zhimg.com/80/v2-47e7c1dd65b3ccb1096968449c63bf8a_720w.webp" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">因为</span>制作<span style="color: black;">办法</span>实在太简单,<span style="color: black;">因此</span>给<span style="color: black;">大众</span>分享下完整的教程,让<span style="color: black;">大众</span><span style="color: black;">亦</span>能<span style="color: black;">容易</span>制作自己的 AI <span style="color: black;">设备</span>人。</p>
<h3 style="color: black; text-align: left; margin-bottom: 10px;">自制 AI <span style="color: black;">设备</span>人教程</h3>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> 预计<span style="color: black;">全部</span>制作过程 10 分钟</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">先描述下需求:做一个能够自动回答<span style="color: black;">微X</span><span style="color: black;">信息</span>的<span style="color: black;">设备</span>人。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">要实现这个需求,有两个要点:</p><span style="color: black;">怎样</span>让程序接收到<span style="color: black;">微X</span>发来的<span style="color: black;">信息</span>?<span style="color: black;">怎样</span><span style="color: black;">按照</span><span style="color: black;">信息</span>来回复对应的内容?<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这两个问题,<span style="color: black;">倘若</span><span style="color: black;">无</span><span style="color: black;">必定</span>的专业知识,是很难<span style="color: black;">自动</span><span style="color: black;">处理</span>的。但如今是开源的时代,<span style="color: black;">咱们</span><span style="color: black;">能够</span>站在巨人的肩膀上,用现成的技术来<span style="color: black;">处理</span>这些问题。</p>
<h3 style="color: black; text-align: left; margin-bottom: 10px;">接受<span style="color: black;">信息</span></h3>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">能够</span><span style="color: black;">运用</span>开源的 wechaty 库来实现对<span style="color: black;">微X</span>的自动化操作,<span style="color: black;">例如</span>收发<span style="color: black;">信息</span>、<span style="color: black;">经过</span>好友、拉群等。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic3.zhimg.com/80/v2-0fba87dfa639c9762ff4124dab7729a2_720w.webp" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">运用</span><span style="color: black;">办法</span>很简单,在 wechaty 仓库的项目介绍文件中,有最简单的入门示例代码,只<span style="color: black;">必须</span> 6 行代码 ,就能<span style="color: black;">起步</span>一个帮你接受<span style="color: black;">信息</span>的<span style="color: black;">设备</span>人!</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">wechaty 支持几乎所有主流的编程语言,其中 JavaScript 的入门代码如下:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;">import { WechatyBuilder } from wechaty
// <span style="color: black;">起步</span>
WechatyBuilder.build()
.on(scan, (qrcode, status) => console.log(`Scan QR Code to login: ${status}\nhttps://wechaty.js.org/qrcode/${encodeURIComponent(qrcode)}`))
.on(login, user => console.log(`User ${user} logged in`))
.on(message, message => console.log(`Message: ${message}`))
.start()</div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">解释一下<span style="color: black;">以上</span>代码,你会<span style="color: black;">发掘</span>,wechaty 中定义了<span style="color: black;">非常多</span>事件,<span style="color: black;">例如</span>扫码、用户登录、接受<span style="color: black;">信息</span>、接受好友请求等。你不<span style="color: black;">必须</span>关心事件是<span style="color: black;">怎样</span>被它触发的,只<span style="color: black;">必须</span>针对<span style="color: black;">区别</span>事件来编写处理<span style="color: black;">办法</span>就好,<span style="color: black;">例如</span>收到<span style="color: black;">信息</span>后自动回复<span style="color: black;">一样</span>的<span style="color: black;">信息</span>,示例代码如下:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;">// 初始化<span style="color: black;">设备</span>人
const bot = WechatyBuilder.build({
name: yupi-wxrobot,
// 用于兼容不</div>
外链论坛的成功举办,是与各位领导、同仁们的关怀和支持分不开的。在此,我谨代表公司向关心和支持论坛的各界人士表示最衷心的感谢! 真情实感,其含义为认真了、走心了的意思,是如今的饭圈常用语。
页:
[1]