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

doc: clean

上级 477ce858
此差异已折叠。
......@@ -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)
......
......@@ -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.')
......
......@@ -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)
......
......@@ -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.fromLocal('/tmp/text.jpg')
* const fileBox = FileBox.fromFile('/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.
先完成此消息的编辑!
想要评论请 注册