Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.www.
wechaty
提交
69dd1cd5
W
wechaty
项目概览
.www.
/
wechaty
与 Fork 源项目一致
Fork自
wechaty / wechaty
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
wechaty
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
69dd1cd5
编写于
12月 08, 2016
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix contact id null exception for example bot ding-dong-bot
#123
上级
a468db15
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
8 deletion
+15
-8
README.md
README.md
+3
-3
example/ding-dong-bot.ts
example/ding-dong-bot.ts
+4
-4
src/puppet-web/bridge.ts
src/puppet-web/bridge.ts
+4
-1
src/puppet-web/puppet-web.ts
src/puppet-web/puppet-web.ts
+4
-0
未找到文件。
README.md
浏览文件 @
69dd1cd5
...
...
@@ -27,9 +27,9 @@ Wechaty is a Bot Framework for Wechat **Personal** Account which can help you cr
> @naishstar: thanks for great SDK [link](https://github.com/wechaty/wechaty/issues/57)
> @shevyan: 简单的接口...和Docker化的封装
,结合Docker
绝对是一个不错的选择 [link](http://mp.weixin.qq.com/s/o-4VMcAMz0K8yJVdNaUXow)
> @shevyan: 简单的接口...和Docker化的封装
...
绝对是一个不错的选择 [link](http://mp.weixin.qq.com/s/o-4VMcAMz0K8yJVdNaUXow)
> @lijiarui:
[Chat实录|李佳芮:向前一步的程序媛
](http://mp.weixin.qq.com/s/dWHAj8XtiKG-1fIS5Og79g)
> @lijiarui:
Chat实录|李佳芮:向前一步的程序媛 [link
](http://mp.weixin.qq.com/s/dWHAj8XtiKG-1fIS5Og79g)
# Example
...
...
@@ -204,7 +204,7 @@ Scan the following QR Code in WeChat, with secret code _wechaty_, you can join o
![
Wechaty Developers' Home
](
https://raw.githubusercontent.com/wechaty/wechaty/master/image/BotQrcode.png
)
Scan now, then you can chat with other Wechaty developers!
Scan now, then you can chat with other Wechaty developers!
(secret code: _wechaty_)
# See Also
...
...
example/ding-dong-bot.ts
浏览文件 @
69dd1cd5
...
...
@@ -44,7 +44,10 @@ console.log(welcome)
const
bot
=
Wechaty
.
instance
({
profile
:
Config
.
DEFAULT_PROFILE
})
bot
.
on
(
'
login
'
,
user
=>
log
.
info
(
'
Bot
'
,
`
${
user
.
name
()}
logined`
))
.
on
(
'
login
'
,
user
=>
{
log
.
info
(
'
Bot
'
,
`
${
user
.
name
()}
logined`
)
bot
.
say
(
'
Wechaty login
'
)
})
.
on
(
'
logout
'
,
user
=>
log
.
info
(
'
Bot
'
,
`
${
user
.
name
()}
logouted`
))
.
on
(
'
error
'
,
e
=>
log
.
info
(
'
Bot
'
,
'
error: %s
'
,
e
))
.
on
(
'
scan
'
,
(
url
,
code
)
=>
{
...
...
@@ -72,9 +75,6 @@ bot
})
bot
.
init
()
.
then
(()
=>
{
bot
.
say
(
'
Wechaty init
'
)
})
.
catch
(
e
=>
{
log
.
error
(
'
Bot
'
,
'
init() fail: %s
'
,
e
)
bot
.
quit
()
...
...
src/puppet-web/bridge.ts
浏览文件 @
69dd1cd5
...
...
@@ -127,7 +127,10 @@ export class Bridge {
log
.
verbose
(
'
PuppetWebBridge
'
,
'
getUserName()
'
)
try
{
return
await
this
.
proxyWechaty
(
'
getUserName
'
)
const
userName
=
await
this
.
proxyWechaty
(
'
getUserName
'
)
return
userName
}
catch
(
e
)
{
log
.
error
(
'
PuppetWebBridge
'
,
'
getUserName() exception: %s
'
,
e
.
message
)
throw
e
...
...
src/puppet-web/puppet-web.ts
浏览文件 @
69dd1cd5
...
...
@@ -330,6 +330,10 @@ export class PuppetWeb extends Puppet {
* send to `filehelper` for notice / log
*/
public
async
say
(
content
:
string
):
Promise
<
void
>
{
if
(
!
this
.
logined
())
{
throw
new
Error
(
'
can not say before login
'
)
}
const
m
=
new
Message
()
m
.
to
(
'
filehelper
'
)
m
.
content
(
content
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录