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

deprecated profile, use name

上级 587e9379
......@@ -57,7 +57,7 @@ log.info('Client', 'Starting for WECHATY_TOKEN: %s', token)
const client = new IoClient({
token,
wechaty: new Wechaty({ profile: token }),
wechaty: new Wechaty({ name: token }),
})
client.start()
......
......@@ -32,7 +32,7 @@ import { generate } from 'qrcode-terminal'
*
*/
const bot = new Wechaty({
profile : config.default.DEFAULT_PROFILE,
name : config.default.DEFAULT_PROFILE,
})
/**
......
......@@ -97,7 +97,8 @@ export type WechatyEventName = keyof typeof WECHATY_EVENT_DICT
export interface WechatyOptions {
memory? : MemoryCard,
profile? : null | string, // Wechaty Name
name? : null | string, // Wechaty Name
profile? : null | string, // DEPRECATED: use name instead
puppet? : PuppetName | Puppet, // Puppet name or instance
puppetOptions? : PuppetOptions, // Puppet TOKEN
ioToken? : string, // Io TOKEN
......@@ -231,17 +232,22 @@ export class Wechaty extends Accessory implements Sayable {
super()
log.verbose('Wechaty', 'contructor()')
options.profile = options.profile === null
? null
: (options.profile || config.default.DEFAULT_PROFILE)
if (!options.name && options.profile) {
log.verbose('Wechaty', 'constuctor() WechatyOptions.profile DEPRECATED. use WechatyOptions.name instead.')
options.name = options.profile
}
options.name = options.name === null
? null
: (options.name || config.default.DEFAULT_PROFILE)
this.id = cuid()
this.id = cuid()
this.memory = options.memory
? options.memory
: new MemoryCard(
options.profile
? { name: options.profile }
options.name
? { name: options.name }
: undefined,
)
......@@ -776,7 +782,7 @@ export class Wechaty extends Accessory implements Sayable {
this.version(),
)
log.verbose('Wechaty', 'puppet: %s' , this.options.puppet)
log.verbose('Wechaty', 'profile: %s' , this.options.profile)
log.verbose('Wechaty', 'profile: %s' , this.options.name)
log.verbose('Wechaty', 'id: %s' , this.id)
if (this.state.on()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册