示例#1
0
文件: pic.py 项目: loopdeer/pad-cogs
    def embed(state: PicViewState):
        url = MonsterImage.picture(state.monster)
        animated = state.monster.has_animation
        fields = [
            EmbedField(
                'Extra Links',
                Box(
                    Box(Text('Animation:'),
                        LinkedText('(MP4)', MonsterImage.video(state.monster)),
                        Text('|'),
                        LinkedText('(GIF)', MonsterImage.gif(state.monster)),
                        delimiter=' ') if animated else None,
                    Box(Text('Orb Skin:'),
                        LinkedText('Regular',
                                   MonsterImage.orb_skin(state.monster)),
                        Text('|'),
                        LinkedText(
                            'Color Blind',
                            MonsterImage.orb_skin_colorblind(state.monster)),
                        delimiter=' ') if state.monster.orb_skin_id else None,
                ))
        ]

        return EmbedView(
            EmbedMain(color=state.color,
                      title=MonsterHeader.long_v2(state.monster).to_markdown(),
                      url=puzzledragonx(state.monster)),
            embed_footer=pad_info_footer_with_state(state),
            embed_fields=fields,
            embed_body_image=EmbedBodyImage(url),
        )
示例#2
0
    def embed(cls, state: PicViewState):
        url = MonsterImage.picture(state.monster)
        animated = state.monster.has_animation
        fields = [
            EmbedField(
                'Extra Links',
                Box(
                    Box(Text('Animation:'),
                        LinkedText('(MP4)', MonsterImage.video(state.monster)),
                        Text('|'),
                        LinkedText('(GIF)', MonsterImage.gif(state.monster)),
                        delimiter=' ') if animated else None,
                    Box(Text('Orb Skin:'),
                        LinkedText('Regular',
                                   MonsterImage.orb_skin(state.monster)),
                        Text('|'),
                        LinkedText(
                            'Color Blind',
                            MonsterImage.orb_skin_colorblind(state.monster)),
                        delimiter=' ') if state.monster.orb_skin_id else None,
                )),
            cls.evos_embed_field(state)
        ]

        return EmbedView(
            EmbedMain(
                color=state.color,
                title=MonsterHeader.fmt_id_header(
                    state.monster,
                    state.alt_monsters[0].monster.monster_id == cls.TSUBAKI,
                    state.is_jp_buffed).to_markdown(),
                url=puzzledragonx(state.monster)),
            embed_footer=embed_footer_with_state(state),
            embed_fields=fields,
            embed_body_image=EmbedBodyImage(url),
        )