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

change(sleep): Wechaty.sleep() is a static method now.

上级 aab23c3c
# #
# Wechaty Docker # Wechaty Docker
# https://github.com/wechaty/wechaty # https://github.com/chatie/wechaty
# #
# FROM alpine # FROM alpine
# #
......
...@@ -186,6 +186,11 @@ export class Message implements Sayable { ...@@ -186,6 +186,11 @@ export class Message implements Sayable {
public static counter = 0 public static counter = 0
public _counter: number public _counter: number
/**
* a map for:
* 1. name to id
* 2. id to name
*/
public static TYPE: MsgTypeMap = { public static TYPE: MsgTypeMap = {
TEXT: 1, TEXT: 1,
IMAGE: 3, IMAGE: 3,
......
...@@ -447,8 +447,10 @@ export class Wechaty extends EventEmitter implements Sayable { ...@@ -447,8 +447,10 @@ export class Wechaty extends EventEmitter implements Sayable {
/** /**
* @todo document me * @todo document me
* @static
*
*/ */
public async sleep(millisecond: number): Promise<void> { public static async sleep(millisecond: number): Promise<void> {
await new Promise(resolve => { await new Promise(resolve => {
setTimeout(resolve, millisecond) setTimeout(resolve, millisecond)
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册