diff --git a/Pipfile b/Pipfile index 848c39b..2e4509e 100644 --- a/Pipfile +++ b/Pipfile @@ -9,6 +9,7 @@ mysql-connector-python = "*" python-dotenv = "*" python-dateutil = "*" requests = "*" +inflect = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 6e914df..926c599 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "e8901c6ac2ac9d2f71cc6b01bc7ce87bf5e1fd8d846bfbbee998f20f502b297c" + "sha256": "c57fd32d91e5ec82ed0d9ee1e3553518e7660e12aa52357fdc810ec972182357" }, "pipfile-spec": 6, "requires": { @@ -117,6 +117,14 @@ "markers": "python_version >= '3.7'", "version": "==1.3.1" }, + "annotated-types": { + "hashes": [ + "sha256:47cdc3490d9ac1506ce92c7aaa76c579dc3509ff11e098fc867e5130ab7be802", + "sha256:58da39888f92c276ad970249761ebea80ba544b77acddaa1a4d6cf78287d45fd" + ], + "markers": "python_version >= '3.7'", + "version": "==0.5.0" + }, "async-timeout": { "hashes": [ "sha256:2163e1640ddb52b7a8c80d0a67a08587e5d245cc9c553a74a847056bc2976b15", @@ -305,6 +313,14 @@ "markers": "python_version >= '3.5'", "version": "==3.4" }, + "inflect": { + "hashes": [ + "sha256:63da9325ad29da81ec23e055b41225795ab793b4ecb483be5dc1fa363fd4717e", + "sha256:9544afed6182176e43955c44b1acdaed30f9b2b56c16d1fc5b222d98218b546e" + ], + "index": "pypi", + "version": "==7.0.0" + }, "multidict": { "hashes": [ "sha256:01a3a55bd90018c9c080fbb0b9f4891db37d148a0a18722b42f94694f8b6d4c9", @@ -432,6 +448,121 @@ "markers": "python_version >= '3.7'", "version": "==4.21.12" }, + "pydantic": { + "hashes": [ + "sha256:22d63db5ce4831afd16e7c58b3192d3faf8f79154980d9397d9867254310ba4b", + "sha256:43bdbf359d6304c57afda15c2b95797295b702948082d4c23851ce752f21da70" + ], + "markers": "python_version >= '3.7'", + "version": "==2.1.1" + }, + "pydantic-core": { + "hashes": [ + "sha256:01947ad728f426fa07fcb26457ebf90ce29320259938414bc0edd1476e75addb", + "sha256:0455876d575a35defc4da7e0a199596d6c773e20d3d42fa1fc29f6aa640369ed", + "sha256:047580388644c473b934d27849f8ed8dbe45df0adb72104e78b543e13bf69762", + "sha256:04922fea7b13cd480586fa106345fe06e43220b8327358873c22d8dfa7a711c7", + "sha256:08f89697625e453421401c7f661b9d1eb4c9e4c0a12fd256eeb55b06994ac6af", + "sha256:0a507d7fa44688bbac76af6521e488b3da93de155b9cba6f2c9b7833ce243d59", + "sha256:0d726108c1c0380b88b6dd4db559f0280e0ceda9e077f46ff90bc85cd4d03e77", + "sha256:12ef6838245569fd60a179fade81ca4b90ae2fa0ef355d616f519f7bb27582db", + "sha256:153a61ac4030fa019b70b31fb7986461119230d3ba0ab661c757cfea652f4332", + "sha256:16468bd074fa4567592d3255bf25528ed41e6b616d69bf07096bdb5b66f947d1", + "sha256:17156abac20a9feed10feec867fddd91a80819a485b0107fe61f09f2117fe5f3", + "sha256:1927f0e15d190f11f0b8344373731e28fd774c6d676d8a6cfadc95c77214a48b", + "sha256:1e8a7c62d15a5c4b307271e4252d76ebb981d6251c6ecea4daf203ef0179ea4f", + "sha256:2ad538b7e07343001934417cdc8584623b4d8823c5b8b258e75ec8d327cec969", + "sha256:2ca4687dd996bde7f3c420def450797feeb20dcee2b9687023e3323c73fc14a2", + "sha256:2edef05b63d82568b877002dc4cb5cc18f8929b59077120192df1e03e0c633f8", + "sha256:2f9ea0355f90db2a76af530245fa42f04d98f752a1236ed7c6809ec484560d5b", + "sha256:30527d173e826f2f7651f91c821e337073df1555e3b5a0b7b1e2c39e26e50678", + "sha256:32a1e0352558cd7ccc014ffe818c7d87b15ec6145875e2cc5fa4bb7351a1033d", + "sha256:3534118289e33130ed3f1cc487002e8d09b9f359be48b02e9cd3de58ce58fba9", + "sha256:36ba9e728588588f0196deaf6751b9222492331b5552f865a8ff120869d372e0", + "sha256:382f0baa044d674ad59455a5eff83d7965572b745cc72df35c52c2ce8c731d37", + "sha256:394f12a2671ff8c4dfa2e85be6c08be0651ad85bc1e6aa9c77c21671baaf28cd", + "sha256:3ba2c9c94a9176f6321a879c8b864d7c5b12d34f549a4c216c72ce213d7d953c", + "sha256:3ded19dcaefe2f6706d81e0db787b59095f4ad0fbadce1edffdf092294c8a23f", + "sha256:3fcf529382b282a30b466bd7af05be28e22aa620e016135ac414f14e1ee6b9e1", + "sha256:43a405ce520b45941df9ff55d0cd09762017756a7b413bbad3a6e8178e64a2c2", + "sha256:453862ab268f6326b01f067ed89cb3a527d34dc46f6f4eeec46a15bbc706d0da", + "sha256:4665f7ed345012a8d2eddf4203ef145f5f56a291d010382d235b94e91813f88a", + "sha256:478f5f6d7e32bd4a04d102160efb2d389432ecf095fe87c555c0a6fc4adfc1a4", + "sha256:49db206eb8fdc4b4f30e6e3e410584146d813c151928f94ec0db06c4f2595538", + "sha256:4b262bbc13022f2097c48a21adcc360a81d83dc1d854c11b94953cd46d7d3c07", + "sha256:4cbe929efa77a806e8f1a97793f2dc3ea3475ae21a9ed0f37c21320fe93f6f50", + "sha256:4e562cc63b04636cde361fd47569162f1daa94c759220ff202a8129902229114", + "sha256:546064c55264156b973b5e65e5fafbe5e62390902ce3cf6b4005765505e8ff56", + "sha256:54df7df399b777c1fd144f541c95d351b3aa110535a6810a6a569905d106b6f3", + "sha256:56a85fa0dab1567bd0cac10f0c3837b03e8a0d939e6a8061a3a420acd97e9421", + "sha256:57a53a75010c635b3ad6499e7721eaa3b450e03f6862afe2dbef9c8f66e46ec8", + "sha256:584a7a818c84767af16ce8bda5d4f7fedb37d3d231fc89928a192f567e4ef685", + "sha256:5fd905a69ac74eaba5041e21a1e8b1a479dab2b41c93bdcc4c1cede3c12a8d86", + "sha256:61d4e713f467abcdd59b47665d488bb898ad3dd47ce7446522a50e0cbd8e8279", + "sha256:6213b471b68146af97b8551294e59e7392c2117e28ffad9c557c65087f4baee3", + "sha256:63797499a219d8e81eb4e0c42222d0a4c8ec896f5c76751d4258af95de41fdf1", + "sha256:64e8012ad60a5f0da09ed48725e6e923d1be25f2f091a640af6079f874663813", + "sha256:664402ef0c238a7f8a46efb101789d5f2275600fb18114446efec83cfadb5b66", + "sha256:68199ada7c310ddb8c76efbb606a0de656b40899388a7498954f423e03fc38be", + "sha256:69159afc2f2dc43285725f16143bc5df3c853bc1cb7df6021fce7ef1c69e8171", + "sha256:6f855bcc96ed3dd56da7373cfcc9dcbabbc2073cac7f65c185772d08884790ce", + "sha256:6feb4b64d11d5420e517910d60a907d08d846cacaf4e029668725cd21d16743c", + "sha256:72f1216ca8cef7b8adacd4c4c6b89c3b0c4f97503197f5284c80f36d6e4edd30", + "sha256:77dadc764cf7c5405e04866181c5bd94a447372a9763e473abb63d1dfe9b7387", + "sha256:782fced7d61469fd1231b184a80e4f2fa7ad54cd7173834651a453f96f29d673", + "sha256:79262be5a292d1df060f29b9a7cdd66934801f987a817632d7552534a172709a", + "sha256:7aa82d483d5fb867d4fb10a138ffd57b0f1644e99f2f4f336e48790ada9ada5e", + "sha256:853f103e2b9a58832fdd08a587a51de8b552ae90e1a5d167f316b7eabf8d7dde", + "sha256:867d3eea954bea807cabba83cfc939c889a18576d66d197c60025b15269d7cc0", + "sha256:878a5017d93e776c379af4e7b20f173c82594d94fa073059bcc546789ad50bf8", + "sha256:884235507549a6b2d3c4113fb1877ae263109e787d9e0eb25c35982ab28d0399", + "sha256:8c938c96294d983dcf419b54dba2d21056959c22911d41788efbf949a29ae30d", + "sha256:8efc1be43b036c2b6bcfb1451df24ee0ddcf69c31351003daf2699ed93f5687b", + "sha256:8fba0aff4c407d0274e43697e785bcac155ad962be57518d1c711f45e72da70f", + "sha256:90f3785146f701e053bb6b9e8f53acce2c919aca91df88bd4975be0cb926eb41", + "sha256:9137289de8fe845c246a8c3482dd0cb40338846ba683756d8f489a4bd8fddcae", + "sha256:9206c14a67c38de7b916e486ae280017cf394fa4b1aa95cfe88621a4e1d79725", + "sha256:94d2b36a74623caab262bf95f0e365c2c058396082bd9d6a9e825657d0c1e7fa", + "sha256:97c6349c81cee2e69ef59eba6e6c08c5936e6b01c2d50b9e4ac152217845ae09", + "sha256:a027f41c5008571314861744d83aff75a34cf3a07022e0be32b214a5bc93f7f1", + "sha256:a08fd490ba36d1fbb2cd5dcdcfb9f3892deb93bd53456724389135712b5fc735", + "sha256:a297c0d6c61963c5c3726840677b798ca5b7dfc71bc9c02b9a4af11d23236008", + "sha256:a4ea23b07f29487a7bef2a869f68c7ee0e05424d81375ce3d3de829314c6b5ec", + "sha256:a8b7acd04896e8f161e1500dc5f218017db05c1d322f054e89cbd089ce5d0071", + "sha256:ac2b680de398f293b68183317432b3d67ab3faeba216aec18de0c395cb5e3060", + "sha256:af24ad4fbaa5e4a2000beae0c3b7fd1c78d7819ab90f9370a1cfd8998e3f8a3c", + "sha256:af788b64e13d52fc3600a68b16d31fa8d8573e3ff2fc9a38f8a60b8d94d1f012", + "sha256:b013c7861a7c7bfcec48fd709513fea6f9f31727e7a0a93ca0dd12e056740717", + "sha256:b2799c2eaf182769889761d4fb4d78b82bc47dae833799fedbf69fc7de306faa", + "sha256:b27f3e67f6e031f6620655741b7d0d6bebea8b25d415924b3e8bfef2dd7bd841", + "sha256:b7206e41e04b443016e930e01685bab7a308113c0b251b3f906942c8d4b48fcb", + "sha256:b85778308bf945e9b33ac604e6793df9b07933108d20bdf53811bc7c2798a4af", + "sha256:bd7d1dde70ff3e09e4bc7a1cbb91a7a538add291bfd5b3e70ef1e7b45192440f", + "sha256:be86c2eb12fb0f846262ace9d8f032dc6978b8cb26a058920ecb723dbcb87d05", + "sha256:bf10963d8aed8bbe0165b41797c9463d4c5c8788ae6a77c68427569be6bead41", + "sha256:c1375025f0bfc9155286ebae8eecc65e33e494c90025cda69e247c3ccd2bab00", + "sha256:c5d8e764b5646623e57575f624f8ebb8f7a9f7fd1fae682ef87869ca5fec8dcf", + "sha256:cba5ad5eef02c86a1f3da00544cbc59a510d596b27566479a7cd4d91c6187a11", + "sha256:cc086ddb6dc654a15deeed1d1f2bcb1cb924ebd70df9dca738af19f64229b06c", + "sha256:d0c2b713464a8e263a243ae7980d81ce2de5ac59a9f798a282e44350b42dc516", + "sha256:d93aedbc4614cc21b9ab0d0c4ccd7143354c1f7cffbbe96ae5216ad21d1b21b5", + "sha256:d9610b47b5fe4aacbbba6a9cb5f12cbe864eec99dbfed5710bd32ef5dd8a5d5b", + "sha256:da055a1b0bfa8041bb2ff586b2cb0353ed03944a3472186a02cc44a557a0e661", + "sha256:dd2429f7635ad4857b5881503f9c310be7761dc681c467a9d27787b674d1250a", + "sha256:de39eb3bab93a99ddda1ac1b9aa331b944d8bcc4aa9141148f7fd8ee0299dafc", + "sha256:e40b1e97edd3dc127aa53d8a5e539a3d0c227d71574d3f9ac1af02d58218a122", + "sha256:e412607ca89a0ced10758dfb8f9adcc365ce4c1c377e637c01989a75e9a9ec8a", + "sha256:e953353180bec330c3b830891d260b6f8e576e2d18db3c78d314e56bb2276066", + "sha256:ec3473c9789cc00c7260d840c3db2c16dbfc816ca70ec87a00cddfa3e1a1cdd5", + "sha256:efff8b6761a1f6e45cebd1b7a6406eb2723d2d5710ff0d1b624fe11313693989", + "sha256:f773b39780323a0499b53ebd91a28ad11cde6705605d98d999dfa08624caf064", + "sha256:fa8e48001b39d54d97d7b380a0669fa99fc0feeb972e35a2d677ba59164a9a22", + "sha256:ff246c0111076c8022f9ba325c294f2cb5983403506989253e04dbae565e019b", + "sha256:ffe18407a4d000c568182ce5388bbbedeb099896904e43fc14eee76cfae6dec5" + ], + "markers": "python_version >= '3.7'", + "version": "==2.4.0" + }, "python-dateutil": { "hashes": [ "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86", @@ -464,6 +595,14 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.16.0" }, + "typing-extensions": { + "hashes": [ + "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36", + "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2" + ], + "markers": "python_version >= '3.7'", + "version": "==4.7.1" + }, "urllib3": { "hashes": [ "sha256:8d22f86aae8ef5e410d4f539fde9ce6b2113a001bb4d189e0aed70642d602b11", diff --git a/dictator/cogs/stats.py b/dictator/cogs/stats.py index 6771460..ac551f2 100644 --- a/dictator/cogs/stats.py +++ b/dictator/cogs/stats.py @@ -8,11 +8,13 @@ import socket from datetime import date +import inflect class Stats(commands.Cog): def __init__(self, dictator: commands.Bot) -> None: self.dictator = dictator + self.p = inflect.engine() @commands.Cog.listener() async def on_ready(self) -> None: @@ -126,13 +128,17 @@ async def process_player_list(self, parsed_player_list: str) -> str: async def format_family_list(self, family_list: str) -> str: formatted_families = "" + unnamed_families = 0 for family in family_list: - family_name = family[1] + family_name = family[1].title() if not family_name: - family_name = "UNNAMED" - formatted_families += f"{family_name}: {family[2]}\n" + unnamed_families += 1 + continue + formatted_families += f"{family[2]} in {family_name}\n" - formatted_families += f"\n*v1, subject to change*" + if unnamed_families: + formatted_families += f"{unnamed_families} Unnamed {self.p.plural('family', unnamed_families)}" + formatted_families += f"\n\n*v1, subject to change*" return formatted_families async def open_collective_forecast_embed(self) -> discord.Embed: