How to use the wechaty-puppet.ContactGender.Unknown function in wechaty-puppet

To help you get started, we’ve selected a few wechaty-puppet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wechaty / wechaty / src / puppet-padchat / pure-function-helpers / contact-raw-payload-parser.spec.ts View on Github external
const EXPECTED_CONTACT_PAYLOAD_PERSONAL: ContactPayload = {
    id        : 'mengjunjun001',
    gender    : ContactGender.Female,
    type      : ContactType.Personal,
    alias     : '女儿',
    avatar    : 'http://wx.qlogo.cn/mmhead/ver_1/xfCMmibHH74xGLoyeDFJadrZXX3eOEznPefiaCa3iczxZGMwPtDuSbRQKx3Xdm18un303mf0NFia3USY2nO2VEYILw/0',
    city      : 'Haidian',
    name      : '梦君君',
    province  : 'Beijing',
    signature : 'Stay Foolish',
  }

  const EXPECTED_CONTACT_PAYLOAD_OFFICIAL: ContactPayload = {
    id        : 'gh_59d7c8ad720c',
    gender    : ContactGender.Unknown,
    type      : ContactType.Official,
    alias     : '',
    avatar    : 'http://wx.qlogo.cn/mmhead/ver_1/TR8EDh3MgMsu20pxjrDPBpaGySuEAGf3MUuoeUOV2LiaqvZxeMqb1U7hgiciaQZBC8LYN0boVLCKOIYg71pxdl1fQabiaxsn7CnNeGWVrK3jSIY/0',
    city      : 'Haidian',
    name      : '李卓桓',
    province  : 'Beijing',
    signature : 'CARPE DIEM+-+if+not+us,+who?+if+not+now,+when?',
  }

  const resultPersonal = contactRawPayloadParser(PADCHAT_CONTACT_PAYLOAD_PERSONAL)
  t.deepEqual(resultPersonal, EXPECTED_CONTACT_PAYLOAD_PERSONAL, 'should parse ContactPayload for personal account payload')

  const resultOfficial = contactRawPayloadParser(PADCHAT_CONTACT_PAYLOAD_OFFICIAL)
  t.deepEqual(resultOfficial, EXPECTED_CONTACT_PAYLOAD_OFFICIAL, 'should parse ContactPayload for official account payload')

  t.throws(() => contactRawPayloadParser({} as any), 'should throw exception for invalid object')
github wechaty / wechaty / src / puppet-padchat / pure-function-helpers / compatible-wei-bug.ts View on Github external
export function generateFakeSelfBot(contactId: string): PadchatContactPayload {
  return {
    big_head          : 'http://www.botorange.com',
    city              : 'Chatie',
    country           : 'BotOrange',
    intro             : '',
    label             : '',
    nick_name         : 'default padchat',
    provincia         : '',
    py_initial        : '',
    remark            : '',
    remark_py_initial : '',
    remark_quan_pin   : '',
    sex               : ContactGender.Unknown,
    signature         : 'welcome to BotOrange',
    small_head        : 'www.botorange.com',
    status            : 0,
    user_name         : contactId,
  }
}