Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wechaty
wechaty
提交
218fbfe0
W
wechaty
项目概览
wechaty
/
wechaty
上一次同步 大约 3 年
通知
304
Star
10499
Fork
6
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
152
列表
看板
标记
里程碑
合并请求
1
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
wechaty
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
152
Issue
152
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
218fbfe0
编写于
4月 29, 2018
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename deprecated `content()` to `text()`
上级
6a92dac4
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
15 addition
and
15 deletion
+15
-15
examples/api-ai-bot.ts
examples/api-ai-bot.ts
+1
-1
examples/ding-dong-bot.ts
examples/ding-dong-bot.ts
+1
-1
examples/gist-bot/on-message.ts
examples/gist-bot/on-message.ts
+1
-1
examples/hot-reload-bot/listener/message.js
examples/hot-reload-bot/listener/message.js
+1
-1
examples/monster/listeners/on-message.js
examples/monster/listeners/on-message.js
+4
-4
examples/room-bot.ts
examples/room-bot.ts
+1
-1
examples/tuling123-bot.ts
examples/tuling123-bot.ts
+2
-2
src/puppet-puppeteer/event.ts
src/puppet-puppeteer/event.ts
+1
-1
src/puppet-puppeteer/puppet-puppeteer.ts
src/puppet-puppeteer/puppet-puppeteer.ts
+1
-1
src/puppet-puppeteer/puppeteer-friend-request.spec.ts
src/puppet-puppeteer/puppeteer-friend-request.spec.ts
+1
-1
src/puppet-puppeteer/puppeteer-message.ts
src/puppet-puppeteer/puppeteer-message.ts
+1
-1
未找到文件。
examples/api-ai-bot.ts
浏览文件 @
218fbfe0
...
...
@@ -166,7 +166,7 @@ const Talkers: Talker[] = []
function
talk
(
m
)
{
const
fromId
=
m
.
from
().
id
const
roomId
=
m
.
room
().
id
const
content
=
m
.
conten
t
()
const
content
=
m
.
tex
t
()
const
talkerName
=
fromId
+
roomId
if
(
!
Talkers
[
talkerName
])
{
...
...
examples/ding-dong-bot.ts
浏览文件 @
218fbfe0
...
...
@@ -84,7 +84,7 @@ bot
+
`
${
m
.
from
()}
:
${
m
}
`
,
)
if
(
/^
(
ding|ping|bing|code
)
$/i
.
test
(
m
.
conten
t
())
&&
!
m
.
self
())
{
if
(
/^
(
ding|ping|bing|code
)
$/i
.
test
(
m
.
tex
t
())
&&
!
m
.
self
())
{
m
.
say
(
'
dong
'
)
log
.
info
(
'
Bot
'
,
'
REPLY: dong
'
)
...
...
examples/gist-bot/on-message.ts
浏览文件 @
218fbfe0
...
...
@@ -31,7 +31,7 @@ export async function onMessage(this: Wechaty, message: Message): Promise<void>
try
{
const
room
=
message
.
room
()
const
sender
=
message
.
from
()
const
content
=
message
.
conten
t
()
const
content
=
message
.
tex
t
()
console
.
log
((
room
?
'
[
'
+
room
.
topic
()
+
'
]
'
:
''
)
+
'
<
'
+
sender
.
name
()
+
'
>
'
...
...
examples/hot-reload-bot/listener/message.js
浏览文件 @
218fbfe0
...
...
@@ -19,7 +19,7 @@
exports
=
module
.
exports
=
async
function
onMessage
(
message
)
{
const
room
=
message
.
room
();
const
sender
=
message
.
from
();
const
content
=
message
.
conten
t
();
const
content
=
message
.
tex
t
();
const
topic
=
room
?
'
[
'
+
room
.
topic
()
+
'
]
'
:
''
;
...
...
examples/monster/listeners/on-message.js
浏览文件 @
218fbfe0
...
...
@@ -34,7 +34,7 @@ export default async function onMessage (message) {
try
{
const
room
=
message
.
room
()
const
sender
=
message
.
from
()
const
content
=
message
.
conten
t
()
const
content
=
message
.
tex
t
()
const
roomName
=
room
?
`[
${
room
.
topic
()}
] `
:
''
process
.
stdout
.
write
(
...
...
@@ -44,11 +44,11 @@ export default async function onMessage (message) {
saveMediaFile
(
message
)
return
}
console
.
log
(
`
${
Misc
.
digestEmoji
(
message
)}
`
)
// add an extra CR if too long
if
(
content
.
length
>
80
)
console
.
log
(
""
)
const
config
=
await
hotImport
(
'
config.js
'
)
// Hot import! Try to change the msgKW1&2 to 'ping' & 'pong'
// after the bot has already started!
...
...
@@ -62,7 +62,7 @@ export default async function onMessage (message) {
}
}
catch
(
e
)
{
log
.
error
(
'
Bot
'
,
'
on(message) exception: %s
'
,
e
)
}
}
}
async
function
saveMediaFile
(
message
)
{
...
...
examples/room-bot.ts
浏览文件 @
218fbfe0
...
...
@@ -160,7 +160,7 @@ bot
.
on
(
'
message
'
,
async
function
(
this
:
Wechaty
,
message
)
{
const
room
=
message
.
room
()
const
sender
=
message
.
from
()
const
content
=
message
.
conten
t
()
const
content
=
message
.
tex
t
()
console
.
log
((
room
?
'
[
'
+
room
.
topic
()
+
'
]
'
:
''
)
+
'
<
'
+
sender
.
name
()
+
'
>
'
...
...
examples/tuling123-bot.ts
浏览文件 @
218fbfe0
...
...
@@ -82,10 +82,10 @@ bot
log
.
info
(
'
Bot
'
,
'
talk: %s
'
,
msg
)
try
{
const
{
text
:
reply
}
=
await
tuling
.
ask
(
msg
.
conten
t
(),
{
userid
:
msg
.
from
()})
const
{
text
:
reply
}
=
await
tuling
.
ask
(
msg
.
tex
t
(),
{
userid
:
msg
.
from
()})
log
.
info
(
'
Tuling123
'
,
'
Talker reply:"%s" for "%s"
'
,
reply
,
msg
.
conten
t
(),
msg
.
tex
t
(),
)
msg
.
say
(
reply
)
}
catch
(
e
)
{
...
...
src/puppet-puppeteer/event.ts
浏览文件 @
218fbfe0
...
...
@@ -200,7 +200,7 @@ async function onMessage(
const
topicRestul
=
await
Firer
.
checkRoomTopic
.
call
(
this
,
m
)
if
(
!
joinResult
&&
!
leaveResult
&&
!
topicRestul
)
{
log
.
warn
(
'
PuppetPuppeteerEvent
'
,
`checkRoomSystem message: <
${
m
.
conten
t
()}
> not found`
)
log
.
warn
(
'
PuppetPuppeteerEvent
'
,
`checkRoomSystem message: <
${
m
.
tex
t
()}
> not found`
)
}
}
else
{
Firer
.
checkFriendConfirm
.
call
(
this
,
m
)
...
...
src/puppet-puppeteer/puppet-puppeteer.ts
浏览文件 @
218fbfe0
...
...
@@ -736,7 +736,7 @@ export class PuppetPuppeteer extends Puppet {
// const m = new Message()
// m.to('filehelper')
// m.
conten
t(content)
// m.
tex
t(content)
// return await this.send(m)
return
await
this
.
user
.
say
(
text
)
...
...
src/puppet-puppeteer/puppeteer-friend-request.spec.ts
浏览文件 @
218fbfe0
...
...
@@ -84,7 +84,7 @@ test('PuppetPuppeteerFriendRequest.confirm smoke testing', async t => {
wechaty
:
new
Wechaty
(),
})
t
.
true
(
/^You have added
(
.+
)
as your WeChat contact. Start chatting!$/
.
test
(
m
.
conten
t
()),
'
should match confirm message
'
)
t
.
true
(
/^You have added
(
.+
)
as your WeChat contact. Start chatting!$/
.
test
(
m
.
tex
t
()),
'
should match confirm message
'
)
const
fr
=
new
MyFriendRequest
()
const
contact
=
m
.
from
()
...
...
src/puppet-puppeteer/puppeteer-message.ts
浏览文件 @
218fbfe0
...
...
@@ -462,7 +462,7 @@ export class PuppeteerMessage extends Message {
// flatten array, see http://stackoverflow.com/a/10865042/1123955
const
mentionList
=
[].
concat
.
apply
([],
rawMentionedList
)
log
.
verbose
(
'
PuppeteerMessage
'
,
'
mentioned(%s),get mentionList: %s
'
,
this
.
conten
t
(),
JSON
.
stringify
(
mentionList
))
log
.
verbose
(
'
PuppeteerMessage
'
,
'
mentioned(%s),get mentionList: %s
'
,
this
.
tex
t
(),
JSON
.
stringify
(
mentionList
))
contactList
=
[].
concat
.
apply
([],
mentionList
.
map
(
nameStr
=>
room
.
memberAll
(
nameStr
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录