I have my command formatted to display a leaderboard for highest leveled users, however it formats differently on pc than expected. Mobile works fine. For some reason, newlines start right after markdown (bold) ends. First screenshot (mobile) is what it should be, second screenshot is what it is on pc
#Markdown in CV2 causes weird formatting
1 messages · Page 1 of 1 (latest)
@leveling.command(name='leaderboard')
async def leaderboard(self, ctx: ApplicationContext):
leaderboard_rows = await LevelingRepository.get_leaderboard(guild_id=ctx.guild.id, limit=10, bot=self.bot)
if not leaderboard_rows:
await ctx.respond("No XP data found for this server.", ephemeral=True)
return
description_lines = []
for rank, row in enumerate(leaderboard_rows, start=1):
user = await self.bot.fetch_user(row.user_id)
level = LevelingMath.level_from_xp(experience=row.experience)
description_lines.append(f"**{rank}. {user.display_name}** – Level {level} ({row.experience} XP)")
message_content = chr(10).join(description_lines)
print(
"description_lines: ", description_lines,
"message_content: ", message_content
)
await ctx.respond(
view=BasicImageView(
description=message_content
)
)
import discord
class BasicImageView(discord.ui.DesignerView):
def __init__(self, description: str, avatar_url: str = None):
components = discord.ui.Container(
discord.ui.TextDisplay(description) if not avatar_url else
discord.ui.Section(
discord.ui.TextDisplay(description),
accessory=discord.ui.Thumbnail(url=avatar_url),
),
colour=discord.Colour.yellow()
)
super().__init__(components)
can you forward the message here
probably a client issue though
i vaguely recall a known issue about unnecessary line breaks in cv2, not sure if there's a timeline on fixing it
Hm, thats a shame. This is an eyesore to me
thanks in any case
allgood