提交 c0de011f 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

fix(user): replace user() by self() for its deprecated

上级 4c9289f0
......@@ -298,7 +298,7 @@ function checkRoomJoin(room: Room, inviteeList: Contact[], inviter: Contact) {
try {
// let to, content
const user = bot.user()
const user = bot.self()
if (!user) {
throw new Error('no user')
}
......
......@@ -709,8 +709,8 @@ export class Contact implements Sayable {
const content = textOrMedia instanceof MediaMessage ? textOrMedia.filename() : textOrMedia
log.verbose('Contact', 'say(%s)', content)
const wechaty = Wechaty.instance()
const user = wechaty.user()
const bot = Wechaty.instance()
const user = bot.self()
if (!user) {
throw new Error('no user')
......@@ -728,7 +728,7 @@ export class Contact implements Sayable {
m.to(this)
log.silly('Contact', 'say() from: %s to: %s content: %s', user.name(), this.name(), content)
return await wechaty.send(m)
return await bot.send(m)
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册