(self, message)
return klass(message=message, **data)
:type message: wechatpy.messages.BaseMessage
:type message: wechatpy.messages.BaseMessage
: type message : wechatpy . messages . BaseMessage
def normal_reply(self, message):
        """
        :type message: wechatpy.messages.BaseMessage
        """
        if self.type == self.MsgType.NEWS:
            klass = replies.ArticlesReply
            media = self.app.materials.get(media_id=self.content["media_id"])
            # 将media_id转为content
            data = dict(
                articles=media.articles_json,
                media_id=self.content["media_id"]
            )
        elif self.type == self.MsgType.MUSIC:
            klass = replies.MusicReply
            data = dict(**self.content)
        elif self.type == self.MsgType.VIDEO:
            klass = replies.VideoReply
            data = dict(**self.content)
        elif self.type == self.MsgType.IMAGE:
            klass = replies.ImageReply
            data = dict(media_id=self.content["media_id"])
        elif self.type == self.MsgType.VOICE:
            klass = replies.VoiceReply
            data = dict(media_id=self.content["media_id"])
        else:
            klass = replies.TextReply
            data = dict(content=self.content["content"])
        return klass(message=message, **data)
def normal_reply ( self , message ) : if self . type == self . MsgType . NEWS : klass = replies . ArticlesReply media = self . app . materials . get ( media_id = self . content [ "media_id" ] ) # 将media_id转为content data = dict ( articles = media . articles_json , media_id = self . content [ "media_id" ] ) elif self . type == self . MsgType . MUSIC : klass = replies . MusicReply data = dict ( * * self . content ) elif self . type == self . MsgType . VIDEO : klass = replies . VideoReply data = dict ( * * self . content ) elif self . type == self . MsgType . IMAGE : klass = replies . ImageReply data = dict ( media_id = self . content [ "media_id" ] ) elif self . type == self . MsgType . VOICE : klass = replies . VoiceReply data = dict ( media_id = self . content [ "media_id" ] ) else : klass = replies . TextReply data = dict ( content = self . content [ "content" ] ) return klass ( message = message , * * data )