friend-request.ts 705 字节
Newer Older
1
/**
2
 * Wechaty - Wechat for Bot. Connecting ChatBots
3 4 5 6 7 8 9 10 11 12
 *
 * Interface for puppet
 *
 * Class FriendRequest
 *
 * Licenst: ISC
 * https://github.com/wechaty/wechaty
 *
 */

Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
13 14 15 16
import {
    Config
  , log
}                   from './config'
17
import { Contact }  from './contact'
18

19
export abstract class FriendRequest {
20 21 22

  public contact: Contact
  public hello: string
23
  public type: 'send' | 'receive' | 'confirm'
24

25
  constructor() {
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
26 27
    log.verbose('FriendRequest', 'constructor()')

Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
28 29
    if (!Config.puppetInstance()) {
      throw new Error('no Config.puppetInstance() instanciated')
30 31 32
    }
  }

Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
33 34
  public abstract send(contact: Contact, hello: string): Promise<void>
  public abstract accept(): Promise<void>
35 36

}