# Path: cogs/utils/deck_decoder.py
# def ParseDeck(strDeckCode):
# 	deckBytes = DecodeDeckString(strDeckCode)
# 	if not deckBytes:
# 		return False
# 	deck = ParseDeckInternal(strDeckCode, deckBytes)
# 	return deck
# 
# Path: cogs/utils/checks.py
# def is_owner_check(author):
# def is_owner():
# def is_admin_check(channel, ctx, user=None):
# def is_admin():
# def is_not_PM():
# 
# Path: cogs/utils/drawdota.py
# def get_item_color(item, default=None):
# def init_dota_info(hero_info, item_info, ability_info, the_vpkurl):
# def get_hero_name(hero_id):
# async def get_url_image(url):
# async def get_hero_image(hero_id):
# async def get_hero_icon(hero_id):
# async def get_hero_portrait(hero_id):
# async def get_item_image(item_id):
# async def get_level_image(level):
# async def get_ability_image(ability_id, hero_id=None):
# async def get_talents_image(abilities, hero_id):
# async def get_neutral_image(item):
# async def get_active_aghs_image(player):
# async def get_item_images(player):
# async def get_spell_images(spells):
# def get_lane(player):
# async def add_player_row(table, player, is_parsed, is_ability_draft, has_talents):
# 		def ad_ability_filter(ability_id):
# async def draw_match_table(match):
# async def create_match_image(match):
# async def combine_image_halves(img_url1, img_url2):
# def optimize_gif(uri, filename):
# def place_icon_on_map(map_image, icon, x, y):
# async def create_dota_gif(bot, match, stratz_match, start_time, end_time, ms_per_second=100):
# def create_dota_gif_main(match, stratz_match, start_time, end_time, ms_per_second, filename, uri, hero_icons):
# async def create_dota_emoticon(emoticon, url):
# async def dota_rank_icon(rank_tier, leaderboard_rank):
# def get_datetime_cell(match, region_data):
# async def draw_meta_table(sorted_heroes, heroes): 
# async def draw_matches_table(matches, game_strings):
# async def draw_hero_talents(hero):
# async def fuse_hero_images(hero1, hero2):
# async def draw_courage(hero_id, icon_ids):
# async def draw_artifact_deck(deck_string, cards, hero_turns, card_counts):
# def grouper(values, N):
# async def draw_neutralitems_tier(selected_tier, all_neutral_items):
# async def draw_neutralitems(selected_tier, all_neutral_items):
# def get_poly_points(n, radius, origin=(0, 0), radius_percentages=None):
# def draw_poly_label(draw, point, center, text):
# def draw_polygraph(values, labels):
# async def draw_herostatstable(table_args, hero_stat_categories, leveled_hero_stats):
# async def draw_itemrecipe(main_item, components, products):
# async def draw_heroabilities(abilities):
# async def add_player_ability_upgrades_row(table, player):
# async def draw_match_ability_upgrades(match):


import disnake
import random
import os
import re
import json
import logging
from disnake.ext import commands
from __main__ import settings, botdata, httpgetter
from cogs.utils.deck_decoder import ParseDeck
from cogs.utils.helpers import *
from cogs.utils.clip import *
from cogs.utils.card import *
from cogs.utils import checks
from cogs.utils import drawdota
from .mangocog import *
		else:
			embed.set_author(name=card.name)
		
		if card.large_image:
			embed.set_image(url=card.large_image)
		elif card.text:
			embed.description = card.text

		if card.references:
			descriptions = []
			for ref in card.references:
				ref_type = format_pascal_case(ref.ref_type.replace("_", " "))
				if ref.count:
					ref_type += f" (x{ref.count})"
				if ref.card.name == card.name:
					continue
				descriptions.append(f"{ref_type}: **{ref.card.name}**")
			if descriptions:
				embed.description = "\n".join(descriptions)

		embed.set_footer(text=f"Set: {card.set.name}")

		await ctx.send(embed=embed)

	@commands.command()
	async def deck(self, ctx, deck_string):
		"""Displays the card list for the given deck
		
		Example:
		`{cmdpfx}deck ADCJWkTZX05uwGDCRV4XQGy3QGLmqUBg4GQJgGLGgO7AaABR3JlZW4vQmxhY2sgRXhhbXBsZQ__`"""

