async def special(self, ctx, *, to_convert: str = ""): image = await ImageConverter().convert(ctx, to_convert) if image is None: raise NoImageFound('Please provide a valid image') img = await self.client.dagpi.special_image_process(image) await self.to_embed(ctx, img, "Dagpi Special Endpoint. Can change randomly")
async def _command(_self, ctx, *, to_convert: str = ""): source = await converter.convert(ctx, to_convert) if source is None: raise NoImageFound('Please provide a valid image') img = await self.client.dagpi.image_process(feature, source) await self.to_embed(ctx, img, feature.value.replace("/", ""))
async def convert(self, ctx, argument): with suppress(NoMemberFound): mem = await BetterMemberConverter().convert(ctx, argument) return (str(mem.avatar_url_as(static_format='png', size=1024))) with suppress(Exception): emoji = await emoji_converter.convert(ctx, str(argument)) return (str(emoji.url)) if ctx.message.attachments: with suppress(Exception): return ctx.message.attachments[0].url.replace(".webp", ".png") elif checkers.is_url(str(argument)): return str(argument) else: raise NoImageFound('')
async def convert(self, ctx, argument): with suppress(NoMemberFound): mem = await BetterMemberConverter().convert(ctx, argument) return (str(mem.avatar_url_as(static_format='png', size=1024))) with suppress(Exception): emoji = await emoji_converter.convert(ctx, str(argument)) return (str(emoji.url)) if ctx.message.attachments: with suppress(Exception): return ctx.message.attachments[0].url.replace(".webp", ".png") if checkers.is_url(str(argument)): return str(argument) if ctx.message.reference: with suppress(Exception): msg_ref = ctx.message.reference chan = ctx.bot.get_channel(msg_ref.channel_id) msg = await chan.fetch_message(msg_ref.message_id) return msg.attachments[0].url.replace(".webp", ".png") raise NoImageFound('')
async def _command(_self, ctx, *, source: converter = None): if converter == None: raise NoImageFound('') img = await self.client.dagpi.image_process(feature, source) await self.to_embed(ctx, img, feature.value.replace("/", ""))