Skip to content

fix: bundles #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions utils/valorant/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,12 @@ def fill_items(self, force: bool = False) -> None:
self.add_item(self.back_button)
self.add_item(self.next_button)

def base_embed(self, title: str, description: str, icon: str, color: int = 0x0F1923) -> discord.Embed:
def base_embed(self, title: str, description: str, icon: str|None, color: int = 0x0F1923) -> discord.Embed:
"""Base embed for the view"""

embed = discord.Embed(title=title, description=description, color=color)
embed.set_thumbnail(url=icon)
if icon:
embed.set_thumbnail(url=icon)
return embed

def build_embeds(self, selected_bundle: int = 1) -> None:
Expand Down Expand Up @@ -362,7 +363,10 @@ def build_featured_bundle(self, bundle: list[dict]) -> list[discord.Embed]:
item = GetItems.get_item_by_type(items['type'], items['uuid'])
item_type = get_item_type(items['type'])
emoji = GetEmoji.tier_by_bot(items['uuid'], self.bot) if item_type == 'Skins' else ''
icon = item['icon'] if item_type != 'Player Cards' else item['icon']['large']
if item_type == 'Player titles':
icon = None
else:
icon = item['icon'] if item_type != 'Player Cards' else item['icon']['large'] if item['icon']['large'] else item['icon']['small']
color = 0xFD4554 if item_type == 'Skins' else 0x0F1923

item_price = items['price']
Expand Down