# Path: cogs/utils/deck_decoder.py
# def ParseDeck(strDeckCode):
# 	deckBytes = DecodeDeckString(strDeckCode)
# 	if not deckBytes:
# 		return False
# 	deck = ParseDeckInternal(strDeckCode, deckBytes)
# 	return deck
# 
# Path: cogs/utils/checks.py
# def is_owner_check(author):
# def is_owner():
# def is_admin_check(channel, ctx, user=None):
# def is_admin():
# def is_not_PM():
# 
# Path: cogs/utils/drawdota.py
# def get_item_color(item, default=None):
# def init_dota_info(hero_info, item_info, ability_info, the_vpkurl):
# def get_hero_name(hero_id):
# async def get_url_image(url):
# async def get_hero_image(hero_id):
# async def get_hero_icon(hero_id):
# async def get_hero_portrait(hero_id):
# async def get_item_image(item_id):
# async def get_level_image(level):
# async def get_ability_image(ability_id, hero_id=None):
# async def get_talents_image(abilities, hero_id):
# async def get_neutral_image(item):
# async def get_active_aghs_image(player):
# async def get_item_images(player):
# async def get_spell_images(spells):
# def get_lane(player):
# async def add_player_row(table, player, is_parsed, is_ability_draft, has_talents):
# 		def ad_ability_filter(ability_id):
# async def draw_match_table(match):
# async def create_match_image(match):
# async def combine_image_halves(img_url1, img_url2):
# def optimize_gif(uri, filename):
# def place_icon_on_map(map_image, icon, x, y):
# async def create_dota_gif(bot, match, stratz_match, start_time, end_time, ms_per_second=100):
# def create_dota_gif_main(match, stratz_match, start_time, end_time, ms_per_second, filename, uri, hero_icons):
# async def create_dota_emoticon(emoticon, url):
# async def dota_rank_icon(rank_tier, leaderboard_rank):
# def get_datetime_cell(match, region_data):
# async def draw_meta_table(sorted_heroes, heroes): 
# async def draw_matches_table(matches, game_strings):
# async def draw_hero_talents(hero):
# async def fuse_hero_images(hero1, hero2):
# async def draw_courage(hero_id, icon_ids):
# async def draw_artifact_deck(deck_string, cards, hero_turns, card_counts):
# def grouper(values, N):
# async def draw_neutralitems_tier(selected_tier, all_neutral_items):
# async def draw_neutralitems(selected_tier, all_neutral_items):
# def get_poly_points(n, radius, origin=(0, 0), radius_percentages=None):
# def draw_poly_label(draw, point, center, text):
# def draw_polygraph(values, labels):
# async def draw_herostatstable(table_args, hero_stat_categories, leveled_hero_stats):
# async def draw_itemrecipe(main_item, components, products):
# async def draw_heroabilities(abilities):
# async def add_player_ability_upgrades_row(table, player):
# async def draw_match_ability_upgrades(match):


# Path: cogs/artifact.py
import disnake
import random
import os
import re
import json
import logging
from disnake.ext import commands
from __main__ import settings, botdata, httpgetter
from cogs.utils.deck_decoder import ParseDeck
from cogs.utils.helpers import *
from cogs.utils.clip import *
from cogs.utils.card import *
from cogs.utils import checks
from cogs.utils import drawdota
from .mangocog import *

		else:
			embed.set_author(name=card.name)
		
		if card.large_image:
			embed.set_image(url=card.large_image)
		elif card.text:
			embed.description = card.text

		if card.references:
			descriptions = []
			for ref in card.references:
				ref_type = format_pascal_case(ref.ref_type.replace("_", " "))
				if ref.count:
					ref_type += f" (x{ref.count})"
				if ref.card.name == card.name:
					continue
				descriptions.append(f"{ref_type}: **{ref.card.name}**")
			if descriptions:
				embed.description = "\n".join(descriptions)

		embed.set_footer(text=f"Set: {card.set.name}")

		await ctx.send(embed=embed)

	@commands.command()
	async def deck(self, ctx, deck_string):
		"""Displays the card list for the given deck
		
		Example:
		`{cmdpfx}deck ADCJWkTZX05uwGDCRV4XQGy3QGLmqUBg4GQJgGLGgO7AaABR3JlZW4vQmxhY2sgRXhhbXBsZQ__`"""

		deck_info = ParseDeck(deck_string)