Skip to content

Commit

Permalink
Update style.py
Browse files Browse the repository at this point in the history
- Fix issue: In embeds.0.title: Must be 256 or fewer in length.
  • Loading branch information
BattlefieldDuck committed Nov 1, 2023
1 parent 1816539 commit 6af8de7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions discordgsm/styles/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def embed(self) -> Embed:

def embed_data(self):
title = (self.server.result['password'] and '🔒 ' or '') + self.server.result['name']

if len(title) > 256:
title = title[:256][:-3] + '...'

description = str(self.server.style_data.get('description', '')).strip()
description = description if description else None
color = Color.from_rgb(88, 101, 242) if self.server.status else Color.from_rgb(32, 34, 37)
Expand Down

0 comments on commit 6af8de7

Please sign in to comment.