class LocationSelectEvent(SimpleEvent): __type__ = 'location_select_event' location_x = StringEntry('SendLocationInfo.Location_X') location_y = StringEntry('SendLocationInfo.Location_Y') scale = StringEntry('SendLocationInfo.Scale') label = StringEntry('SendLocationInfo.Label') poi_name = StringEntry('SendLocationInfo.Poiname')
class WeChatMessage(object): message_id = IntEntry('MsgId', 0) target = StringEntry('ToUserName') source = StringEntry('FromUserName') time = IntEntry('CreateTime', 0) def __init__(self, message): self.__dict__.update(message)
class LocationMessage(WeChatMessage): __type__ = 'location' location_x = FloatEntry('Location_X') location_y = FloatEntry('Location_Y') label = StringEntry('Label') scale = IntEntry('Scale') @property def location(self): return self.location_x, self.location_y
class VideoMessage(WeChatMessage): __type__ = ['video', 'shortvideo'] media_id = StringEntry('MediaId') thumb_media_id = StringEntry('ThumbMediaId')
class VoiceMessage(WeChatMessage): __type__ = 'voice' media_id = StringEntry('MediaId') format = StringEntry('Format') recognition = StringEntry('Recognition')
class LinkMessage(WeChatMessage): __type__ = 'link' title = StringEntry('Title') description = StringEntry('Description') url = StringEntry('Url')
class ImageMessage(WeChatMessage): __type__ = 'image' img = StringEntry('PicUrl')
class TextMessage(WeChatMessage): __type__ = 'text' content = StringEntry('Content')
class ScanCodeWaitMsgEvent(ScanCodePushEvent): __type__ = 'scancode_waitmsg_event' scan_type = StringEntry('ScanCodeInfo.ScanType') scan_result = StringEntry('ScanCodeInfo.ScanResult')
class ScanCodePushEvent(SimpleEvent): __type__ = 'scancode_push_event' scan_type = StringEntry('ScanCodeInfo.ScanType') scan_result = StringEntry('ScanCodeInfo.ScanResult')
class TicketEvent(WeChatEvent): key = StringEntry('EventKey') ticket = StringEntry('Ticket')
class SimpleEvent(WeChatEvent): key = StringEntry('EventKey')
class TemplateSendJobFinishEvent(WeChatEvent): __type__ = 'templatesendjobfinish_event' status = StringEntry('Status')