From 27e86de7bae9f69c0176a1eb262ac341075a1baa Mon Sep 17 00:00:00 2001 From: Harold Karibiye Date: Thu, 24 Sep 2020 03:33:42 +0100 Subject: add modified files modify code to work on all platforms, fix grammatical errors --- Pipfile | 1 + Pipfile.lock | 190 +++++++++++++++++++++++--------------- bot/exts/evergreen/minesweeper.py | 12 +-- 3 files changed, 122 insertions(+), 81 deletions(-) diff --git a/Pipfile b/Pipfile index 38044a0a..5b8dbdb0 100644 --- a/Pipfile +++ b/Pipfile @@ -13,6 +13,7 @@ pillow = "~=6.2" pytz = "~=2019.2" sentry-sdk = "~=0.14.2" PyYAML = "~=5.3.1" +flake8 = "*" [dev-packages] flake8 = "~=3.8" diff --git a/Pipfile.lock b/Pipfile.lock index 74931967..988a22da 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "dfd24795dcdab1a05fd774b5034b195b69d6d6ed52fd6810db9c89247f8e0a43" + "sha256": "67886aebb52f048b754e6be8014037cdd9d320d07ebebc024ef67b3a03b47054" }, "pipfile-spec": 6, "requires": { @@ -44,11 +44,11 @@ }, "arrow": { "hashes": [ - "sha256:271b8e05174d48e50324ed0dc5d74796c839c7e579a4f21cf1a7394665f9e94f", - "sha256:edc31dc051db12c95da9bac0271cd1027b8e36912daf6d4580af53b23e62721a" + "sha256:92aac856ea5175c804f7ccb96aca4d714d936f1c867ba59d747a8096ec30e90a", + "sha256:98184d8dd3e5d30b96c2df4596526f7de679ccb467f358b82b0f686436f3a6b8" ], "index": "pypi", - "version": "==0.15.8" + "version": "==0.16.0" }, "async-timeout": { "hashes": [ @@ -60,11 +60,11 @@ }, "attrs": { "hashes": [ - "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c", - "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72" + "sha256:26b54ddbbb9ee1d34d5d3668dd37d6cf74990ab23c828c2888dccdceee395594", + "sha256:fce7fc47dfc976152e82d53ff92fa0407700c21acd20886a13777a0d20e655dc" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==19.3.0" + "version": "==20.2.0" }, "beautifulsoup4": { "hashes": [ @@ -84,36 +84,44 @@ }, "cffi": { "hashes": [ - "sha256:0da50dcbccd7cb7e6c741ab7912b2eff48e85af217d72b57f80ebc616257125e", - "sha256:12a453e03124069b6896107ee133ae3ab04c624bb10683e1ed1c1663df17c13c", - "sha256:15419020b0e812b40d96ec9d369b2bc8109cc3295eac6e013d3261343580cc7e", - "sha256:15a5f59a4808f82d8ec7364cbace851df591c2d43bc76bcbe5c4543a7ddd1bf1", - "sha256:23e44937d7695c27c66a54d793dd4b45889a81b35c0751ba91040fe825ec59c4", - "sha256:29c4688ace466a365b85a51dcc5e3c853c1d283f293dfcc12f7a77e498f160d2", - "sha256:57214fa5430399dffd54f4be37b56fe22cedb2b98862550d43cc085fb698dc2c", - "sha256:577791f948d34d569acb2d1add5831731c59d5a0c50a6d9f629ae1cefd9ca4a0", - "sha256:6539314d84c4d36f28d73adc1b45e9f4ee2a89cdc7e5d2b0a6dbacba31906798", - "sha256:65867d63f0fd1b500fa343d7798fa64e9e681b594e0a07dc934c13e76ee28fb1", - "sha256:672b539db20fef6b03d6f7a14b5825d57c98e4026401fce838849f8de73fe4d4", - "sha256:6843db0343e12e3f52cc58430ad559d850a53684f5b352540ca3f1bc56df0731", - "sha256:7057613efefd36cacabbdbcef010e0a9c20a88fc07eb3e616019ea1692fa5df4", - "sha256:76ada88d62eb24de7051c5157a1a78fd853cca9b91c0713c2e973e4196271d0c", - "sha256:837398c2ec00228679513802e3744d1e8e3cb1204aa6ad408b6aff081e99a487", - "sha256:8662aabfeab00cea149a3d1c2999b0731e70c6b5bac596d95d13f643e76d3d4e", - "sha256:95e9094162fa712f18b4f60896e34b621df99147c2cee216cfa8f022294e8e9f", - "sha256:99cc66b33c418cd579c0f03b77b94263c305c389cb0c6972dac420f24b3bf123", - "sha256:9b219511d8b64d3fa14261963933be34028ea0e57455baf6781fe399c2c3206c", - "sha256:ae8f34d50af2c2154035984b8b5fc5d9ed63f32fe615646ab435b05b132ca91b", - "sha256:b9aa9d8818c2e917fa2c105ad538e222a5bce59777133840b93134022a7ce650", - "sha256:bf44a9a0141a082e89c90e8d785b212a872db793a0080c20f6ae6e2a0ebf82ad", - "sha256:c0b48b98d79cf795b0916c57bebbc6d16bb43b9fc9b8c9f57f4cf05881904c75", - "sha256:da9d3c506f43e220336433dffe643fbfa40096d408cb9b7f2477892f369d5f82", - "sha256:e4082d832e36e7f9b2278bc774886ca8207346b99f278e54c9de4834f17232f7", - "sha256:e4b9b7af398c32e408c00eb4e0d33ced2f9121fd9fb978e6c1b57edd014a7d15", - "sha256:e613514a82539fc48291d01933951a13ae93b6b444a88782480be32245ed4afa", - "sha256:f5033952def24172e60493b68717792e3aebb387a8d186c43c020d9363ee7281" - ], - "version": "==1.14.2" + "sha256:005f2bfe11b6745d726dbb07ace4d53f057de66e336ff92d61b8c7e9c8f4777d", + "sha256:09e96138280241bd355cd585148dec04dbbedb4f46128f340d696eaafc82dd7b", + "sha256:0b1ad452cc824665ddc682400b62c9e4f5b64736a2ba99110712fdee5f2505c4", + "sha256:0ef488305fdce2580c8b2708f22d7785ae222d9825d3094ab073e22e93dfe51f", + "sha256:15f351bed09897fbda218e4db5a3d5c06328862f6198d4fb385f3e14e19decb3", + "sha256:22399ff4870fb4c7ef19fff6eeb20a8bbf15571913c181c78cb361024d574579", + "sha256:23e5d2040367322824605bc29ae8ee9175200b92cb5483ac7d466927a9b3d537", + "sha256:2791f68edc5749024b4722500e86303a10d342527e1e3bcac47f35fbd25b764e", + "sha256:2f9674623ca39c9ebe38afa3da402e9326c245f0f5ceff0623dccdac15023e05", + "sha256:3363e77a6176afb8823b6e06db78c46dbc4c7813b00a41300a4873b6ba63b171", + "sha256:33c6cdc071ba5cd6d96769c8969a0531be2d08c2628a0143a10a7dcffa9719ca", + "sha256:3b8eaf915ddc0709779889c472e553f0d3e8b7bdf62dab764c8921b09bf94522", + "sha256:3cb3e1b9ec43256c4e0f8d2837267a70b0e1ca8c4f456685508ae6106b1f504c", + "sha256:3eeeb0405fd145e714f7633a5173318bd88d8bbfc3dd0a5751f8c4f70ae629bc", + "sha256:44f60519595eaca110f248e5017363d751b12782a6f2bd6a7041cba275215f5d", + "sha256:4d7c26bfc1ea9f92084a1d75e11999e97b62d63128bcc90c3624d07813c52808", + "sha256:529c4ed2e10437c205f38f3691a68be66c39197d01062618c55f74294a4a4828", + "sha256:6642f15ad963b5092d65aed022d033c77763515fdc07095208f15d3563003869", + "sha256:85ba797e1de5b48aa5a8427b6ba62cf69607c18c5d4eb747604b7302f1ec382d", + "sha256:8f0f1e499e4000c4c347a124fa6a27d37608ced4fe9f7d45070563b7c4c370c9", + "sha256:a624fae282e81ad2e4871bdb767e2c914d0539708c0f078b5b355258293c98b0", + "sha256:b0358e6fefc74a16f745afa366acc89f979040e0cbc4eec55ab26ad1f6a9bfbc", + "sha256:bbd2f4dfee1079f76943767fce837ade3087b578aeb9f69aec7857d5bf25db15", + "sha256:bf39a9e19ce7298f1bd6a9758fa99707e9e5b1ebe5e90f2c3913a47bc548747c", + "sha256:c11579638288e53fc94ad60022ff1b67865363e730ee41ad5e6f0a17188b327a", + "sha256:c150eaa3dadbb2b5339675b88d4573c1be3cb6f2c33a6c83387e10cc0bf05bd3", + "sha256:c53af463f4a40de78c58b8b2710ade243c81cbca641e34debf3396a9640d6ec1", + "sha256:cb763ceceae04803adcc4e2d80d611ef201c73da32d8f2722e9d0ab0c7f10768", + "sha256:cc75f58cdaf043fe6a7a6c04b3b5a0e694c6a9e24050967747251fb80d7bce0d", + "sha256:d80998ed59176e8cba74028762fbd9b9153b9afc71ea118e63bbf5d4d0f9552b", + "sha256:de31b5164d44ef4943db155b3e8e17929707cac1e5bd2f363e67a56e3af4af6e", + "sha256:e66399cf0fc07de4dce4f588fc25bfe84a6d1285cc544e67987d22663393926d", + "sha256:f0620511387790860b249b9241c2f13c3a80e21a73e0b861a2df24e9d6f56730", + "sha256:f4eae045e6ab2bb54ca279733fe4eb85f1effda392666308250714e01907f394", + "sha256:f92cdecb618e5fa4658aeb97d5eb3d2f47aa94ac6477c6daf0f306c5a3b9e6b1", + "sha256:f92f789e4f9241cd262ad7a555ca2c648a98178a953af117ef7fad46aa1d5591" + ], + "version": "==1.14.3" }, "chardet": { "hashes": [ @@ -126,6 +134,14 @@ "git": "https://github.com/Rapptz/discord.py.git", "ref": "0bc15fa130b8f01fe2d67446a2184d474b0d0ba7" }, + "flake8": { + "hashes": [ + "sha256:15e351d19611c887e482fb960eae4d44845013cc142d42896e9862f775d8cf5c", + "sha256:f04b9fcbac03b0a3e58c0ab3a0ecc462e023a9faf046d57794184028123aa208" + ], + "index": "pypi", + "version": "==3.8.3" + }, "fuzzywuzzy": { "hashes": [ "sha256:45016e92264780e58972dca1b3d939ac864b78437422beecebb3095f8efd00e8", @@ -142,6 +158,13 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.10" }, + "mccabe": { + "hashes": [ + "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", + "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" + ], + "version": "==0.6.1" + }, "multidict": { "hashes": [ "sha256:1ece5a3369835c20ed57adadc663400b5525904e53bae59ec854a5d36b39b21a", @@ -235,6 +258,14 @@ ], "version": "==3.1.1" }, + "pycodestyle": { + "hashes": [ + "sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367", + "sha256:c58a7d2815e0e8d7972bf1803331fb0152f867bd89adf8a01dfd55085434192e" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==2.6.0" + }, "pycparser": { "hashes": [ "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0", @@ -243,6 +274,14 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.20" }, + "pyflakes": { + "hashes": [ + "sha256:0d94e0e05a19e57a99444b6ddcf9a6eb2e5c68d3ca1e98e90707af8152c90a92", + "sha256:35b2d75ee967ea93b55750aa9edbbf72813e06a66ba54438df2cfac9e3c27fc8" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==2.2.0" + }, "python-dateutil": { "hashes": [ "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c", @@ -338,26 +377,26 @@ }, "yarl": { "hashes": [ - "sha256:040b237f58ff7d800e6e0fd89c8439b841f777dd99b4a9cca04d6935564b9409", - "sha256:17668ec6722b1b7a3a05cc0167659f6c95b436d25a36c2d52db0eca7d3f72593", - "sha256:3a584b28086bc93c888a6c2aa5c92ed1ae20932f078c46509a66dce9ea5533f2", - "sha256:4439be27e4eee76c7632c2427ca5e73703151b22cae23e64adb243a9c2f565d8", - "sha256:48e918b05850fffb070a496d2b5f97fc31d15d94ca33d3d08a4f86e26d4e7c5d", - "sha256:9102b59e8337f9874638fcfc9ac3734a0cfadb100e47d55c20d0dc6087fb4692", - "sha256:9b930776c0ae0c691776f4d2891ebc5362af86f152dd0da463a6614074cb1b02", - "sha256:b3b9ad80f8b68519cc3372a6ca85ae02cc5a8807723ac366b53c0f089db19e4a", - "sha256:bc2f976c0e918659f723401c4f834deb8a8e7798a71be4382e024bcc3f7e23a8", - "sha256:c22c75b5f394f3d47105045ea551e08a3e804dc7e01b37800ca35b58f856c3d6", - "sha256:c52ce2883dc193824989a9b97a76ca86ecd1fa7955b14f87bf367a61b6232511", - "sha256:ce584af5de8830d8701b8979b18fcf450cef9a382b1a3c8ef189bedc408faf1e", - "sha256:da456eeec17fa8aa4594d9a9f27c0b1060b6a75f2419fe0c00609587b2695f4a", - "sha256:db6db0f45d2c63ddb1a9d18d1b9b22f308e52c83638c26b422d520a815c4b3fb", - "sha256:df89642981b94e7db5596818499c4b2219028f2a528c9c37cc1de45bf2fd3a3f", - "sha256:f18d68f2be6bf0e89f1521af2b1bb46e66ab0018faafa81d70f358153170a317", - "sha256:f379b7f83f23fe12823085cd6b906edc49df969eb99757f58ff382349a3303c6" + "sha256:04a54f126a0732af75e5edc9addeaa2113e2ca7c6fce8974a63549a70a25e50e", + "sha256:3cc860d72ed989f3b1f3abbd6ecf38e412de722fb38b8f1b1a086315cf0d69c5", + "sha256:5d84cc36981eb5a8533be79d6c43454c8e6a39ee3118ceaadbd3c029ab2ee580", + "sha256:5e447e7f3780f44f890360ea973418025e8c0cdcd7d6a1b221d952600fd945dc", + "sha256:61d3ea3c175fe45f1498af868879c6ffeb989d4143ac542163c45538ba5ec21b", + "sha256:67c5ea0970da882eaf9efcf65b66792557c526f8e55f752194eff8ec722c75c2", + "sha256:6f6898429ec3c4cfbef12907047136fd7b9e81a6ee9f105b45505e633427330a", + "sha256:7ce35944e8e61927a8f4eb78f5bc5d1e6da6d40eadd77e3f79d4e9399e263921", + "sha256:b7c199d2cbaf892ba0f91ed36d12ff41ecd0dde46cbf64ff4bfe997a3ebc925e", + "sha256:c15d71a640fb1f8e98a1423f9c64d7f1f6a3a168f803042eaf3a5b5022fde0c1", + "sha256:c22607421f49c0cb6ff3ed593a49b6a99c6ffdeaaa6c944cdda83c2393c8864d", + "sha256:c604998ab8115db802cc55cb1b91619b2831a6128a62ca7eea577fc8ea4d3131", + "sha256:d088ea9319e49273f25b1c96a3763bf19a882cff774d1792ae6fba34bd40550a", + "sha256:db9eb8307219d7e09b33bcb43287222ef35cbcf1586ba9472b0a4b833666ada1", + "sha256:e31fef4e7b68184545c3d68baec7074532e077bd1906b040ecfba659737df188", + "sha256:e32f0fb443afcfe7f01f95172b66f279938fbc6bdaebe294b0ff6747fb6db020", + "sha256:fcbe419805c9b20db9a51d33b942feddbf6e7fb468cb20686fd7089d4164c12a" ], "markers": "python_version >= '3.5'", - "version": "==1.5.1" + "version": "==1.6.0" } }, "develop": { @@ -370,11 +409,11 @@ }, "attrs": { "hashes": [ - "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c", - "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72" + "sha256:26b54ddbbb9ee1d34d5d3668dd37d6cf74990ab23c828c2888dccdceee395594", + "sha256:fce7fc47dfc976152e82d53ff92fa0407700c21acd20886a13777a0d20e655dc" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==19.3.0" + "version": "==20.2.0" }, "cfgv": { "hashes": [ @@ -408,11 +447,11 @@ }, "flake8-annotations": { "hashes": [ - "sha256:7816a5d8f65ffdf37b8e21e5b17e0fd1e492aa92638573276de066e889a22b26", - "sha256:8d18db74a750dd97f40b483cc3ef80d07d03f687525bad8fd83365dcd3bfd414" + "sha256:09fe1aa3f40cb8fef632a0ab3614050a7584bb884b6134e70cf1fc9eeee642fa", + "sha256:5bda552f074fd6e34276c7761756fa07d824ffac91ce9c0a8555eb2bc5b92d7a" ], "index": "pypi", - "version": "==2.3.0" + "version": "==2.4.0" }, "flake8-bugbear": { "hashes": [ @@ -470,11 +509,11 @@ }, "identify": { "hashes": [ - "sha256:69c4769f085badafd0e04b1763e847258cbbf6d898e8678ebffc91abdb86f6c6", - "sha256:d6ae6daee50ba1b493e9ca4d36a5edd55905d2cf43548fdc20b2a14edef102e7" + "sha256:7c22c384a2c9b32c5cc891d13f923f6b2653aa83e2d75d8f79be240d6c86c4f4", + "sha256:da683bfb7669fa749fc7731f378229e2dbf29a1d1337cbde04106f02236eb29d" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.4.28" + "version": "==1.5.5" }, "mccabe": { "hashes": [ @@ -485,9 +524,10 @@ }, "nodeenv": { "hashes": [ - "sha256:4b0b77afa3ba9b54f4b6396e60b0c83f59eaeb2d63dc3cc7a70f7f4af96c82bc" + "sha256:5304d424c529c997bc888453aeaa6362d242b6b4631e90f3d4bf1b290f1c84a9", + "sha256:ab45090ae383b716c4ef89e690c41ff8c2b257b85b309f01f3654df3d084bd7c" ], - "version": "==1.4.0" + "version": "==1.5.0" }, "pep8-naming": { "hashes": [ @@ -499,11 +539,11 @@ }, "pre-commit": { "hashes": [ - "sha256:1657663fdd63a321a4a739915d7d03baedd555b25054449090f97bb0cb30a915", - "sha256:e8b1315c585052e729ab7e99dcca5698266bedce9067d21dc909c23e3ceed626" + "sha256:810aef2a2ba4f31eed1941fc270e72696a1ad5590b9751839c90807d0fff6b9a", + "sha256:c54fd3e574565fe128ecc5e7d2f91279772ddb03f8729645fa812fe809084a70" ], "index": "pypi", - "version": "==2.6.0" + "version": "==2.7.1" }, "pycodestyle": { "hashes": [ @@ -515,11 +555,11 @@ }, "pydocstyle": { "hashes": [ - "sha256:da7831660b7355307b32778c4a0dbfb137d89254ef31a2b2978f50fc0b4d7586", - "sha256:f4f5d210610c2d153fae39093d44224c17429e2ad7da12a8b419aba5c2f614b5" + "sha256:19b86fa8617ed916776a11cd8bc0197e5b9856d5433b777f51a3defe13075325", + "sha256:aca749e190a01726a4fb472dd4ef23b5c9da7b9205c0a7857c06533de13fd678" ], "markers": "python_version >= '3.5'", - "version": "==5.0.2" + "version": "==5.1.1" }, "pyflakes": { "hashes": [ @@ -570,11 +610,11 @@ }, "virtualenv": { "hashes": [ - "sha256:7b54fd606a1b85f83de49ad8d80dbec08e983a2d2f96685045b262ebc7481ee5", - "sha256:8cd7b2a4850b003a11be2fc213e206419efab41115cc14bca20e69654f2ac08e" + "sha256:43add625c53c596d38f971a465553f6318decc39d98512bc100fa1b1e839c8dc", + "sha256:e0305af10299a7fb0d69393d8f04cb2965dda9351140d11ac8db4e5e3970451b" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==20.0.30" + "version": "==20.0.31" } } } diff --git a/bot/exts/evergreen/minesweeper.py b/bot/exts/evergreen/minesweeper.py index 3e40f493..286ac7a5 100644 --- a/bot/exts/evergreen/minesweeper.py +++ b/bot/exts/evergreen/minesweeper.py @@ -120,14 +120,14 @@ class Minesweeper(commands.Cog): def format_for_discord(board: GameBoard) -> str: """Format the board as a string for Discord.""" discord_msg = ( - ":stop_button: :regional_indicator_a::regional_indicator_b::regional_indicator_c:" - ":regional_indicator_d::regional_indicator_e::regional_indicator_f::regional_indicator_g:" - ":regional_indicator_h::regional_indicator_i::regional_indicator_j:\n\n" + ":stop_button: :regional_indicator_a: :regional_indicator_b: :regional_indicator_c: " + ":regional_indicator_d: :regional_indicator_e: :regional_indicator_f: :regional_indicator_g: " + ":regional_indicator_h: :regional_indicator_i: :regional_indicator_j:\n\n" ) rows = [] for row_number, row in enumerate(board): new_row = f"{MESSAGE_MAPPING[row_number + 1]} " - new_row += "".join(MESSAGE_MAPPING[cell] for cell in row) + new_row += " ".join(MESSAGE_MAPPING[cell] for cell in row) rows.append(new_row) discord_msg += "\n".join(rows) @@ -158,7 +158,7 @@ class Minesweeper(commands.Cog): if ctx.guild: await ctx.send(f"{ctx.author.mention} is playing Minesweeper") - chat_msg = await ctx.send(f"Here's there board!\n{self.format_for_discord(revealed_board)}") + chat_msg = await ctx.send(f"Here's their board!\n{self.format_for_discord(revealed_board)}") else: chat_msg = None @@ -176,7 +176,7 @@ class Minesweeper(commands.Cog): await game.dm_msg.delete() game.dm_msg = await ctx.author.send(f"Here's your board!\n{self.format_for_discord(game.revealed)}") if game.activated_on_server: - await game.chat_msg.edit(content=f"Here's there board!\n{self.format_for_discord(game.revealed)}") + await game.chat_msg.edit(content=f"Here's their board!\n{self.format_for_discord(game.revealed)}") @commands.dm_only() @minesweeper_group.command(name="flag") -- cgit v1.2.3 From 3dee3880efd82dc862964f96253fc42a3aefb735 Mon Sep 17 00:00:00 2001 From: Harold Karibiye Date: Fri, 25 Sep 2020 17:25:20 +0100 Subject: uninstall flake8 and update pipfile and pipfile.lock --- Pipfile | 2 -- Pipfile.lock | 41 +++++------------------------------------ 2 files changed, 5 insertions(+), 38 deletions(-) diff --git a/Pipfile b/Pipfile index 5b8dbdb0..87302d84 100644 --- a/Pipfile +++ b/Pipfile @@ -13,10 +13,8 @@ pillow = "~=6.2" pytz = "~=2019.2" sentry-sdk = "~=0.14.2" PyYAML = "~=5.3.1" -flake8 = "*" [dev-packages] -flake8 = "~=3.8" flake8-annotations = "~=2.3" flake8-bugbear = "~=20.1" flake8-docstrings = "~=1.5" diff --git a/Pipfile.lock b/Pipfile.lock index 988a22da..f4449ef9 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "67886aebb52f048b754e6be8014037cdd9d320d07ebebc024ef67b3a03b47054" + "sha256": "540592aa975c4ace7c4a70f3d257865b97c5dd1c45a8ab3c2f71f9ca76fa8cd4" }, "pipfile-spec": 6, "requires": { @@ -134,14 +134,6 @@ "git": "https://github.com/Rapptz/discord.py.git", "ref": "0bc15fa130b8f01fe2d67446a2184d474b0d0ba7" }, - "flake8": { - "hashes": [ - "sha256:15e351d19611c887e482fb960eae4d44845013cc142d42896e9862f775d8cf5c", - "sha256:f04b9fcbac03b0a3e58c0ab3a0ecc462e023a9faf046d57794184028123aa208" - ], - "index": "pypi", - "version": "==3.8.3" - }, "fuzzywuzzy": { "hashes": [ "sha256:45016e92264780e58972dca1b3d939ac864b78437422beecebb3095f8efd00e8", @@ -158,13 +150,6 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.10" }, - "mccabe": { - "hashes": [ - "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", - "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" - ], - "version": "==0.6.1" - }, "multidict": { "hashes": [ "sha256:1ece5a3369835c20ed57adadc663400b5525904e53bae59ec854a5d36b39b21a", @@ -258,14 +243,6 @@ ], "version": "==3.1.1" }, - "pycodestyle": { - "hashes": [ - "sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367", - "sha256:c58a7d2815e0e8d7972bf1803331fb0152f867bd89adf8a01dfd55085434192e" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.6.0" - }, "pycparser": { "hashes": [ "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0", @@ -274,20 +251,12 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.20" }, - "pyflakes": { - "hashes": [ - "sha256:0d94e0e05a19e57a99444b6ddcf9a6eb2e5c68d3ca1e98e90707af8152c90a92", - "sha256:35b2d75ee967ea93b55750aa9edbbf72813e06a66ba54438df2cfac9e3c27fc8" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.2.0" - }, "python-dateutil": { "hashes": [ "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c", "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==2.8.1" }, "pytz": { @@ -328,7 +297,7 @@ "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==1.15.0" }, "soupsieve": { @@ -442,7 +411,7 @@ "sha256:15e351d19611c887e482fb960eae4d44845013cc142d42896e9862f775d8cf5c", "sha256:f04b9fcbac03b0a3e58c0ab3a0ecc462e023a9faf046d57794184028123aa208" ], - "index": "pypi", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==3.8.3" }, "flake8-annotations": { @@ -591,7 +560,7 @@ "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==1.15.0" }, "snowballstemmer": { -- cgit v1.2.3 From 1d83384ee06d5291f5e96184be620c2a04484397 Mon Sep 17 00:00:00 2001 From: Harold Karibiye Date: Sun, 27 Sep 2020 00:18:49 +0100 Subject: sync Pipfile and Pipfile.lock --- Pipfile | 1 + Pipfile.lock | 167 ++++++++++++++++++++++++++++------------------------------- 2 files changed, 80 insertions(+), 88 deletions(-) diff --git a/Pipfile b/Pipfile index 87302d84..38044a0a 100644 --- a/Pipfile +++ b/Pipfile @@ -15,6 +15,7 @@ sentry-sdk = "~=0.14.2" PyYAML = "~=5.3.1" [dev-packages] +flake8 = "~=3.8" flake8-annotations = "~=2.3" flake8-bugbear = "~=20.1" flake8-docstrings = "~=1.5" diff --git a/Pipfile.lock b/Pipfile.lock index f4449ef9..74931967 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "540592aa975c4ace7c4a70f3d257865b97c5dd1c45a8ab3c2f71f9ca76fa8cd4" + "sha256": "dfd24795dcdab1a05fd774b5034b195b69d6d6ed52fd6810db9c89247f8e0a43" }, "pipfile-spec": 6, "requires": { @@ -44,11 +44,11 @@ }, "arrow": { "hashes": [ - "sha256:92aac856ea5175c804f7ccb96aca4d714d936f1c867ba59d747a8096ec30e90a", - "sha256:98184d8dd3e5d30b96c2df4596526f7de679ccb467f358b82b0f686436f3a6b8" + "sha256:271b8e05174d48e50324ed0dc5d74796c839c7e579a4f21cf1a7394665f9e94f", + "sha256:edc31dc051db12c95da9bac0271cd1027b8e36912daf6d4580af53b23e62721a" ], "index": "pypi", - "version": "==0.16.0" + "version": "==0.15.8" }, "async-timeout": { "hashes": [ @@ -60,11 +60,11 @@ }, "attrs": { "hashes": [ - "sha256:26b54ddbbb9ee1d34d5d3668dd37d6cf74990ab23c828c2888dccdceee395594", - "sha256:fce7fc47dfc976152e82d53ff92fa0407700c21acd20886a13777a0d20e655dc" + "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c", + "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==20.2.0" + "version": "==19.3.0" }, "beautifulsoup4": { "hashes": [ @@ -84,44 +84,36 @@ }, "cffi": { "hashes": [ - "sha256:005f2bfe11b6745d726dbb07ace4d53f057de66e336ff92d61b8c7e9c8f4777d", - "sha256:09e96138280241bd355cd585148dec04dbbedb4f46128f340d696eaafc82dd7b", - "sha256:0b1ad452cc824665ddc682400b62c9e4f5b64736a2ba99110712fdee5f2505c4", - "sha256:0ef488305fdce2580c8b2708f22d7785ae222d9825d3094ab073e22e93dfe51f", - "sha256:15f351bed09897fbda218e4db5a3d5c06328862f6198d4fb385f3e14e19decb3", - "sha256:22399ff4870fb4c7ef19fff6eeb20a8bbf15571913c181c78cb361024d574579", - "sha256:23e5d2040367322824605bc29ae8ee9175200b92cb5483ac7d466927a9b3d537", - "sha256:2791f68edc5749024b4722500e86303a10d342527e1e3bcac47f35fbd25b764e", - "sha256:2f9674623ca39c9ebe38afa3da402e9326c245f0f5ceff0623dccdac15023e05", - "sha256:3363e77a6176afb8823b6e06db78c46dbc4c7813b00a41300a4873b6ba63b171", - "sha256:33c6cdc071ba5cd6d96769c8969a0531be2d08c2628a0143a10a7dcffa9719ca", - "sha256:3b8eaf915ddc0709779889c472e553f0d3e8b7bdf62dab764c8921b09bf94522", - "sha256:3cb3e1b9ec43256c4e0f8d2837267a70b0e1ca8c4f456685508ae6106b1f504c", - "sha256:3eeeb0405fd145e714f7633a5173318bd88d8bbfc3dd0a5751f8c4f70ae629bc", - "sha256:44f60519595eaca110f248e5017363d751b12782a6f2bd6a7041cba275215f5d", - "sha256:4d7c26bfc1ea9f92084a1d75e11999e97b62d63128bcc90c3624d07813c52808", - "sha256:529c4ed2e10437c205f38f3691a68be66c39197d01062618c55f74294a4a4828", - "sha256:6642f15ad963b5092d65aed022d033c77763515fdc07095208f15d3563003869", - "sha256:85ba797e1de5b48aa5a8427b6ba62cf69607c18c5d4eb747604b7302f1ec382d", - "sha256:8f0f1e499e4000c4c347a124fa6a27d37608ced4fe9f7d45070563b7c4c370c9", - "sha256:a624fae282e81ad2e4871bdb767e2c914d0539708c0f078b5b355258293c98b0", - "sha256:b0358e6fefc74a16f745afa366acc89f979040e0cbc4eec55ab26ad1f6a9bfbc", - "sha256:bbd2f4dfee1079f76943767fce837ade3087b578aeb9f69aec7857d5bf25db15", - "sha256:bf39a9e19ce7298f1bd6a9758fa99707e9e5b1ebe5e90f2c3913a47bc548747c", - "sha256:c11579638288e53fc94ad60022ff1b67865363e730ee41ad5e6f0a17188b327a", - "sha256:c150eaa3dadbb2b5339675b88d4573c1be3cb6f2c33a6c83387e10cc0bf05bd3", - "sha256:c53af463f4a40de78c58b8b2710ade243c81cbca641e34debf3396a9640d6ec1", - "sha256:cb763ceceae04803adcc4e2d80d611ef201c73da32d8f2722e9d0ab0c7f10768", - "sha256:cc75f58cdaf043fe6a7a6c04b3b5a0e694c6a9e24050967747251fb80d7bce0d", - "sha256:d80998ed59176e8cba74028762fbd9b9153b9afc71ea118e63bbf5d4d0f9552b", - "sha256:de31b5164d44ef4943db155b3e8e17929707cac1e5bd2f363e67a56e3af4af6e", - "sha256:e66399cf0fc07de4dce4f588fc25bfe84a6d1285cc544e67987d22663393926d", - "sha256:f0620511387790860b249b9241c2f13c3a80e21a73e0b861a2df24e9d6f56730", - "sha256:f4eae045e6ab2bb54ca279733fe4eb85f1effda392666308250714e01907f394", - "sha256:f92cdecb618e5fa4658aeb97d5eb3d2f47aa94ac6477c6daf0f306c5a3b9e6b1", - "sha256:f92f789e4f9241cd262ad7a555ca2c648a98178a953af117ef7fad46aa1d5591" - ], - "version": "==1.14.3" + "sha256:0da50dcbccd7cb7e6c741ab7912b2eff48e85af217d72b57f80ebc616257125e", + "sha256:12a453e03124069b6896107ee133ae3ab04c624bb10683e1ed1c1663df17c13c", + "sha256:15419020b0e812b40d96ec9d369b2bc8109cc3295eac6e013d3261343580cc7e", + "sha256:15a5f59a4808f82d8ec7364cbace851df591c2d43bc76bcbe5c4543a7ddd1bf1", + "sha256:23e44937d7695c27c66a54d793dd4b45889a81b35c0751ba91040fe825ec59c4", + "sha256:29c4688ace466a365b85a51dcc5e3c853c1d283f293dfcc12f7a77e498f160d2", + "sha256:57214fa5430399dffd54f4be37b56fe22cedb2b98862550d43cc085fb698dc2c", + "sha256:577791f948d34d569acb2d1add5831731c59d5a0c50a6d9f629ae1cefd9ca4a0", + "sha256:6539314d84c4d36f28d73adc1b45e9f4ee2a89cdc7e5d2b0a6dbacba31906798", + "sha256:65867d63f0fd1b500fa343d7798fa64e9e681b594e0a07dc934c13e76ee28fb1", + "sha256:672b539db20fef6b03d6f7a14b5825d57c98e4026401fce838849f8de73fe4d4", + "sha256:6843db0343e12e3f52cc58430ad559d850a53684f5b352540ca3f1bc56df0731", + "sha256:7057613efefd36cacabbdbcef010e0a9c20a88fc07eb3e616019ea1692fa5df4", + "sha256:76ada88d62eb24de7051c5157a1a78fd853cca9b91c0713c2e973e4196271d0c", + "sha256:837398c2ec00228679513802e3744d1e8e3cb1204aa6ad408b6aff081e99a487", + "sha256:8662aabfeab00cea149a3d1c2999b0731e70c6b5bac596d95d13f643e76d3d4e", + "sha256:95e9094162fa712f18b4f60896e34b621df99147c2cee216cfa8f022294e8e9f", + "sha256:99cc66b33c418cd579c0f03b77b94263c305c389cb0c6972dac420f24b3bf123", + "sha256:9b219511d8b64d3fa14261963933be34028ea0e57455baf6781fe399c2c3206c", + "sha256:ae8f34d50af2c2154035984b8b5fc5d9ed63f32fe615646ab435b05b132ca91b", + "sha256:b9aa9d8818c2e917fa2c105ad538e222a5bce59777133840b93134022a7ce650", + "sha256:bf44a9a0141a082e89c90e8d785b212a872db793a0080c20f6ae6e2a0ebf82ad", + "sha256:c0b48b98d79cf795b0916c57bebbc6d16bb43b9fc9b8c9f57f4cf05881904c75", + "sha256:da9d3c506f43e220336433dffe643fbfa40096d408cb9b7f2477892f369d5f82", + "sha256:e4082d832e36e7f9b2278bc774886ca8207346b99f278e54c9de4834f17232f7", + "sha256:e4b9b7af398c32e408c00eb4e0d33ced2f9121fd9fb978e6c1b57edd014a7d15", + "sha256:e613514a82539fc48291d01933951a13ae93b6b444a88782480be32245ed4afa", + "sha256:f5033952def24172e60493b68717792e3aebb387a8d186c43c020d9363ee7281" + ], + "version": "==1.14.2" }, "chardet": { "hashes": [ @@ -256,7 +248,7 @@ "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c", "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.8.1" }, "pytz": { @@ -297,7 +289,7 @@ "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.15.0" }, "soupsieve": { @@ -346,26 +338,26 @@ }, "yarl": { "hashes": [ - "sha256:04a54f126a0732af75e5edc9addeaa2113e2ca7c6fce8974a63549a70a25e50e", - "sha256:3cc860d72ed989f3b1f3abbd6ecf38e412de722fb38b8f1b1a086315cf0d69c5", - "sha256:5d84cc36981eb5a8533be79d6c43454c8e6a39ee3118ceaadbd3c029ab2ee580", - "sha256:5e447e7f3780f44f890360ea973418025e8c0cdcd7d6a1b221d952600fd945dc", - "sha256:61d3ea3c175fe45f1498af868879c6ffeb989d4143ac542163c45538ba5ec21b", - "sha256:67c5ea0970da882eaf9efcf65b66792557c526f8e55f752194eff8ec722c75c2", - "sha256:6f6898429ec3c4cfbef12907047136fd7b9e81a6ee9f105b45505e633427330a", - "sha256:7ce35944e8e61927a8f4eb78f5bc5d1e6da6d40eadd77e3f79d4e9399e263921", - "sha256:b7c199d2cbaf892ba0f91ed36d12ff41ecd0dde46cbf64ff4bfe997a3ebc925e", - "sha256:c15d71a640fb1f8e98a1423f9c64d7f1f6a3a168f803042eaf3a5b5022fde0c1", - "sha256:c22607421f49c0cb6ff3ed593a49b6a99c6ffdeaaa6c944cdda83c2393c8864d", - "sha256:c604998ab8115db802cc55cb1b91619b2831a6128a62ca7eea577fc8ea4d3131", - "sha256:d088ea9319e49273f25b1c96a3763bf19a882cff774d1792ae6fba34bd40550a", - "sha256:db9eb8307219d7e09b33bcb43287222ef35cbcf1586ba9472b0a4b833666ada1", - "sha256:e31fef4e7b68184545c3d68baec7074532e077bd1906b040ecfba659737df188", - "sha256:e32f0fb443afcfe7f01f95172b66f279938fbc6bdaebe294b0ff6747fb6db020", - "sha256:fcbe419805c9b20db9a51d33b942feddbf6e7fb468cb20686fd7089d4164c12a" + "sha256:040b237f58ff7d800e6e0fd89c8439b841f777dd99b4a9cca04d6935564b9409", + "sha256:17668ec6722b1b7a3a05cc0167659f6c95b436d25a36c2d52db0eca7d3f72593", + "sha256:3a584b28086bc93c888a6c2aa5c92ed1ae20932f078c46509a66dce9ea5533f2", + "sha256:4439be27e4eee76c7632c2427ca5e73703151b22cae23e64adb243a9c2f565d8", + "sha256:48e918b05850fffb070a496d2b5f97fc31d15d94ca33d3d08a4f86e26d4e7c5d", + "sha256:9102b59e8337f9874638fcfc9ac3734a0cfadb100e47d55c20d0dc6087fb4692", + "sha256:9b930776c0ae0c691776f4d2891ebc5362af86f152dd0da463a6614074cb1b02", + "sha256:b3b9ad80f8b68519cc3372a6ca85ae02cc5a8807723ac366b53c0f089db19e4a", + "sha256:bc2f976c0e918659f723401c4f834deb8a8e7798a71be4382e024bcc3f7e23a8", + "sha256:c22c75b5f394f3d47105045ea551e08a3e804dc7e01b37800ca35b58f856c3d6", + "sha256:c52ce2883dc193824989a9b97a76ca86ecd1fa7955b14f87bf367a61b6232511", + "sha256:ce584af5de8830d8701b8979b18fcf450cef9a382b1a3c8ef189bedc408faf1e", + "sha256:da456eeec17fa8aa4594d9a9f27c0b1060b6a75f2419fe0c00609587b2695f4a", + "sha256:db6db0f45d2c63ddb1a9d18d1b9b22f308e52c83638c26b422d520a815c4b3fb", + "sha256:df89642981b94e7db5596818499c4b2219028f2a528c9c37cc1de45bf2fd3a3f", + "sha256:f18d68f2be6bf0e89f1521af2b1bb46e66ab0018faafa81d70f358153170a317", + "sha256:f379b7f83f23fe12823085cd6b906edc49df969eb99757f58ff382349a3303c6" ], "markers": "python_version >= '3.5'", - "version": "==1.6.0" + "version": "==1.5.1" } }, "develop": { @@ -378,11 +370,11 @@ }, "attrs": { "hashes": [ - "sha256:26b54ddbbb9ee1d34d5d3668dd37d6cf74990ab23c828c2888dccdceee395594", - "sha256:fce7fc47dfc976152e82d53ff92fa0407700c21acd20886a13777a0d20e655dc" + "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c", + "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==20.2.0" + "version": "==19.3.0" }, "cfgv": { "hashes": [ @@ -411,16 +403,16 @@ "sha256:15e351d19611c887e482fb960eae4d44845013cc142d42896e9862f775d8cf5c", "sha256:f04b9fcbac03b0a3e58c0ab3a0ecc462e023a9faf046d57794184028123aa208" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "index": "pypi", "version": "==3.8.3" }, "flake8-annotations": { "hashes": [ - "sha256:09fe1aa3f40cb8fef632a0ab3614050a7584bb884b6134e70cf1fc9eeee642fa", - "sha256:5bda552f074fd6e34276c7761756fa07d824ffac91ce9c0a8555eb2bc5b92d7a" + "sha256:7816a5d8f65ffdf37b8e21e5b17e0fd1e492aa92638573276de066e889a22b26", + "sha256:8d18db74a750dd97f40b483cc3ef80d07d03f687525bad8fd83365dcd3bfd414" ], "index": "pypi", - "version": "==2.4.0" + "version": "==2.3.0" }, "flake8-bugbear": { "hashes": [ @@ -478,11 +470,11 @@ }, "identify": { "hashes": [ - "sha256:7c22c384a2c9b32c5cc891d13f923f6b2653aa83e2d75d8f79be240d6c86c4f4", - "sha256:da683bfb7669fa749fc7731f378229e2dbf29a1d1337cbde04106f02236eb29d" + "sha256:69c4769f085badafd0e04b1763e847258cbbf6d898e8678ebffc91abdb86f6c6", + "sha256:d6ae6daee50ba1b493e9ca4d36a5edd55905d2cf43548fdc20b2a14edef102e7" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.5.5" + "version": "==1.4.28" }, "mccabe": { "hashes": [ @@ -493,10 +485,9 @@ }, "nodeenv": { "hashes": [ - "sha256:5304d424c529c997bc888453aeaa6362d242b6b4631e90f3d4bf1b290f1c84a9", - "sha256:ab45090ae383b716c4ef89e690c41ff8c2b257b85b309f01f3654df3d084bd7c" + "sha256:4b0b77afa3ba9b54f4b6396e60b0c83f59eaeb2d63dc3cc7a70f7f4af96c82bc" ], - "version": "==1.5.0" + "version": "==1.4.0" }, "pep8-naming": { "hashes": [ @@ -508,11 +499,11 @@ }, "pre-commit": { "hashes": [ - "sha256:810aef2a2ba4f31eed1941fc270e72696a1ad5590b9751839c90807d0fff6b9a", - "sha256:c54fd3e574565fe128ecc5e7d2f91279772ddb03f8729645fa812fe809084a70" + "sha256:1657663fdd63a321a4a739915d7d03baedd555b25054449090f97bb0cb30a915", + "sha256:e8b1315c585052e729ab7e99dcca5698266bedce9067d21dc909c23e3ceed626" ], "index": "pypi", - "version": "==2.7.1" + "version": "==2.6.0" }, "pycodestyle": { "hashes": [ @@ -524,11 +515,11 @@ }, "pydocstyle": { "hashes": [ - "sha256:19b86fa8617ed916776a11cd8bc0197e5b9856d5433b777f51a3defe13075325", - "sha256:aca749e190a01726a4fb472dd4ef23b5c9da7b9205c0a7857c06533de13fd678" + "sha256:da7831660b7355307b32778c4a0dbfb137d89254ef31a2b2978f50fc0b4d7586", + "sha256:f4f5d210610c2d153fae39093d44224c17429e2ad7da12a8b419aba5c2f614b5" ], "markers": "python_version >= '3.5'", - "version": "==5.1.1" + "version": "==5.0.2" }, "pyflakes": { "hashes": [ @@ -560,7 +551,7 @@ "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.15.0" }, "snowballstemmer": { @@ -579,11 +570,11 @@ }, "virtualenv": { "hashes": [ - "sha256:43add625c53c596d38f971a465553f6318decc39d98512bc100fa1b1e839c8dc", - "sha256:e0305af10299a7fb0d69393d8f04cb2965dda9351140d11ac8db4e5e3970451b" + "sha256:7b54fd606a1b85f83de49ad8d80dbec08e983a2d2f96685045b262ebc7481ee5", + "sha256:8cd7b2a4850b003a11be2fc213e206419efab41115cc14bca20e69654f2ac08e" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==20.0.31" + "version": "==20.0.30" } } } -- cgit v1.2.3 From 3534937b2563b96d5f5aebe5389ef5e4b3f3c4c8 Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Tue, 29 Sep 2020 13:32:57 +0530 Subject: added github url of seasonal bot --- bot/constants.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bot/constants.py b/bot/constants.py index 7c8f72cb..417f384c 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -265,3 +265,6 @@ POSITIVE_REPLIES = [ class Wikipedia: total_chance = 3 + +class Source: + github = "https://github.com/python-discord/seasonalbot" -- cgit v1.2.3 From bd3dd9fa32a4f871b7033f0d322e5b675d51b8b1 Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Tue, 29 Sep 2020 13:41:59 +0530 Subject: added source command --- bot/exts/evergreen/source.py | 126 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 bot/exts/evergreen/source.py diff --git a/bot/exts/evergreen/source.py b/bot/exts/evergreen/source.py new file mode 100644 index 00000000..164430e2 --- /dev/null +++ b/bot/exts/evergreen/source.py @@ -0,0 +1,126 @@ +import inspect +from pathlib import Path +from typing import Optional, Tuple, Union + +from discord import Embed +from discord.ext import commands + +from bot.constants import Source + +SourceType = Union[commands.HelpCommand, commands.Command, commands.Cog, str, commands.ExtensionNotLoaded] + + +class SourceConverter(commands.Converter): + """Convert an argument into a help command, tag, command, or cog.""" + + async def convert(self, ctx: commands.Context, argument: str) -> SourceType: + """Convert argument into source object.""" + cog = ctx.bot.get_cog(argument) + if cog: + return cog + + cmd = ctx.bot.get_command(argument) + if cmd: + return cmd + + raise commands.BadArgument( + f"Unable to convert `{argument}` to valid command or Cog." + ) + + +class BotSource(commands.Cog): + """Displays information about the bot's source code.""" + + def __init__(self, bot: commands.Bot): + self.bot = bot + + @commands.command(name="source", aliases=("src",)) + async def source_command(self, ctx: commands.Context, *, source_item: SourceConverter = None) -> None: + """Display information and a GitHub link to the source code of a command, tag, or cog.""" + if not source_item: + embed = Embed(title="Bot's GitHub Repository") + embed.add_field(name="Repository", value=f"[Go to GitHub]({Source.github})") + embed.set_thumbnail(url="https://avatars1.githubusercontent.com/u/9919") + await ctx.send(embed=embed) + return + + embed = await self.build_embed(source_item) + await ctx.send(embed=embed) + + def get_source_link(self, source_item: SourceType) -> Tuple[str, str, Optional[int]]: + """ + Build GitHub link of source item, return this link, file location and first line number. + + Raise BadArgument if `source_item` is a dynamically-created object (e.g. via internal eval). + """ + if isinstance(source_item, commands.Command): + if source_item.cog_name == "Alias": + cmd_name = source_item.callback.__name__.replace("_alias", "") + cmd = self.bot.get_command(cmd_name.replace("_", " ")) + src = cmd.callback.__code__ + filename = src.co_filename + else: + src = source_item.callback.__code__ + filename = src.co_filename + else: + src = type(source_item) + try: + filename = inspect.getsourcefile(src) + except TypeError: + raise commands.BadArgument("Cannot get source for a dynamically-created object.") + + if not isinstance(source_item, str): + try: + lines, first_line_no = inspect.getsourcelines(src) + except OSError: + raise commands.BadArgument("Cannot get source for a dynamically-created object.") + + lines_extension = f"#L{first_line_no}-L{first_line_no+len(lines)-1}" + else: + first_line_no = None + lines_extension = "" + + # Handle tag file location differently than others to avoid errors in some cases + if not first_line_no: + file_location = Path(filename).relative_to("/bot/") + else: + file_location = Path(filename).relative_to(Path.cwd()).as_posix() + + url = f"{Source.github}/blob/master/{file_location}{lines_extension}" + + return url, file_location, first_line_no or None + + async def build_embed(self, source_object: SourceType) -> Optional[Embed]: + """Build embed based on source object.""" + url, location, first_line = self.get_source_link(source_object) + + if isinstance(source_object, commands.HelpCommand): + title = "Help Command" + description = source_object.__doc__.splitlines()[1] + elif isinstance(source_object, commands.Command): + if source_object.cog_name == "Alias": + cmd_name = source_object.callback.__name__.replace("_alias", "") + cmd = self.bot.get_command(cmd_name.replace("_", " ")) + description = cmd.short_doc + else: + description = source_object.short_doc + + title = f"Command: {source_object.qualified_name}" + elif isinstance(source_object, str): + title = f"Tag: {source_object}" + description = "" + else: + title = f"Cog: {source_object.qualified_name}" + description = source_object.description.splitlines()[0] + + embed = Embed(title=title, description=description) + embed.add_field(name="Source Code", value=f"[Go to GitHub]({url})") + line_text = f":{first_line}" if first_line else "" + embed.set_footer(text=f"{location}{line_text}") + + return embed + + +def setup(bot: commands.Bot) -> None: + """Load the BotSource cog.""" + bot.add_cog(BotSource(bot)) -- cgit v1.2.3 From e1e0e158e0b42b2bdb488646e8e86cb4a704c683 Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Thu, 1 Oct 2020 10:52:45 +0530 Subject: added source command --- bot/exts/evergreen/source.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bot/exts/evergreen/source.py b/bot/exts/evergreen/source.py index 164430e2..62b5f6bb 100644 --- a/bot/exts/evergreen/source.py +++ b/bot/exts/evergreen/source.py @@ -15,6 +15,9 @@ class SourceConverter(commands.Converter): async def convert(self, ctx: commands.Context, argument: str) -> SourceType: """Convert argument into source object.""" + if argument.lower().startswith("help"): + return ctx.bot.help_command + cog = ctx.bot.get_cog(argument) if cog: return cog @@ -38,9 +41,9 @@ class BotSource(commands.Cog): async def source_command(self, ctx: commands.Context, *, source_item: SourceConverter = None) -> None: """Display information and a GitHub link to the source code of a command, tag, or cog.""" if not source_item: - embed = Embed(title="Bot's GitHub Repository") + embed = Embed(title="Seasonal Bot's GitHub Repository") embed.add_field(name="Repository", value=f"[Go to GitHub]({Source.github})") - embed.set_thumbnail(url="https://avatars1.githubusercontent.com/u/9919") + embed.set_thumbnail(url="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png") await ctx.send(embed=embed) return @@ -114,6 +117,7 @@ class BotSource(commands.Cog): description = source_object.description.splitlines()[0] embed = Embed(title=title, description=description) + embed.set_thumbnail(url="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png") embed.add_field(name="Source Code", value=f"[Go to GitHub]({url})") line_text = f":{first_line}" if first_line else "" embed.set_footer(text=f"{location}{line_text}") -- cgit v1.2.3 From 8f5494727d81be7190537f130ef9b384c9e72285 Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Thu, 1 Oct 2020 13:44:09 +0530 Subject: inital commit --- bot/exts/evergreen/emoji_count.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 bot/exts/evergreen/emoji_count.py diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py new file mode 100644 index 00000000..b619f349 --- /dev/null +++ b/bot/exts/evergreen/emoji_count.py @@ -0,0 +1,29 @@ +import logging + +from discord.ext import commands + +log = logging.getLogger(__name__) + + +class EmojiCount(commands.Cog): + """Command that give random emoji based on category.""" + + def __init__(self, bot: commands.Bot): + self.bot = bot + + @commands.command(name="ec") + async def ec(self, ctx, emoj: str): + """Returns embed with emoji category and info given by user.""" + emoji = [] + for a in ctx.guild.emojis: + for n in a.name.split('_'): + if len(n) == 1: + pass + elif n.name[0] == emoji.lower(): + emoji.append(a) + await ctx.send(emoji) + + +def setup(bot: commands.Bot) -> None: + """Emoji Count Cog load.""" + bot.add_cog(EmojiCount(bot)) -- cgit v1.2.3 From 2e8a0396586dfdb9eaff8a308ef39736ccdaffb3 Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Thu, 1 Oct 2020 19:00:56 +0530 Subject: removed --- bot/exts/evergreen/emoji_count.py | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 bot/exts/evergreen/emoji_count.py diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py deleted file mode 100644 index b619f349..00000000 --- a/bot/exts/evergreen/emoji_count.py +++ /dev/null @@ -1,29 +0,0 @@ -import logging - -from discord.ext import commands - -log = logging.getLogger(__name__) - - -class EmojiCount(commands.Cog): - """Command that give random emoji based on category.""" - - def __init__(self, bot: commands.Bot): - self.bot = bot - - @commands.command(name="ec") - async def ec(self, ctx, emoj: str): - """Returns embed with emoji category and info given by user.""" - emoji = [] - for a in ctx.guild.emojis: - for n in a.name.split('_'): - if len(n) == 1: - pass - elif n.name[0] == emoji.lower(): - emoji.append(a) - await ctx.send(emoji) - - -def setup(bot: commands.Bot) -> None: - """Emoji Count Cog load.""" - bot.add_cog(EmojiCount(bot)) -- cgit v1.2.3 From 1f2d9a09b4aabbae0f5859ea0d909e80aaef194a Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Fri, 2 Oct 2020 16:53:59 +0530 Subject: added embed_builder_method,error_embed_method --- bot/exts/evergreen/emoji_count.py | 80 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 bot/exts/evergreen/emoji_count.py diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py new file mode 100644 index 00000000..2f20dbed --- /dev/null +++ b/bot/exts/evergreen/emoji_count.py @@ -0,0 +1,80 @@ +import datetime +import logging +import random +from typing import Dict, Optional + +import discord +from discord.ext import commands + +from bot.constants import Colours + +log = logging.getLogger(__name__) + + +class EmojiCount(commands.Cog): + """Command that give random emoji based on category.""" + + def __init__(self, bot: commands.Bot): + self.bot = bot + + def embed_builder(self, emoji: dict) -> discord.Embed: + """Genrates embed with emoji name and count.""" + embed = discord.Embed() + embed.color = Colours.orange + embed.title = "Emoji Count" + embed.timestamp = datetime.datetime.utcnow() + if len(emoji) == 1: + for key, value in emoji.items(): + print(key) + embed.description = f"There are **{len(value)}** emojis in the **{key}** category" + embed.set_thumbnail(url=random.choice(value).url) + else: + msg = '' + for key, value in emoji.items(): + emoji_choice = random.choice(value) + error_msg = f'There are **{len(value)}** emojis in the **{key}** category\n' + msg += f'<:{emoji_choice.name}:{emoji_choice.id}> {error_msg}' + embed.description = msg + return embed + + @staticmethod + def generate_invalid_embed(ctx) -> discord.Embed: + """Genrates error embed.""" + embed = discord.Embed() + embed.color = Colours.soft_red + embed.title = "Invalid Input" + emoji_dict = {} + for emoji in ctx.guild.emojis: + emoji_dict.update({emoji.name.split("_")[0]: []}) + error_comp = ', '.join(key for key in emoji_dict.keys()) + embed.description = f"These are the valid categories\n```{error_comp}```" + return embed + + def emoji_list(self, ctx, emojis: dict) -> Dict: + """Genrates dictionary of emojis given by the user.""" + for emoji in ctx.guild.emojis: + for key, value in emojis.items(): + if emoji.name.split("_")[0] == key: + value.append(emoji) + return emojis + + @commands.command(name="ec") + async def ec(self, ctx, *, emoji: str = None) -> Optional[str]: + """Returns embed with emoji category and info given by user.""" + emoji_dict = {} + for a in ctx.guild.emojis: + if emoji is None: + emoji_dict.update({a.name.split("_")[0]: []}) + elif a.name.split("_")[0] in emoji: + emoji_dict.update({a.name.split("_")[0]: []}) + emoji_dict = self.emoji_list(ctx, emoji_dict) + if len(emoji_dict) == 0: + embed = self.generate_invalid_embed(ctx) + else: + embed = self.embed_builder(emoji_dict) + await ctx.send(embed=embed) + + +def setup(bot: commands.Bot) -> None: + """Emoji Count Cog load.""" + bot.add_cog(EmojiCount(bot)) -- cgit v1.2.3 From c9cdb2b5005bd20f881b5b7d2ed5fcef0d66b0c9 Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Fri, 2 Oct 2020 17:03:07 +0530 Subject: added logging --- bot/exts/evergreen/emoji_count.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py index 2f20dbed..a90c1b7d 100644 --- a/bot/exts/evergreen/emoji_count.py +++ b/bot/exts/evergreen/emoji_count.py @@ -35,6 +35,7 @@ class EmojiCount(commands.Cog): error_msg = f'There are **{len(value)}** emojis in the **{key}** category\n' msg += f'<:{emoji_choice.name}:{emoji_choice.id}> {error_msg}' embed.description = msg + log.trace('Emoji embed sent') return embed @staticmethod @@ -48,6 +49,7 @@ class EmojiCount(commands.Cog): emoji_dict.update({emoji.name.split("_")[0]: []}) error_comp = ', '.join(key for key in emoji_dict.keys()) embed.description = f"These are the valid categories\n```{error_comp}```" + log.trace("Error embed sent") return embed def emoji_list(self, ctx, emojis: dict) -> Dict: @@ -56,6 +58,7 @@ class EmojiCount(commands.Cog): for key, value in emojis.items(): if emoji.name.split("_")[0] == key: value.append(emoji) + log.trace("Emoji dict sent") return emojis @commands.command(name="ec") @@ -64,15 +67,20 @@ class EmojiCount(commands.Cog): emoji_dict = {} for a in ctx.guild.emojis: if emoji is None: + log.trace("Emoji Category doesn't provided by the user") emoji_dict.update({a.name.split("_")[0]: []}) elif a.name.split("_")[0] in emoji: + log.trace("Emoji Category provided by the user") emoji_dict.update({a.name.split("_")[0]: []}) emoji_dict = self.emoji_list(ctx, emoji_dict) if len(emoji_dict) == 0: embed = self.generate_invalid_embed(ctx) + log.trace("Error embed received") else: embed = self.embed_builder(emoji_dict) + log.trace("Emoji embed received") await ctx.send(embed=embed) + log.trace("Embed sent") def setup(bot: commands.Bot) -> None: -- cgit v1.2.3 From e9de05b77f886dffacca9cdee53dd1a424913fb9 Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Fri, 2 Oct 2020 17:25:49 +0530 Subject: added ctx annotation --- bot/exts/evergreen/emoji_count.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py index a90c1b7d..fa0879ae 100644 --- a/bot/exts/evergreen/emoji_count.py +++ b/bot/exts/evergreen/emoji_count.py @@ -39,7 +39,7 @@ class EmojiCount(commands.Cog): return embed @staticmethod - def generate_invalid_embed(ctx) -> discord.Embed: + def generate_invalid_embed(ctx: commands.Context) -> discord.Embed: """Genrates error embed.""" embed = discord.Embed() embed.color = Colours.soft_red @@ -52,7 +52,7 @@ class EmojiCount(commands.Cog): log.trace("Error embed sent") return embed - def emoji_list(self, ctx, emojis: dict) -> Dict: + def emoji_list(self, ctx: commands.Context, emojis: dict) -> Dict: """Genrates dictionary of emojis given by the user.""" for emoji in ctx.guild.emojis: for key, value in emojis.items(): @@ -62,7 +62,7 @@ class EmojiCount(commands.Cog): return emojis @commands.command(name="ec") - async def ec(self, ctx, *, emoji: str = None) -> Optional[str]: + async def ec(self, ctx: commands.Context, *, emoji: str = None) -> Optional[str]: """Returns embed with emoji category and info given by user.""" emoji_dict = {} for a in ctx.guild.emojis: -- cgit v1.2.3 From 8cc34b61f59f685344654d35791d0a722dd3d735 Mon Sep 17 00:00:00 2001 From: Anubhav <57266248+Anubhav1603@users.noreply.github.com> Date: Fri, 2 Oct 2020 18:06:06 +0530 Subject: Update bot/exts/evergreen/emoji_count.py Co-authored-by: Matteo Bertucci --- bot/exts/evergreen/emoji_count.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py index fa0879ae..2e6c5638 100644 --- a/bot/exts/evergreen/emoji_count.py +++ b/bot/exts/evergreen/emoji_count.py @@ -18,7 +18,7 @@ class EmojiCount(commands.Cog): self.bot = bot def embed_builder(self, emoji: dict) -> discord.Embed: - """Genrates embed with emoji name and count.""" + """Generates an embed with the emoji names and count.""" embed = discord.Embed() embed.color = Colours.orange embed.title = "Emoji Count" -- cgit v1.2.3 From 7cf5afb3ac29b9752e4b89da7b0c8dacd4e6313a Mon Sep 17 00:00:00 2001 From: Anubhav <57266248+Anubhav1603@users.noreply.github.com> Date: Fri, 2 Oct 2020 18:07:43 +0530 Subject: Update bot/exts/evergreen/emoji_count.py Co-authored-by: Matteo Bertucci --- bot/exts/evergreen/emoji_count.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py index 2e6c5638..4b35c619 100644 --- a/bot/exts/evergreen/emoji_count.py +++ b/bot/exts/evergreen/emoji_count.py @@ -67,7 +67,7 @@ class EmojiCount(commands.Cog): emoji_dict = {} for a in ctx.guild.emojis: if emoji is None: - log.trace("Emoji Category doesn't provided by the user") + log.trace("Emoji Category not provided by the user") emoji_dict.update({a.name.split("_")[0]: []}) elif a.name.split("_")[0] in emoji: log.trace("Emoji Category provided by the user") -- cgit v1.2.3 From 40f0c0e5b5c361ca3acf5e39b55470d2b9ea0bc4 Mon Sep 17 00:00:00 2001 From: Anubhav <57266248+Anubhav1603@users.noreply.github.com> Date: Fri, 2 Oct 2020 18:10:04 +0530 Subject: removed update and added data to dict directly Co-authored-by: Matteo Bertucci --- bot/exts/evergreen/emoji_count.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py index 4b35c619..e9bd8c35 100644 --- a/bot/exts/evergreen/emoji_count.py +++ b/bot/exts/evergreen/emoji_count.py @@ -46,7 +46,7 @@ class EmojiCount(commands.Cog): embed.title = "Invalid Input" emoji_dict = {} for emoji in ctx.guild.emojis: - emoji_dict.update({emoji.name.split("_")[0]: []}) + emoji_dict[emoji.name.split("_")[0]] = [] error_comp = ', '.join(key for key in emoji_dict.keys()) embed.description = f"These are the valid categories\n```{error_comp}```" log.trace("Error embed sent") -- cgit v1.2.3 From 1c5f5837714b71ef93ee9eeac32e74df09a585d9 Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Fri, 2 Oct 2020 18:15:41 +0530 Subject: changed error_msg to emoji_info --- bot/exts/evergreen/emoji_count.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py index fa0879ae..95e4c927 100644 --- a/bot/exts/evergreen/emoji_count.py +++ b/bot/exts/evergreen/emoji_count.py @@ -32,8 +32,8 @@ class EmojiCount(commands.Cog): msg = '' for key, value in emoji.items(): emoji_choice = random.choice(value) - error_msg = f'There are **{len(value)}** emojis in the **{key}** category\n' - msg += f'<:{emoji_choice.name}:{emoji_choice.id}> {error_msg}' + emoji_info = f'There are **{len(value)}** emojis in the **{key}** category\n' + msg += f'<:{emoji_choice.name}:{emoji_choice.id}> {emoji_info}' embed.description = msg log.trace('Emoji embed sent') return embed @@ -61,7 +61,7 @@ class EmojiCount(commands.Cog): log.trace("Emoji dict sent") return emojis - @commands.command(name="ec") + @commands.command(name="emoji_count", aliases=["ec"]) async def ec(self, ctx: commands.Context, *, emoji: str = None) -> Optional[str]: """Returns embed with emoji category and info given by user.""" emoji_dict = {} -- cgit v1.2.3 From 480cc1b56077c76b42c9102ae6320c4801b1719b Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Fri, 2 Oct 2020 18:31:40 +0530 Subject: removed print statement,changed logging msg and changed emoji list --- bot/exts/evergreen/emoji_count.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py index 95e4c927..ecdb12fa 100644 --- a/bot/exts/evergreen/emoji_count.py +++ b/bot/exts/evergreen/emoji_count.py @@ -6,7 +6,7 @@ from typing import Dict, Optional import discord from discord.ext import commands -from bot.constants import Colours +from bot.constants import Colours, ERROR_REPLIES log = logging.getLogger(__name__) @@ -25,7 +25,6 @@ class EmojiCount(commands.Cog): embed.timestamp = datetime.datetime.utcnow() if len(emoji) == 1: for key, value in emoji.items(): - print(key) embed.description = f"There are **{len(value)}** emojis in the **{key}** category" embed.set_thumbnail(url=random.choice(value).url) else: @@ -35,7 +34,7 @@ class EmojiCount(commands.Cog): emoji_info = f'There are **{len(value)}** emojis in the **{key}** category\n' msg += f'<:{emoji_choice.name}:{emoji_choice.id}> {emoji_info}' embed.description = msg - log.trace('Emoji embed sent') + log.trace('Emoji embed built') return embed @staticmethod @@ -43,23 +42,25 @@ class EmojiCount(commands.Cog): """Genrates error embed.""" embed = discord.Embed() embed.color = Colours.soft_red - embed.title = "Invalid Input" + embed.title = random.choice(ERROR_REPLIES) emoji_dict = {} for emoji in ctx.guild.emojis: emoji_dict.update({emoji.name.split("_")[0]: []}) error_comp = ', '.join(key for key in emoji_dict.keys()) embed.description = f"These are the valid categories\n```{error_comp}```" - log.trace("Error embed sent") + log.trace("Error embed built") return embed - def emoji_list(self, ctx: commands.Context, emojis: dict) -> Dict: - """Genrates dictionary of emojis given by the user.""" + def emoji_list(self, ctx, categories) -> Dict: + """Generates an embed with the emoji names and count.""" + out = {category: [] for category in categories} + for emoji in ctx.guild.emojis: - for key, value in emojis.items(): - if emoji.name.split("_")[0] == key: - value.append(emoji) - log.trace("Emoji dict sent") - return emojis + category = emoji.name.split('_')[0] + if category in out: + out[category].append(emoji) + log.trace("Emoji dict built") + return out @commands.command(name="emoji_count", aliases=["ec"]) async def ec(self, ctx: commands.Context, *, emoji: str = None) -> Optional[str]: -- cgit v1.2.3 From d4b4885751a0830f684ac8cd95636abe2439b432 Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Fri, 2 Oct 2020 18:34:41 +0530 Subject: added annotation --- bot/exts/evergreen/emoji_count.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py index ecdb12fa..c303cb7e 100644 --- a/bot/exts/evergreen/emoji_count.py +++ b/bot/exts/evergreen/emoji_count.py @@ -51,7 +51,7 @@ class EmojiCount(commands.Cog): log.trace("Error embed built") return embed - def emoji_list(self, ctx, categories) -> Dict: + def emoji_list(self, ctx: commands.Context, categories: dict) -> Dict: """Generates an embed with the emoji names and count.""" out = {category: [] for category in categories} @@ -64,7 +64,7 @@ class EmojiCount(commands.Cog): @commands.command(name="emoji_count", aliases=["ec"]) async def ec(self, ctx: commands.Context, *, emoji: str = None) -> Optional[str]: - """Returns embed with emoji category and info given by user.""" + """Returns embed with emoji category and info given by the user.""" emoji_dict = {} for a in ctx.guild.emojis: if emoji is None: -- cgit v1.2.3 From 276d3631ac260ac21f0825dba8aff9dfa0c107c0 Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Fri, 2 Oct 2020 19:13:48 +0530 Subject: added github_avatar_url --- bot/constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bot/constants.py b/bot/constants.py index 417f384c..a0c9f31e 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -268,3 +268,4 @@ class Wikipedia: class Source: github = "https://github.com/python-discord/seasonalbot" + github_avatar_url = "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" -- cgit v1.2.3 From 696dce383d4fddb9fe1767ce014a1ca264a8758b Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Fri, 2 Oct 2020 19:15:08 +0530 Subject: removed aliases and default help command --- bot/exts/evergreen/source.py | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/bot/exts/evergreen/source.py b/bot/exts/evergreen/source.py index 62b5f6bb..206cf258 100644 --- a/bot/exts/evergreen/source.py +++ b/bot/exts/evergreen/source.py @@ -7,7 +7,7 @@ from discord.ext import commands from bot.constants import Source -SourceType = Union[commands.HelpCommand, commands.Command, commands.Cog, str, commands.ExtensionNotLoaded] +SourceType = Union[commands.Command, commands.Cog, str, commands.ExtensionNotLoaded] class SourceConverter(commands.Converter): @@ -15,9 +15,6 @@ class SourceConverter(commands.Converter): async def convert(self, ctx: commands.Context, argument: str) -> SourceType: """Convert argument into source object.""" - if argument.lower().startswith("help"): - return ctx.bot.help_command - cog = ctx.bot.get_cog(argument) if cog: return cog @@ -43,7 +40,7 @@ class BotSource(commands.Cog): if not source_item: embed = Embed(title="Seasonal Bot's GitHub Repository") embed.add_field(name="Repository", value=f"[Go to GitHub]({Source.github})") - embed.set_thumbnail(url="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png") + embed.set_thumbnail(url=Source.github_avatar_url) await ctx.send(embed=embed) return @@ -57,14 +54,8 @@ class BotSource(commands.Cog): Raise BadArgument if `source_item` is a dynamically-created object (e.g. via internal eval). """ if isinstance(source_item, commands.Command): - if source_item.cog_name == "Alias": - cmd_name = source_item.callback.__name__.replace("_alias", "") - cmd = self.bot.get_command(cmd_name.replace("_", " ")) - src = cmd.callback.__code__ - filename = src.co_filename - else: - src = source_item.callback.__code__ - filename = src.co_filename + src = source_item.callback.__code__ + filename = src.co_filename else: src = type(source_item) try: @@ -97,27 +88,19 @@ class BotSource(commands.Cog): """Build embed based on source object.""" url, location, first_line = self.get_source_link(source_object) - if isinstance(source_object, commands.HelpCommand): - title = "Help Command" - description = source_object.__doc__.splitlines()[1] - elif isinstance(source_object, commands.Command): - if source_object.cog_name == "Alias": - cmd_name = source_object.callback.__name__.replace("_alias", "") - cmd = self.bot.get_command(cmd_name.replace("_", " ")) - description = cmd.short_doc + if isinstance(source_object, commands.Command): + if source_object.cog_name == 'Help': + title = "Help Command" + description = source_object.__doc__.splitlines()[1] else: description = source_object.short_doc - - title = f"Command: {source_object.qualified_name}" - elif isinstance(source_object, str): - title = f"Tag: {source_object}" - description = "" + title = f"Command: {source_object.qualified_name}" else: title = f"Cog: {source_object.qualified_name}" description = source_object.description.splitlines()[0] embed = Embed(title=title, description=description) - embed.set_thumbnail(url="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png") + embed.set_thumbnail(url=Source.github_avatar_url) embed.add_field(name="Source Code", value=f"[Go to GitHub]({url})") line_text = f":{first_line}" if first_line else "" embed.set_footer(text=f"{location}{line_text}") -- cgit v1.2.3 From 38968a545f3f237542448e4853d18e274c63e86d Mon Sep 17 00:00:00 2001 From: Anubhav <57266248+Anubhav1603@users.noreply.github.com> Date: Sat, 3 Oct 2020 12:44:19 +0530 Subject: Update bot/exts/evergreen/emoji_count.py Co-authored-by: ks129 <45097959+ks129@users.noreply.github.com> --- bot/exts/evergreen/emoji_count.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py index 3ad0d61b..b32fd0ed 100644 --- a/bot/exts/evergreen/emoji_count.py +++ b/bot/exts/evergreen/emoji_count.py @@ -40,9 +40,10 @@ class EmojiCount(commands.Cog): @staticmethod def generate_invalid_embed(ctx: commands.Context) -> discord.Embed: """Genrates error embed.""" - embed = discord.Embed() - embed.color = Colours.soft_red - embed.title = random.choice(ERROR_REPLIES) + embed = discord.Embed( + color=Colours.soft_red, + title=random.choice(ERROR_REPLIES) + ) emoji_dict = {} for emoji in ctx.guild.emojis: emoji_dict[emoji.name.split("_")[0]] = [] -- cgit v1.2.3 From 33b2c6bb8de14d277709af3a24072d2b2e6e61f9 Mon Sep 17 00:00:00 2001 From: Anubhav <57266248+Anubhav1603@users.noreply.github.com> Date: Sat, 3 Oct 2020 12:44:32 +0530 Subject: Update bot/exts/evergreen/emoji_count.py Co-authored-by: ks129 <45097959+ks129@users.noreply.github.com> --- bot/exts/evergreen/emoji_count.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py index b32fd0ed..c8076922 100644 --- a/bot/exts/evergreen/emoji_count.py +++ b/bot/exts/evergreen/emoji_count.py @@ -19,10 +19,11 @@ class EmojiCount(commands.Cog): def embed_builder(self, emoji: dict) -> discord.Embed: """Generates an embed with the emoji names and count.""" - embed = discord.Embed() - embed.color = Colours.orange - embed.title = "Emoji Count" - embed.timestamp = datetime.datetime.utcnow() + embed = discord.Embed( + color=Colours.orange, + title="Emoji Count", + timestamp=datetime.datetime.utcnow() + ) if len(emoji) == 1: for key, value in emoji.items(): embed.description = f"There are **{len(value)}** emojis in the **{key}** category" -- cgit v1.2.3 From 3c418746112d020549fcbeac386aca0f18abebba Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Sat, 3 Oct 2020 12:51:25 +0530 Subject: changed github_avatar_url --- bot/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/constants.py b/bot/constants.py index a0c9f31e..a9c9e23e 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -268,4 +268,4 @@ class Wikipedia: class Source: github = "https://github.com/python-discord/seasonalbot" - github_avatar_url = "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" + github_avatar_url = "https://avatars1.githubusercontent.com/u/9919" -- cgit v1.2.3 From 7c76f01c8dacdcd954758bcb5078672a86286f2c Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Sat, 3 Oct 2020 13:23:58 +0530 Subject: removed unnecessary logging and added one space --- bot/exts/evergreen/emoji_count.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py index c8076922..70c5ff53 100644 --- a/bot/exts/evergreen/emoji_count.py +++ b/bot/exts/evergreen/emoji_count.py @@ -35,7 +35,6 @@ class EmojiCount(commands.Cog): emoji_info = f'There are **{len(value)}** emojis in the **{key}** category\n' msg += f'<:{emoji_choice.name}:{emoji_choice.id}> {emoji_info}' embed.description = msg - log.trace('Emoji embed built') return embed @staticmethod @@ -45,12 +44,13 @@ class EmojiCount(commands.Cog): color=Colours.soft_red, title=random.choice(ERROR_REPLIES) ) + emoji_dict = {} for emoji in ctx.guild.emojis: emoji_dict[emoji.name.split("_")[0]] = [] + error_comp = ', '.join(key for key in emoji_dict.keys()) embed.description = f"These are the valid categories\n```{error_comp}```" - log.trace("Error embed built") return embed def emoji_list(self, ctx: commands.Context, categories: dict) -> Dict: @@ -61,7 +61,6 @@ class EmojiCount(commands.Cog): category = emoji.name.split('_')[0] if category in out: out[category].append(emoji) - log.trace("Emoji dict built") return out @commands.command(name="emoji_count", aliases=["ec"]) @@ -78,12 +77,9 @@ class EmojiCount(commands.Cog): emoji_dict = self.emoji_list(ctx, emoji_dict) if len(emoji_dict) == 0: embed = self.generate_invalid_embed(ctx) - log.trace("Error embed received") else: embed = self.embed_builder(emoji_dict) - log.trace("Emoji embed received") await ctx.send(embed=embed) - log.trace("Embed sent") def setup(bot: commands.Bot) -> None: -- cgit v1.2.3 From fcc345ae802cfe7815e10bc13f972c6925f3c60f Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Sun, 4 Oct 2020 12:24:31 +0530 Subject: cleaned the code --- bot/exts/evergreen/emoji_count.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bot/exts/evergreen/emoji_count.py b/bot/exts/evergreen/emoji_count.py index 70c5ff53..ef900199 100644 --- a/bot/exts/evergreen/emoji_count.py +++ b/bot/exts/evergreen/emoji_count.py @@ -24,6 +24,7 @@ class EmojiCount(commands.Cog): title="Emoji Count", timestamp=datetime.datetime.utcnow() ) + if len(emoji) == 1: for key, value in emoji.items(): embed.description = f"There are **{len(value)}** emojis in the **{key}** category" @@ -67,6 +68,7 @@ class EmojiCount(commands.Cog): async def ec(self, ctx: commands.Context, *, emoji: str = None) -> Optional[str]: """Returns embed with emoji category and info given by the user.""" emoji_dict = {} + for a in ctx.guild.emojis: if emoji is None: log.trace("Emoji Category not provided by the user") @@ -74,7 +76,9 @@ class EmojiCount(commands.Cog): elif a.name.split("_")[0] in emoji: log.trace("Emoji Category provided by the user") emoji_dict.update({a.name.split("_")[0]: []}) + emoji_dict = self.emoji_list(ctx, emoji_dict) + if len(emoji_dict) == 0: embed = self.generate_invalid_embed(ctx) else: -- cgit v1.2.3 From 2a415d883fa79d9c421cec07becf7c1f846788da Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Sun, 4 Oct 2020 12:35:37 +0530 Subject: removed tag handling --- bot/exts/evergreen/source.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bot/exts/evergreen/source.py b/bot/exts/evergreen/source.py index 206cf258..0725714f 100644 --- a/bot/exts/evergreen/source.py +++ b/bot/exts/evergreen/source.py @@ -74,11 +74,7 @@ class BotSource(commands.Cog): first_line_no = None lines_extension = "" - # Handle tag file location differently than others to avoid errors in some cases - if not first_line_no: - file_location = Path(filename).relative_to("/bot/") - else: - file_location = Path(filename).relative_to(Path.cwd()).as_posix() + file_location = Path(filename).relative_to(Path.cwd()).as_posix() url = f"{Source.github}/blob/master/{file_location}{lines_extension}" -- cgit v1.2.3