Skip to content

Commit

Permalink
fix: tracking, emojis
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicTheDev committed Mar 31, 2024
1 parent 67e358f commit c410955
Show file tree
Hide file tree
Showing 37 changed files with 869 additions and 673 deletions.
12 changes: 6 additions & 6 deletions archived/commands/CommandsOlder/Commands/WarCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,33 +76,33 @@ async def war_search(self, ctx: disnake.ApplicationCommandInteraction, clan:str,

disc = "<:map:944913638500761600>"
emoji = ''.join(filter(str.isdigit, disc))
emoji = self.bot.get_emoji(int(emoji))
emoji = self.bot.emoji_holder.all_emojis.get(int(emoji))
emoji = disnake.PartialEmoji(name=emoji.name, id=emoji.id)


troop = "<:troop:861797310224400434>"
troop = ''.join(filter(str.isdigit, troop))
troop = self.bot.get_emoji(int(troop))
troop = self.bot.emoji_holder.all_emojis.get(int(troop))
troop = disnake.PartialEmoji(name=troop.name, id=troop.id)

swords = "<a:swords:944894455633297418>"
swords = ''.join(filter(str.isdigit, swords))
swords = self.bot.get_emoji(int(swords))
swords = self.bot.emoji_holder.all_emojis.get(int(swords))
swords = disnake.PartialEmoji(name=swords.name, id=swords.id, animated=True)

shield = "<:clash:877681427129458739>"
shield = ''.join(filter(str.isdigit, shield))
shield = self.bot.get_emoji(int(shield))
shield = self.bot.emoji_holder.all_emojis.get(int(shield))
shield = disnake.PartialEmoji(name=shield.name, id=shield.id)

magnify = "<:magnify:944914253171810384>"
magnify = ''.join(filter(str.isdigit, magnify))
magnify = self.bot.get_emoji(int(magnify))
magnify = self.bot.emoji_holder.all_emojis.get(int(magnify))
magnify = disnake.PartialEmoji(name=magnify.name, id=magnify.id)

surr = "<:surrender:947978096034869249>"
surr = ''.join(filter(str.isdigit, surr))
surr = self.bot.get_emoji(int(surr))
surr = self.bot.emoji_holder.all_emojis.get(int(surr))
surr = disnake.PartialEmoji(name=surr.name, id=surr.id)

embed = await main_war_page(bot=self.bot, war=war, war_league=str(clan.war_league))
Expand Down
9 changes: 4 additions & 5 deletions archived/commands/CommandsOlder/Utils/Player.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from utility.clash.other import *
from utility.general import acronym, create_superscript
from utility.discord_utils import interaction_handler
from typing import TYPE_CHECKING
from classes.bot import CustomClient
from classes.player import MyCustomPlayer
from numerize import numerize
Expand Down Expand Up @@ -55,7 +54,7 @@ async def create_profile_stats(bot: CustomClient, ctx, player: MyCustomPlayer):
f"[Clash Of Stats Profile](https://www.clashofstats.com/players/{player.tag.strip('#')})\n\n" \
f"**Season Stats:**\n" \
f"__Attacks__\n" \
f"- {league_emoji(player)}Trophies: {player.trophies}\n" \
f"- {fetch_emoji(player.league.name)}Trophies: {player.trophies}\n" \
f"- {bot.emoji.thick_sword}Attack Wins: {player.attack_wins}\n" \
f"- {bot.emoji.brown_shield}Defense Wins: {player.defense_wins}\n" \
f"{loot_text}" \
Expand All @@ -64,9 +63,9 @@ async def create_profile_stats(bot: CustomClient, ctx, player: MyCustomPlayer):
f"- {bot.emoji.avg_stars}Avg Stars: `{round(hitrate.average_stars, 2)}`\n" \
f"- {bot.emoji.war_stars}Total Stars: `{hitrate.total_stars}, {hitrate.num_attacks} atks`\n" \
f"__Donations__\n" \
f"- <:warwon:932212939899949176>Donated: {player.donos().donated}\n" \
f"- <:warlost:932212154164183081>Received: {player.donos().received}\n" \
f"- <:winrate:932212939908337705>Donation Ratio: {player.donation_ratio()}\n" \
f"- {bot.emoji.up_green_arrow}Donated: {player.donos().donated}\n" \
f"- {bot.emoji.down_red_arrow}Received: {player.donos().received}\n" \
f"- {bot.emoji.ratio}Donation Ratio: {player.donation_ratio()}\n" \
f"__Event Stats__\n" \
f"- {bot.emoji.capital_gold}CG Donated: {'{:,}'.format(sum([sum(cap.donated) for cap in capital_stats]))}\n" \
f"- {bot.emoji.thick_sword}CG Raided: {'{:,}'.format(sum([sum(cap.raided) for cap in capital_stats]))}\n" \
Expand Down
242 changes: 163 additions & 79 deletions assets/emojiDictionary.py → assets/emojis.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
switcher = {
"Barbarian King": "<:BarbarianKing:1125780508190720041>",
"Archer Queen": "<:ArcherQueen:1125780510485004399>",
"Grand Warden": "<:GrandWarden:1125780512699592725>",
"Royal Champion": "<:RoyalChampion:1125780514486353983>",
"Battle Copter": "<:battle_copter:1109716293696888852>",
"Electrofire Wizard": "<:electro_wiz:1109716130735587358>",
"Archer": "<:Archer:1125780518433206302>",
"Baby Dragon": "<:BabyDragon:1125780520991731723>",
"Barbarian": "<:Barbarian:1125780523495731271>",
"Bowler": "<:Bowler:1125780525102149723>",
"Electro Dragon": "<:ElectroDragon:1125780527052505128>",
"Dragon": "<:Dragon:1125780530445693059>",
"Dragon Rider": "<:dragon_rider:1125780532840644669>",
"Balloon": "<:Balloon:1125780535801806858>",
"Ice Golem": "<:IceGolem:1125780538955939920>",
"Miner": "<:Miner:1125780541090840586>",
"Hog Rider": "<:HogRider:1125780543473205318>",
"Yeti": "<:Yeti:1125780545981403226>",
"Wizard": "<:Wizard:1125780548154040361>",
"Healer": "<:Healer:1125780550569951453>",
"Giant": "<:Giant:1125780552419659806>",
"Goblin": "<:Goblin:1125780554537762897>",
"Witch": "<:Witch:1125780557029187594>",
"Minion": "<:Minion:1125780559830986752>",
"P.E.K.K.A": "<:PEKKA:1125780562586640464>",
"Wall Breaker": "<:WallBreaker:1125780564667011144>",
"Golem": "<:Golem:1125780566508314624>",
"Lava Hound": "<:LavaHound:1125780568559333376>",
"Valkyrie": "<:Valkyrie:1125780570601947178>",
"Headhunter": "<:Headhunter:1125780573588299896>",
townhall_emojis = {
1: "<:02:1125807195456536677>",
2: "<:02:1125807195456536677>",
3: "<:03:1125807197415288923>",
4: "<:04:1125807199495667743>",
5: "<:05:1125807201752195153>",
6: "<:06:1125807203803213954>",
7: "<:07:1125807205757751397>",
8: "<:08:1125810709406679081>",
9: "<:09:1125810712078454854>",
10: "<:10:1125810714179817604>",
11: "<:11:1125810716608303244>",
12: "<:12:1125810719259115631>",
13: "<:132:1125810721490473091>",
14: "<:14:1125810723822506015>",
15: "<:th15_big:1029215029486157855>",
16: "<:16:1183533663367987252>"
}

super_troop_emojis = {
"Super Wall Breaker": "<:SuperWallBreaker:1125780575945494579>",
"Super Barbarian": "<:SuperBarbarian:1125780578139111516>",
"Super Archer": "<:SuperArcher:1125780580462759987>",
Expand All @@ -44,57 +33,23 @@
"Ice Hound": "<:IceHound:1125780609290227722>",
"Super Dragon": "<:SuperDragon:1125780611240579105>",
"Super Bowler": "<:SuperBowler:1125780613174136852>",
"Super Hog Rider": "<:SHogRider:1120604618100060180>",
}

pet_emojis = {
"Unicorn": "<:Unicorn:1125780616395378808>",
"Mighty Yak": "<:MightyYak:1125780619079729282>",
"Electro Owl": "<:ElectroOwl:1125780621474660383>",
"L.A.S.S.I": "<:LASSI:1125780623605387344>",
"trophy": "<:trophyy:1125780625778016277>",
"Wall Wrecker": "<:WallWrecker:1125780628328153129>",
"Battle Blimp": "<:BattleBlimp:1125780630463057991>",
"Stone Slammer": "<:StoneSlammer:1125780633055133706>",
"Siege Barracks": "<:SiegeBarracks:1125795608788226109>",
"Log Launcher": "<:LogLauncher:1125795611925549097>",
"Flame Flinger": "<:FlameFlinger:1125795614261776484>",
"Skeleton Spell": "<:skel:1125795616698667051>",
"Rage Spell": "<:rs:1125795619831812096>",
"Poison Spell": "<:ps:1125795621895405598>",
"Healing Spell": "<:hs:1125795624319717426>",
"Invisibility Spell": "<:invi:1125795629516476518>",
"Jump Spell": "<:js:1125795631936573450>",
"Lightning Spell": "<:ls:1125795633907904512>",
"Haste Spell": "<:haste:1125795636181213325>",
"Freeze Spell": "<:fs:1125795638907502602>",
"Earthquake Spell": "<:es:1125795641654788256>",
"Bat Spell": "<:bat:1125795643689025606>",
"Clone Spell": "<:cs:1125795645958144162>",
"clan castle": "<:clan_castle:1125795648462147594>",
"shield": "<:clash:1125795651280699392>",
"Electro Titan": "<:ElectroTitan:1029213693021519963>",
"Battle Drill": "<:BattleDrill:1029199490038628442>",
"Recall Spell": "<:recall:1029199491385012304>",
"Frosty": "<:Frosty:1029199487849201785>",
"Poison Lizard": "<:PoisonLizard:1029199485450068029>",
"Phoenix": "<:Phoenix:1029199486347661343>",
"Diggy": "<:Diggy:1029199488906170428>",
"Root Rider": "<:RootRider:1183561929864794222>",
"Spirit Fox": "<:PhaseFennec:1183561928438718494>",
1: "<:02:1125807195456536677>",
2: "<:02:1125807195456536677>",
3: "<:03:1125807197415288923>",
4: "<:04:1125807199495667743>",
5: "<:05:1125807201752195153>",
6: "<:06:1125807203803213954>",
7: "<:07:1125807205757751397>",
8: "<:08:1125810709406679081>",
9: "<:09:1125810712078454854>",
10: "<:10:1125810714179817604>",
11: "<:11:1125810716608303244>",
12: "<:12:1125810719259115631>",
13: "<:132:1125810721490473091>",
14: "<:14:1125810723822506015>",
15: "<:th15_big:1029215029486157855>",
16: "<:16:1183533663367987252>",
}

hero_equipment_emojis = {
"Barbarian Puppet": "<:BarbDoll:1183561776642662420>",
"Rage Vial": "<:RageVial:1183561869282258984>",
"Archer Puppet": "<:ArcherDoll:1183561721445625937>",
Expand All @@ -111,8 +66,9 @@
"Rage Gem": "<:RageGem:1183561924064051343>",
"Healing Tome": "<:HeartTome:1183561922319229009>",
"Freeze Arrow": "<:FreezeArrow:1183561723500834846>",
}

"Capital Gold": "<:capitalgold:1125795653696626860>",
capital_hall_emojis = {
"Capital_Hall7": "<:CH7:1125795655646986291>",
"District_Hall4": "<:DH4:1125795658629128213>",
"District_Hall5": "<:DH5:1125795660650786906>",
Expand All @@ -128,6 +84,9 @@
"Capital_Hall3": "<:CH3:1125795684176633878>",
"Capital_Hall2": "<:CH2:1125795686139576340>",
"Capital_Hall1": "<:CH1:1125795688802951270>",
}

builder_base_emojis = {
"Bomber": "<:Bomber:1125800091161202750>",
"Hog Glider": "<:HogGlider:1125799777020424223>",
"Cannon Cart": "<:CannonCart:1125800093753298985>",
Expand All @@ -139,21 +98,78 @@
"Night Witch": "<:NightWitch:1125800110111076454>",
"Sneaky Archer": "<:SneakyArcher:1125800112480854156>",
"Battle Machine": "<:bm:1041499330240053352>",
"Super Hog Rider": "<:SHogRider:1120604618100060180>",
"Apprentice Warden": "<:Apprentice:1120604620713107507>"
"Battle Copter": "<:battle_copter:1109716293696888852>",
"Electrofire Wizard": "<:electro_wiz:1109716130735587358>",
}

def emojiDictionary(emojiName):
return switcher.get(emojiName)
siege_machine_emojis = {
"Wall Wrecker": "<:WallWrecker:1125780628328153129>",
"Battle Blimp": "<:BattleBlimp:1125780630463057991>",
"Stone Slammer": "<:StoneSlammer:1125780633055133706>",
"Siege Barracks": "<:SiegeBarracks:1125795608788226109>",
"Log Launcher": "<:LogLauncher:1125795611925549097>",
"Flame Flinger": "<:FlameFlinger:1125795614261776484>",
"Battle Drill": "<:BattleDrill:1029199490038628442>",
}

spell_emojis = {
"Skeleton Spell": "<:skel:1125795616698667051>",
"Rage Spell": "<:rs:1125795619831812096>",
"Poison Spell": "<:ps:1125795621895405598>",
"Healing Spell": "<:hs:1125795624319717426>",
"Invisibility Spell": "<:invi:1125795629516476518>",
"Jump Spell": "<:js:1125795631936573450>",
"Lightning Spell": "<:ls:1125795633907904512>",
"Haste Spell": "<:haste:1125795636181213325>",
"Freeze Spell": "<:fs:1125795638907502602>",
"Earthquake Spell": "<:es:1125795641654788256>",
"Bat Spell": "<:bat:1125795643689025606>",
"Clone Spell": "<:cs:1125795645958144162>",
"Recall Spell": "<:recall:1029199491385012304>",
}

troop_emojis = {
"Archer": "<:Archer:1125780518433206302>",
"Baby Dragon": "<:BabyDragon:1125780520991731723>",
"Barbarian": "<:Barbarian:1125780523495731271>",
"Bowler": "<:Bowler:1125780525102149723>",
"Electro Dragon": "<:ElectroDragon:1125780527052505128>",
"Dragon": "<:Dragon:1125780530445693059>",
"Dragon Rider": "<:dragon_rider:1125780532840644669>",
"Balloon": "<:Balloon:1125780535801806858>",
"Ice Golem": "<:IceGolem:1125780538955939920>",
"Miner": "<:Miner:1125780541090840586>",
"Hog Rider": "<:HogRider:1125780543473205318>",
"Yeti": "<:Yeti:1125780545981403226>",
"Wizard": "<:Wizard:1125780548154040361>",
"Healer": "<:Healer:1125780550569951453>",
"Giant": "<:Giant:1125780552419659806>",
"Goblin": "<:Goblin:1125780554537762897>",
"Witch": "<:Witch:1125780557029187594>",
"Minion": "<:Minion:1125780559830986752>",
"P.E.K.K.A": "<:PEKKA:1125780562586640464>",
"Wall Breaker": "<:WallBreaker:1125780564667011144>",
"Golem": "<:Golem:1125780566508314624>",
"Lava Hound": "<:LavaHound:1125780568559333376>",
"Valkyrie": "<:Valkyrie:1125780570601947178>",
"Headhunter": "<:Headhunter:1125780573588299896>",
"Electro Titan": "<:ElectroTitan:1029213693021519963>",
"Apprentice Warden": "<:Apprentice:1120604620713107507>"
}

hero_emojis = {
"Barbarian King": "<:BarbarianKing:1125780508190720041>",
"Archer Queen": "<:ArcherQueen:1125780510485004399>",
"Grand Warden": "<:GrandWarden:1125780512699592725>",
"Royal Champion": "<:RoyalChampion:1125780514486353983>",
}


emoji_class_dict = {
icon_emojis = {
"trophy": "<:trophyy:1125780625778016277>",
"discord": "<:discord:840749695466864650>",
"clan_castle": "<:clan_castle:855688168816377857>",
"shield": "<:sh:948845842809360424>",
"trophy": "<:trophyy:849144172698402817>",
"capital_gold": "<:capitalgold:987861320286216223>",
"legends_shield": "<:legends:881450752109850635>",
"sword": "<:cw:948845649229647952>",
Expand Down Expand Up @@ -224,9 +240,77 @@ def emojiDictionary(emojiName):
"globe": "<:globe:1113285560715444274>",
"wood_swords": "<:wood_swords:1109716092647112787>",
"red_pin": "<:redpin:1130343263698690128>",
"wbb_red": "<a:wbb_red:1135329514579312640>",
"spells": "<:spells:1184426093353127966>",
"heart": "<:heart:1184426691704135701>",
"pet_paw": "<:pet:1184426579149987852>"
}

league_emojis = {
"Bronze League I": "<:BronzeLeagueI:601611950228635648>",
"Bronze League II": "<:BronzeLeagueII:601611942850986014>",
"Bronze League III": "<:BronzeLeagueIII:601611929311510528>",
"Champion League I": "<:ChampionLeagueI:601612124447440912>",
"Champion League II": "<:ChampionLeagueII:601612113345249290>",
"Champion League III": "<:ChampionLeagueIII:601612099226959892>",
"Crystal League I": "<:CrystalLeagueI:601612045359775746>",
"Crystal League II": "<:CrystalLeagueII:601612033976434698>",
"Crystal League III": "<:CrystalLeagueIII:601612021472952330>",
"Gold League I": "<:GoldLeagueI:601612010492526592>",
"Gold League II": "<:GoldLeagueII:601611996290613249>",
"Gold League III": "<:GoldLeagueIII:601611988992262144>",
"Legend League": "<:LegendLeague:601612163169255436>",
"Master League I": "<:MasterLeagueI:601612085327036436>",
"Master League II": "<:MasterLeagueII:601612075474616399>",
"Master League III": "<:MasterLeagueIII:601612064913621002>",
"Silver League I": "<:SilverLeagueI:601611974849331222>",
"Silver League II": "<:SilverLeagueII:601611965550428160>",
"Silver League III": "<:SilverLeagueIII:601611958067920906>",
"Titan League I": "<:TitanLeagueI:601612159327141888>",
"Titan League II": "<:TitanLeagueII:601612148325744640>",
"Titan League III": "<:TitanLeagueIII:601612137491726374>",
}

builder_league_emojis = {
"Wood": "<:wood_league:1109716152709566524>",
"Clay": "<:clay_league:1109716160561291274>",
"Stone": "<:stone_league:1109716159126843403>",
"Copper": "<:copper_league:1109716157440720966>",
"Brass": "<:brass_league:1109716155876249620>",
"Iron": "<:iron_league:1109716154257264670>",
"Steel": "<:steel_league:1109716168375279616>",
"Titanium": "<:titanium_league:1109716170208198686>",
"Platinum": "<:platinum_league:1109716172330512384>",
"Emerald": "<:emerald_league:1109716179121094707>",
"Ruby": "<:ruby_league:1109716183269265501>",
"Diamond": "<:diamond_league:1109716180983369768>"
}

cwl_league_emojis = {
"CWL Bronze League I": "<:WarBronzeI:1116151829617705000>",
"CWL Bronze League II": "<:WarBronzeII:1116151836035006464>",
"CWL Bronze League III": "<:WarBronzeIII:1116151838136356895>",
"CWL Silver League I": "<:WarSilverI:1116151826870456420>",
"CWL Silver League II": "<:WarSilverII:1116151831542907011>",
"CWL Silver League III": "<:WarSilverIII:1116151833891704953>",
"CWL Gold League I": "<:WarGoldI:1116151792904966154>",
"CWL Gold League II": "<:WarGoldII:1116151794721103912>",
"CWL Gold League III": "<:WarGoldIII:1116151824471293954>",
"CWL Crystal League I": "<:WarCrystalI:1116151785476866109>",
"CWL Crystal League II": "<:WarCrystalII:1116151788895211682>",
"CWL Crystal League III": "<:WarCrystalIII:1116151790946230312>",
"CWL Master League I": "<:WarMasterI:1116151777813868596>",
"CWL Master League II": "<:WarMasterII:1116151780074598421>",
"CWL Master League III": "<:WarMasterIII:1116151784059191347>",
"CWL Champion League I": "<:WarChampionI:1116151613795598407>",
"CWL Champion League II": "<:WarChampionII:1116151615506894858>",
"CWL Champion League III": "<:WarChampionIII:1116151617922809947>"
}



class SharedEmojis:
all_emojis = (townhall_emojis | super_troop_emojis | pet_emojis | hero_equipment_emojis | capital_hall_emojis |
league_emojis | cwl_league_emojis | builder_league_emojis |
builder_base_emojis | siege_machine_emojis | spell_emojis | troop_emojis | hero_emojis | icon_emojis)


2 changes: 1 addition & 1 deletion background/logs/auto_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import TYPE_CHECKING
from classes.bot import CustomClient
from background.logs.events import clan_ee
from Link_and_Eval.eval_logic import eval_logic
from commands.eval.utils import logic


class AutoEval(commands.Cog):
Expand Down
3 changes: 1 addition & 2 deletions background/logs/ban_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ async def ban_alerts(self, event):
date = results.get("DateCreated")[:10]

role = f"<@&{db_clan.member_role}>"

embed = disnake.Embed(
description=f"[WARNING! BANNED PLAYER {member.name} JOINED]({member.share_link})",
description=f"{role}\n[WARNING! BANNED PLAYER {member.name} JOINED]({member.share_link})",
color=disnake.Color.green())
embed.add_field(name="Banned Player.",
value=f"Player {member.name} [{member.tag}] has joined {clan.name} and is on the {server.name} BAN list!\n\n"
Expand Down
Loading

0 comments on commit c410955

Please sign in to comment.