Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.www.
wechaty
提交
58db0333
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,体验更适合开发者的 AI 搜索 >>
提交
58db0333
编写于
7月 29, 2018
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
doc: clean
上级
477ce858
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
276 addition
and
73 deletion
+276
-73
docs/index.md
docs/index.md
+254
-67
src/user/contact.ts
src/user/contact.ts
+6
-2
src/user/message.ts
src/user/message.ts
+2
-0
src/user/room.ts
src/user/room.ts
+5
-3
src/wechaty.ts
src/wechaty.ts
+9
-1
未找到文件。
docs/index.md
浏览文件 @
58db0333
此差异已折叠。
点击以展开。
src/user/contact.ts
浏览文件 @
58db0333
...
...
@@ -291,7 +291,7 @@ export class Contact extends Accessory implements Sayable {
}
/**
* @
hidden
* @
private
*/
public
toString
():
string
{
const
identity
=
this
.
payload
...
...
@@ -437,6 +437,7 @@ export class Contact extends Accessory implements Sayable {
* Should use {@link Contact#friend} instead
*
* @deprecated
* @private
*/
public
stranger
():
null
|
boolean
{
log
.
warn
(
'
Contact
'
,
'
stranger() DEPRECATED. use friend() instead.
'
)
...
...
@@ -474,7 +475,7 @@ export class Contact extends Accessory implements Sayable {
* @description
* Check if it's a offical account, should use {@link Contact#type} instead
* @deprecated
*
*
@private
*/
public
official
():
boolean
{
log
.
warn
(
'
Contact
'
,
'
official() DEPRECATED. use type() instead
'
)
...
...
@@ -485,6 +486,7 @@ export class Contact extends Accessory implements Sayable {
* @description
* Check if it's a personal account, should use {@link Contact#type} instead
* @deprecated
* @private
*/
public
personal
():
boolean
{
log
.
warn
(
'
Contact
'
,
'
personal() DEPRECATED. use type() instead
'
)
...
...
@@ -599,6 +601,7 @@ export class Contact extends Accessory implements Sayable {
* Force reload(re-ready()) data for Contact, use {@link Contact#sync} instead
*
* @deprecated
* @private
*/
public
refresh
():
Promise
<
void
>
{
log
.
warn
(
'
Contact
'
,
'
refresh() DEPRECATED. use sync() instead.
'
)
...
...
@@ -611,6 +614,7 @@ export class Contact extends Accessory implements Sayable {
* @returns {Promise<this>}
* @example
* await contact.sync()
* @private
*/
public
async
sync
():
Promise
<
void
>
{
await
this
.
ready
(
true
)
...
...
src/user/message.ts
浏览文件 @
58db0333
...
...
@@ -328,6 +328,7 @@ export class Message extends Accessory implements Sayable {
public
async
say
(
contact
:
Contact
)
:
Promise
<
void
>
public
async
say
(
file
:
FileBox
)
:
Promise
<
void
>
public
async
say
(...
args
:
never
[]):
Promise
<
never
>
/**
* Reply a Text or Media File message to the sender.
* > Tips:
...
...
@@ -578,6 +579,7 @@ export class Message extends Accessory implements Sayable {
* @description
* should use {@link Message#mention} instead
* @deprecated
* @private
*/
public
async
mentioned
():
Promise
<
Contact
[]
>
{
log
.
warn
(
'
Message
'
,
'
mentioned() DEPRECATED. use mention() instead.
'
)
...
...
src/user/room.ts
浏览文件 @
58db0333
...
...
@@ -313,7 +313,7 @@ export class Room extends Accessory implements Sayable {
}
/**
* @
hidden
* @
private
*/
public
async
ready
(
dirty
=
false
,
...
...
@@ -348,7 +348,7 @@ export class Room extends Accessory implements Sayable {
}
/**
* @
hidden
* @
private
*/
public
isReady
():
boolean
{
return
!!
(
this
.
payload
)
...
...
@@ -358,7 +358,8 @@ export class Room extends Accessory implements Sayable {
public
say
(
text
:
string
,
mention
:
Contact
)
:
Promise
<
void
>
public
say
(
text
:
string
,
mention
:
Contact
[])
:
Promise
<
void
>
public
say
(
file
:
FileBox
)
:
Promise
<
void
>
public
say
(
text
:
never
,
...
args
:
never
[])
:
never
public
say
(...
args
:
never
[]):
never
/**
* Send message inside Room, if set [replyTo], wechaty will mention the contact as well.
...
...
@@ -934,6 +935,7 @@ export class Room extends Accessory implements Sayable {
* @returns {Promise<void>}
* @example
* await room.sync()
* @private
*/
public
async
sync
():
Promise
<
void
>
{
await
this
.
ready
(
true
)
...
...
src/wechaty.ts
浏览文件 @
58db0333
...
...
@@ -743,6 +743,7 @@ export class Wechaty extends Accessory implements Sayable {
* @desc
* use {@link Wechaty#start} instead
* @deprecated
* @private
*/
public
async
init
():
Promise
<
void
>
{
log
.
warn
(
'
Wechaty
'
,
'
init() DEPRECATED. use start() instead.
'
)
...
...
@@ -925,6 +926,7 @@ export class Wechaty extends Accessory implements Sayable {
* @description
* Should use {@link Wechaty#userSelf} instead
* @deprecated Use `userSelf()` instead
* @private
*/
public
self
():
Contact
{
log
.
warn
(
'
Wechaty
'
,
'
self() DEPRECATED. use userSelf() instead.
'
)
...
...
@@ -945,6 +947,11 @@ export class Wechaty extends Accessory implements Sayable {
return
user
}
public
async
say
(
text
:
string
)
:
Promise
<
void
>
public
async
say
(
contact
:
Contact
)
:
Promise
<
void
>
public
async
say
(
file
:
FileBox
)
:
Promise
<
void
>
public
async
say
(...
args
:
never
[]):
Promise
<
never
>
/**
* Send message to userSelf, in other words, bot send message to itself.
* > Tips:
...
...
@@ -975,9 +982,10 @@ export class Wechaty extends Accessory implements Sayable {
*
* // 4. send Image to bot itself from local file
* import { FileBox } from 'file-box'
* const fileBox = FileBox.from
Local
('/tmp/text.jpg')
* const fileBox = FileBox.from
File
('/tmp/text.jpg')
* await bot.say(fileBox)
*/
public
async
say
(
textOrContactOrFile
:
string
|
Contact
|
FileBox
):
Promise
<
void
>
{
log
.
verbose
(
'
Wechaty
'
,
'
say(%s)
'
,
textOrContactOrFile
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录