Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.www.
wechaty
提交
c0fc661c
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,发现更多精彩内容 >>
提交
c0fc661c
编写于
8月 22, 2020
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove deprecated methods (#2049)
上级
d08a1331
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
24 addition
and
195 deletion
+24
-195
package.json
package.json
+23
-23
src/user/contact.ts
src/user/contact.ts
+1
-54
src/user/friendship.ts
src/user/friendship.ts
+0
-10
src/user/message.ts
src/user/message.ts
+0
-32
src/user/room-invitation.ts
src/user/room-invitation.ts
+0
-29
src/user/room.ts
src/user/room.ts
+0
-29
src/wechaty.ts
src/wechaty.ts
+0
-18
未找到文件。
package.json
浏览文件 @
c0fc661c
...
...
@@ -83,59 +83,59 @@
},
"homepage"
:
"
https://github.com/wechaty/
"
,
"dependencies"
:
{
"
brolog
"
:
"
^1.
8.3
"
,
"
brolog
"
:
"
^1.
12.4
"
,
"
clone-class
"
:
"
^0.7.3
"
,
"
cuid
"
:
"
^2.1.8
"
,
"
dotenv
"
:
"
^8.2.0
"
,
"
in-gfw
"
:
"
^1.2.0
"
,
"
json-rpc-peer
"
:
"
^0.1
5.5
"
,
"
json-rpc-peer
"
:
"
^0.1
6.0
"
,
"
npm-programmatic
"
:
"
0.0.12
"
,
"
open-graph
"
:
"
^0.2.4
"
,
"
opencollective
"
:
"
^1.0.3
"
,
"
opencollective-postinstall
"
:
"
^2.0.
2
"
,
"
opencollective-postinstall
"
:
"
^2.0.
3
"
,
"
pkg-dir
"
:
"
^4.2.0
"
,
"
portfinder
"
:
"
^1.0.2
5
"
,
"
promise-retry
"
:
"
^
1.1
.1
"
,
"
portfinder
"
:
"
^1.0.2
8
"
,
"
promise-retry
"
:
"
^
2.0
.1
"
,
"
raven
"
:
"
^2.6.4
"
,
"
read-pkg-up
"
:
"
^7.0.1
"
,
"
state-switch
"
:
"
^0.9.9
"
,
"
typed-emitter
"
:
"
^1.
2
.0
"
,
"
typed-emitter
"
:
"
^1.
3
.0
"
,
"
watchdog
"
:
"
^0.8.17
"
,
"
wechaty-puppet-hostie
"
:
"
^0.9.13
"
,
"
wechaty-puppet
"
:
"
^0.3
1.5
"
,
"
ws
"
:
"
^7.
2.3
"
"
wechaty-puppet
"
:
"
^0.3
2.3
"
,
"
ws
"
:
"
^7.
3.1
"
},
"devDependencies"
:
{
"
@babel/core
"
:
"
^7.
8.7
"
,
"
@babel/node
"
:
"
^7.
8.7
"
,
"
@babel/preset-env
"
:
"
^7.
8.7
"
,
"
@chatie/eslint-config
"
:
"
^0.1
1.5
"
,
"
@chatie/git-scripts
"
:
"
^0.
5
.2
"
,
"
@babel/core
"
:
"
^7.
11.4
"
,
"
@babel/node
"
:
"
^7.
10.5
"
,
"
@babel/preset-env
"
:
"
^7.
11.0
"
,
"
@chatie/eslint-config
"
:
"
^0.1
2.1
"
,
"
@chatie/git-scripts
"
:
"
^0.
6
.2
"
,
"
@chatie/semver
"
:
"
^0.4.7
"
,
"
@chatie/tsconfig
"
:
"
^0.
8.0
"
,
"
@types/cuid
"
:
"
^1.3.
0
"
,
"
@chatie/tsconfig
"
:
"
^0.
10.1
"
,
"
@types/cuid
"
:
"
^1.3.
1
"
,
"
@types/dotenv
"
:
"
^8.2.0
"
,
"
@types/glob
"
:
"
^7.1.
1
"
,
"
@types/glob
"
:
"
^7.1.
3
"
,
"
@types/open-graph
"
:
"
^0.2.0
"
,
"
@types/promise-retry
"
:
"
^1.1.3
"
,
"
@types/raven
"
:
"
^2.5.3
"
,
"
@types/retry
"
:
"
^0.12.0
"
,
"
@types/ws
"
:
"
^7.2.
2
"
,
"
@types/ws
"
:
"
^7.2.
6
"
,
"
apiai
"
:
"
^4.0.3
"
,
"
check-node-version
"
:
"
^4.0.
2
"
,
"
coveralls
"
:
"
^3.
0.9
"
,
"
check-node-version
"
:
"
^4.0.
3
"
,
"
coveralls
"
:
"
^3.
1.0
"
,
"
cross-env
"
:
"
^7.0.2
"
,
"
finis
"
:
"
^0.4.4
"
,
"
glob
"
:
"
^7.1.6
"
,
"
jsdoc-to-markdown
"
:
"
^
5.0.3
"
,
"
markdownlint-cli
"
:
"
^0.2
2.0
"
,
"
nyc
"
:
"
^15.
0
.0
"
,
"
jsdoc-to-markdown
"
:
"
^
6.0.1
"
,
"
markdownlint-cli
"
:
"
^0.2
3.2
"
,
"
nyc
"
:
"
^15.
1
.0
"
,
"
pkg-jq
"
:
"
^0.2.4
"
,
"
qrcode-terminal
"
:
"
^0.12.0
"
,
"
shx
"
:
"
^0.3.2
"
,
"
sloc
"
:
"
^0.2.1
"
,
"
tstest
"
:
"
^0.4.10
"
,
"
typedoc
"
:
"
^0.1
6.11
"
,
"
typedoc
"
:
"
^0.1
8.0
"
,
"
wechaty-puppet-mock
"
:
"
^0.27.2
"
},
"files_comment__whitelist_npm_publish"
:
"http://stackoverflow.com/a/8617868/1123955"
,
...
...
src/user/contact.ts
浏览文件 @
c0fc661c
...
...
@@ -570,7 +570,7 @@ class Contact extends ContactEventEmitter implements Sayable {
}
if
(
typeof
phoneList
===
'
undefined
'
)
{
return
this
.
wechaty
.
puppet
.
contactPhone
(
this
.
id
)
return
this
.
payload
.
phone
}
try
{
...
...
@@ -583,20 +583,6 @@ class Contact extends ContactEventEmitter implements Sayable {
}
}
/**
*
* @description
* Should use {@link Contact#friend} instead
*
* @deprecated
* @ignore
*/
public
stranger
():
null
|
boolean
{
log
.
warn
(
'
Contact
'
,
'
stranger() DEPRECATED. use friend() instead.
'
)
if
(
!
this
.
payload
)
return
null
return
!
this
.
friend
()
}
/**
* Check if contact is friend
*
...
...
@@ -618,33 +604,6 @@ class Contact extends ContactEventEmitter implements Sayable {
return
this
.
payload
.
friend
||
null
}
/**
* @ignore
* @see {@link https://github.com/Chatie/webwx-app-tracker/blob/7c59d35c6ea0cff38426a4c5c912a086c4c512b2/formatted/webwxApp.js#L3243|webwxApp.js#L324}
* @see {@link https://github.com/Urinx/WeixinBot/blob/master/README.md|Urinx/WeixinBot/README}
*/
/**
* @description
* Check if it's a official account, should use {@link Contact#type} instead
* @deprecated
* @ignore
*/
public
official
():
boolean
{
log
.
warn
(
'
Contact
'
,
'
official() DEPRECATED. use type() instead
'
)
return
!!
this
.
payload
&&
(
this
.
payload
.
type
===
ContactType
.
Official
)
}
/**
* @description
* Check if it's a personal account, should use {@link Contact#type} instead
* @deprecated
* @ignore
*/
public
personal
():
boolean
{
log
.
warn
(
'
Contact
'
,
'
personal() DEPRECATED. use type() instead
'
)
return
!!
this
.
payload
&&
this
.
payload
.
type
===
ContactType
.
Personal
}
/**
* Enum for ContactType
* @enum {number}
...
...
@@ -768,18 +727,6 @@ class Contact extends ContactEventEmitter implements Sayable {
}
}
/**
* @description
* Force reload(re-ready()) data for Contact, use {@link Contact#sync} instead
*
* @deprecated
* @ignore
*/
public
refresh
():
Promise
<
void
>
{
log
.
warn
(
'
Contact
'
,
'
refresh() DEPRECATED. use sync() instead.
'
)
return
this
.
sync
()
}
/**
* Force reload data for Contact, Sync data from low-level API again.
*
...
...
src/user/friendship.ts
浏览文件 @
c0fc661c
...
...
@@ -105,16 +105,6 @@ class Friendship extends EventEmitter implements Acceptable {
return
contact
}
/**
* @description
* use {@link Friendship#add} instead
* @deprecated
*/
public
static
async
send
(
contact
:
Contact
,
hello
:
string
)
{
log
.
warn
(
'
Friendship
'
,
'
static send() DEPRECATED, use add() instead.
'
)
return
this
.
add
(
contact
,
hello
)
}
/**
* Send a Friend Request to a `contact` with message `hello`.
*
...
...
src/user/message.ts
浏览文件 @
c0fc661c
...
...
@@ -327,17 +327,6 @@ class Message extends EventEmitter implements Sayable {
return
room
}
/**
* @description
* use {@link Message#text} instead
*
* @deprecated
*/
public
content
():
string
{
log
.
warn
(
'
Message
'
,
'
content() DEPRECATED. use text() instead.
'
)
return
this
.
text
()
}
/**
* Get the text content of the message
*
...
...
@@ -777,17 +766,6 @@ class Message extends EventEmitter implements Sayable {
return
textWithoutMention
.
trim
()
}
/**
* @description
* should use {@link Message#mention} instead
* @deprecated
* @ignore
*/
public
async
mentioned
():
Promise
<
Contact
[]
>
{
log
.
warn
(
'
Message
'
,
'
mentioned() DEPRECATED. use mention() instead.
'
)
return
this
.
mentionList
()
}
/**
* Check if a message is mention self.
*
...
...
@@ -938,16 +916,6 @@ class Message extends EventEmitter implements Sayable {
return
ageSeconds
}
/**
* @description
* use {@link Message#toFileBox} instead
* @deprecated
*/
public
async
file
():
Promise
<
FileBox
>
{
log
.
warn
(
'
Message
'
,
'
file() DEPRECATED. use toFileBox() instead.
'
)
return
this
.
toFileBox
()
}
/**
* Extract the Media File from the Message, and put it into the FileBox.
* > Tips:
...
...
src/user/room-invitation.ts
浏览文件 @
c0fc661c
...
...
@@ -177,36 +177,17 @@ class RoomInvitation implements Acceptable {
public
async
topic
():
Promise
<
string
>
{
const
payload
=
await
this
.
wechaty
.
puppet
.
roomInvitationPayload
(
this
.
id
)
// roomTopic deprecated. use topic instead:
return
payload
.
topic
||
payload
.
topic
||
''
}
/**
* @deprecated: use topic() instead
* @ignore
*/
public
async
roomTopic
():
Promise
<
string
>
{
return
this
.
topic
()
}
public
async
memberCount
():
Promise
<
number
>
{
log
.
verbose
(
'
RoomInvitation
'
,
'
memberCount()
'
)
const
payload
=
await
this
.
wechaty
.
puppet
.
roomInvitationPayload
(
this
.
id
)
// roomMemberCount deprecated. use memberCount instead:
return
payload
.
memberCount
||
payload
.
memberCount
||
0
}
/**
* @deprecated: use memberCount() instead
* @ignore
*/
public
async
roomMemberCount
():
Promise
<
number
>
{
log
.
warn
(
'
RoomInvitation
'
,
'
roomMemberCount() DEPRECATED. use memberCount() instead.
'
)
return
this
.
memberCount
()
}
/**
* List of Room Members that you known(is friend)
* @ignore
...
...
@@ -216,7 +197,6 @@ class RoomInvitation implements Acceptable {
const
payload
=
await
this
.
wechaty
.
puppet
.
roomInvitationPayload
(
this
.
id
)
// roomMemberIdList deprecated. use memberIdList isntead.
const
contactIdList
=
payload
.
memberIdList
||
payload
.
memberIdList
||
[]
const
contactList
=
contactIdList
.
map
(
...
...
@@ -231,15 +211,6 @@ class RoomInvitation implements Acceptable {
return
contactList
}
/**
* @deprecated: use memberList() instead.
* @ignore
*/
public
async
roomMemberList
():
Promise
<
Contact
[]
>
{
log
.
warn
(
'
RoomInvitation
'
,
'
roomMemberList() DEPRECATED. use memberList() instead.
'
)
return
this
.
roomMemberList
()
}
/**
* Get the invitation time
*
...
...
src/user/room.ts
浏览文件 @
c0fc661c
...
...
@@ -302,15 +302,6 @@ class Room extends RoomEventEmitter implements Sayable {
}
}
/**
* @ignore
* @ignore
* @deprecated: Use `sync()` instead
*/
public
async
refresh
():
Promise
<
void
>
{
await
this
.
sync
()
}
/**
* Force reload data for Room, Sync data from puppet API again.
*
...
...
@@ -959,14 +950,6 @@ class Room extends RoomEventEmitter implements Sayable {
}
}
/**
* @deprecated: use qrCode() instead
*/
public
async
qrcode
()
{
log
.
warn
(
'
Room
'
,
'
qrcode() is deprecated. use qrCode() instead.
'
)
return
this
.
qrCode
()
}
/**
* Get QR Code Value of the Room from the room, which can be used as scan and join the room.
* > Tips:
...
...
@@ -1007,18 +990,6 @@ class Room extends RoomEventEmitter implements Sayable {
return
null
}
/**
* Same as function alias
* @param {Contact} contact
* @returns {Promise<string | null>}
* @deprecated: use room.alias() instead
* @ignore
*/
public
async
roomAlias
(
contact
:
Contact
):
Promise
<
null
|
string
>
{
log
.
warn
(
'
Room
'
,
'
roomAlias() DEPRECATED. use room.alias() instead
'
)
return
this
.
alias
(
contact
)
}
/**
* Check if the room has member `contact`, the return is a Promise and must be `await`-ed
*
...
...
src/wechaty.ts
浏览文件 @
c0fc661c
...
...
@@ -101,9 +101,6 @@ export interface WechatyOptions {
memory
?
:
MemoryCard
,
name
?
:
string
,
// Wechaty Name
// @deprecated: use `name` instead of `profile`
profile
?
:
null
|
string
,
// DEPRECATED: use name instead
puppet
?
:
PuppetModuleName
|
Puppet
,
// Puppet name or instance
puppetOptions
?
:
PuppetOptions
,
// Puppet TOKEN
ioToken
?
:
string
,
// Io TOKEN
...
...
@@ -287,10 +284,6 @@ export class Wechaty extends WechatyEventEmitter implements Sayable {
super
()
log
.
verbose
(
'
Wechaty
'
,
'
constructor()
'
)
if
(
!
options
.
name
&&
options
.
profile
)
{
log
.
verbose
(
'
Wechaty
'
,
'
constructor() WechatyOptions.profile DEPRECATED. use WechatyOptions.name instead.
'
)
options
.
name
=
options
.
profile
}
this
.
memory
=
this
.
options
.
memory
this
.
id
=
cuid
()
...
...
@@ -838,17 +831,6 @@ export class Wechaty extends WechatyEventEmitter implements Sayable {
}
}
/**
* @description
* Should use {@link Wechaty#userSelf} instead
* @deprecated Use `userSelf()` instead
* @ignore
*/
public
self
():
Contact
{
log
.
warn
(
'
Wechaty
'
,
'
self() DEPRECATED. use userSelf() instead.
'
)
return
this
.
userSelf
()
}
/**
* Get current user
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录