From 0d5da9e1304865034e8a2349d33b132e149ad890 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 5 Feb 2021 19:17:59 +0000 Subject: First pass of easy to produce errors --- bot/exts/easter/easter_riddle.py | 13 ++++++++++++- bot/exts/evergreen/issues.py | 7 ++++++- bot/exts/evergreen/wolfram.py | 3 ++- bot/exts/halloween/candy_collection.py | 3 +++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/bot/exts/easter/easter_riddle.py b/bot/exts/easter/easter_riddle.py index 3c612eb1..a93b3745 100644 --- a/bot/exts/easter/easter_riddle.py +++ b/bot/exts/easter/easter_riddle.py @@ -7,7 +7,7 @@ from pathlib import Path import discord from discord.ext import commands -from bot.constants import Colours +from bot.constants import Colours, NEGATIVE_REPLIES log = logging.getLogger(__name__) @@ -36,6 +36,17 @@ class EasterRiddle(commands.Cog): if self.current_channel: return await ctx.send(f"A riddle is already being solved in {self.current_channel.mention}!") + # Don't let users start in a DM + if not ctx.guild: + await ctx.send( + embed=discord.Embed( + title=random.choice(NEGATIVE_REPLIES), + description="You can't start riddles in DMs", + colour=discord.Colour.red() + ) + ) + return + self.current_channel = ctx.message.channel random_question = random.choice(RIDDLE_QUESTIONS) diff --git a/bot/exts/evergreen/issues.py b/bot/exts/evergreen/issues.py index 73ebe547..1f22f287 100644 --- a/bot/exts/evergreen/issues.py +++ b/bot/exts/evergreen/issues.py @@ -178,7 +178,12 @@ class Issues(commands.Cog): @commands.Cog.listener() async def on_message(self, message: discord.Message) -> None: """Command to retrieve issue(s) from a GitHub repository using automatic linking if matching #.""" - if not( + # Ignore messages from DMs + if not message.guild: + return + + # Ignore messages not in whitelisted categories / channels + if not ( message.channel.category.id in WHITELISTED_CATEGORIES or message.channel.id in WHITELISTED_CHANNELS_ON_MESSAGE ): diff --git a/bot/exts/evergreen/wolfram.py b/bot/exts/evergreen/wolfram.py index 898e8d2a..077a99f5 100644 --- a/bot/exts/evergreen/wolfram.py +++ b/bot/exts/evergreen/wolfram.py @@ -62,7 +62,8 @@ def custom_cooldown(*ignore: List[int]) -> Callable: # if the invoked command is help we don't want to increase the ratelimits since it's not actually # invoking the command/making a request, so instead just check if the user/guild are on cooldown. guild_cooldown = not guildcd.get_bucket(ctx.message).get_tokens() == 0 # if guild is on cooldown - if not any(r.id in ignore for r in ctx.author.roles): # check user bucket if user is not ignored + # check the message is in a guild, and check user bucket if user is not ignored + if ctx.guild and not any(r.id in ignore for r in ctx.author.roles): return guild_cooldown and not usercd.get_bucket(ctx.message).get_tokens() == 0 return guild_cooldown diff --git a/bot/exts/halloween/candy_collection.py b/bot/exts/halloween/candy_collection.py index 0cb37ecd..40e21f40 100644 --- a/bot/exts/halloween/candy_collection.py +++ b/bot/exts/halloween/candy_collection.py @@ -47,6 +47,9 @@ class CandyCollection(commands.Cog): @commands.Cog.listener() async def on_message(self, message: discord.Message) -> None: """Randomly adds candy or skull reaction to non-bot messages in the Event channel.""" + # Ignore messages in DMs + if not message.guild: + return # make sure its a human message if message.author.bot: return -- cgit v1.2.3 From c1df836a35ac942136a6fce7448bb5da03b7369b Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 14 Mar 2021 22:27:04 +0000 Subject: Separate deploy stage Separate the build and deploy stage and set the environment value for the deployment stage. --- .github/workflows/build.yaml | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 08721dfd..0a006eb9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,7 +11,7 @@ on: jobs: build: if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' - name: Build, Push, & Deploy Container + name: Build & Push runs-on: ubuntu-latest steps: @@ -28,15 +28,6 @@ jobs: with: path: sir-lancebot - # Check out the private "kubernetes" repository in the `kubernetes` - # subdirectory using a GitHub Personal Access Token - - name: Checkout code - uses: actions/checkout@v2 - with: - repository: python-discord/kubernetes - token: ${{ secrets.REPO_TOKEN }} - path: kubernetes - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 @@ -64,6 +55,29 @@ jobs: build-args: | git_sha=${{ github.sha }} + deploy: + needs: build + name: Deploy + runs-on: ubuntu-latest + environment: production + + steps: + # Create a commit SHA-based tag for the container repositories + - name: Create SHA Container Tag + id: sha_tag + run: | + tag=$(cut -c 1-7 <<< $GITHUB_SHA) + echo "::set-output name=tag::$tag" + + # Check out the private "kubernetes" repository in the `kubernetes` + # subdirectory using a GitHub Personal Access Token + - name: Checkout code + uses: actions/checkout@v2 + with: + repository: python-discord/kubernetes + token: ${{ secrets.REPO_TOKEN }} + path: kubernetes + - name: Authenticate with Kubernetes uses: azure/k8s-set-context@v1 with: -- cgit v1.2.3 From 521aeb14632db8b3e848cad632059d053219aecd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Mar 2021 21:35:02 +0000 Subject: Bump pillow from 7.2.0 to 8.1.1 Bumps [pillow](https://github.com/python-pillow/Pillow) from 7.2.0 to 8.1.1. - [Release notes](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst) - [Commits](https://github.com/python-pillow/Pillow/compare/7.2.0...8.1.1) Signed-off-by: dependabot[bot] --- Pipfile | 2 +- Pipfile.lock | 104 +++++++++++++++++++++++++---------------------------------- 2 files changed, 45 insertions(+), 61 deletions(-) diff --git a/Pipfile b/Pipfile index e7e01a31..2e922ec4 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ aiodns = "~=2.0" arrow = "~=0.14" beautifulsoup4 = "~=4.8" fuzzywuzzy = "~=0.17" -pillow = "~=7.2" +pillow = "~=8.1" pytz = "~=2019.2" sentry-sdk = "~=0.19" PyYAML = "~=5.3.1" diff --git a/Pipfile.lock b/Pipfile.lock index ec801979..d09588cf 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "b4aaaacbab13179145e36d7b86c736db512286f6cce8e513cc30c48d68fe3810" + "sha256": "cf7535796e0d4f4dd6a414d8db4781caaab4a624380d29abea17577209043742" }, "pipfile-spec": 6, "requires": { @@ -40,7 +40,6 @@ "sha256:c506853ba52e516b264b106321c424d03f3ddef2813246432fa9d1cefd361c81", "sha256:fb83326d8295e8840e4ba774edf346e87eca78ba8a89c55d2690352842c15ba5" ], - "markers": "python_full_version >= '3.5.3'", "version": "==3.6.3" }, "aioredis": { @@ -74,7 +73,6 @@ "sha256:0c3c816a028d47f659d6ff5c745cb2acf1f966da1fe5c19c77a70282b25f4c5f", "sha256:4291ca197d287d274d0b6cb5d6f8f8f82d434ed288f962539ff18cc9012f9ea3" ], - "markers": "python_full_version >= '3.5.3'", "version": "==3.0.1" }, "attrs": { @@ -82,7 +80,6 @@ "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6", "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==20.3.0" }, "beautifulsoup4": { @@ -233,7 +230,6 @@ "sha256:e64be68255234bb489a574c4f2f8df7029c98c81ec4d160d6cd836e7f0679390", "sha256:e82d6b930e02e80e5109b678c663a9ed210680ded81c1abaf54635d88d1da298" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.1.0" }, "idna": { @@ -241,7 +237,6 @@ "sha256:5205d03e7bcbb919cc9c19885f9920d622ca52448306f2377daede5cf3faac16", "sha256:c5b02147e01ea9920e6b0a3f1f7bb833612d507592c837a6c49552768f4054e1" ], - "markers": "python_version >= '3.4'", "version": "==3.1" }, "multidict": { @@ -264,42 +259,46 @@ "sha256:fcfbb44c59af3f8ea984de67ec7c306f618a3ec771c2843804069917a8f2e255", "sha256:feed85993dbdb1dbc29102f50bca65bdc68f2c0c8d352468c25b54874f23c39d" ], - "markers": "python_version >= '3.5'", "version": "==4.7.6" }, "pillow": { "hashes": [ - "sha256:0295442429645fa16d05bd567ef5cff178482439c9aad0411d3f0ce9b88b3a6f", - "sha256:06aba4169e78c439d528fdeb34762c3b61a70813527a2c57f0540541e9f433a8", - "sha256:09d7f9e64289cb40c2c8d7ad674b2ed6105f55dc3b09aa8e4918e20a0311e7ad", - "sha256:0a80dd307a5d8440b0a08bd7b81617e04d870e40a3e46a32d9c246e54705e86f", - "sha256:1ca594126d3c4def54babee699c055a913efb01e106c309fa6b04405d474d5ae", - "sha256:25930fadde8019f374400f7986e8404c8b781ce519da27792cbe46eabec00c4d", - "sha256:431b15cffbf949e89df2f7b48528be18b78bfa5177cb3036284a5508159492b5", - "sha256:52125833b070791fcb5710fabc640fc1df07d087fc0c0f02d3661f76c23c5b8b", - "sha256:5e51ee2b8114def244384eda1c82b10e307ad9778dac5c83fb0943775a653cd8", - "sha256:612cfda94e9c8346f239bf1a4b082fdd5c8143cf82d685ba2dba76e7adeeb233", - "sha256:6d7741e65835716ceea0fd13a7d0192961212fd59e741a46bbed7a473c634ed6", - "sha256:6edb5446f44d901e8683ffb25ebdfc26988ee813da3bf91e12252b57ac163727", - "sha256:725aa6cfc66ce2857d585f06e9519a1cc0ef6d13f186ff3447ab6dff0a09bc7f", - "sha256:8dad18b69f710bf3a001d2bf3afab7c432785d94fcf819c16b5207b1cfd17d38", - "sha256:94cf49723928eb6070a892cb39d6c156f7b5a2db4e8971cb958f7b6b104fb4c4", - "sha256:97f9e7953a77d5a70f49b9a48da7776dc51e9b738151b22dacf101641594a626", - "sha256:9ad7f865eebde135d526bb3163d0b23ffff365cf87e767c649550964ad72785d", - "sha256:9c87ef410a58dd54b92424ffd7e28fd2ec65d2f7fc02b76f5e9b2067e355ebf6", - "sha256:a060cf8aa332052df2158e5a119303965be92c3da6f2d93b6878f0ebca80b2f6", - "sha256:c79f9c5fb846285f943aafeafda3358992d64f0ef58566e23484132ecd8d7d63", - "sha256:c92302a33138409e8f1ad16731568c55c9053eee71bb05b6b744067e1b62380f", - "sha256:d08b23fdb388c0715990cbc06866db554e1822c4bdcf6d4166cf30ac82df8c41", - "sha256:d350f0f2c2421e65fbc62690f26b59b0bcda1b614beb318c81e38647e0f673a1", - "sha256:e901964262a56d9ea3c2693df68bc9860b8bdda2b04768821e4c44ae797de117", - "sha256:ec29604081f10f16a7aea809ad42e27764188fc258b02259a03a8ff7ded3808d", - "sha256:edf31f1150778abd4322444c393ab9c7bd2af271dd4dafb4208fb613b1f3cdc9", - "sha256:f7e30c27477dffc3e85c2463b3e649f751789e0f6c8456099eea7ddd53be4a8a", - "sha256:ffe538682dc19cc542ae7c3e504fdf54ca7f86fb8a135e59dd6bc8627eae6cce" + "sha256:01bb0a34f1a6689b138c0089d670ae2e8f886d2666a9b2f2019031abdea673c4", + "sha256:07872f1d8421db5a3fe770f7480835e5e90fddb58f36c216d4a2ac0d594de474", + "sha256:1022f8f6dc3c5b0dcf928f1c49ba2ac73051f576af100d57776e2b65c1f76a8d", + "sha256:14415e9e28410232370615dbde0cf0a00e526f522f665460344a5b96973a3086", + "sha256:172acfaf00434a28dddfe592d83f2980e22e63c769ff4a448ddf7b7a38ffd165", + "sha256:1c5e3c36f02c815766ae9dd91899b1c5b4652f2a37b7a51609f3bd467c0f11fb", + "sha256:292f2aa1ae5c5c1451cb4b558addb88c257411d3fd71c6cf45562911baffc979", + "sha256:2a40d7d4b17db87f5b9a1efc0aff56000e1d0d5ece415090c102aafa0ccbe858", + "sha256:2f0d7034d5faae9a8d1019d152ede924f653df2ce77d3bba4ce62cd21b5f94ae", + "sha256:33fdbd4f5608c852d97264f9d2e3b54e9e9959083d008145175b86100b275e5b", + "sha256:3b13d89d97b551e02549d1f0edf22bed6acfd6fd2e888cd1e9a953bf215f0e81", + "sha256:3e759bcc03d6f39bc751e56d86bc87252b9a21c689a27c5ed753717a87d53a5b", + "sha256:3ec87bd1248b23a2e4e19e774367fbe30fddc73913edc5f9b37470624f55dc1f", + "sha256:436b0a2dd9fe3f7aa6a444af6bdf53c1eb8f5ced9ea3ef104daa83f0ea18e7bc", + "sha256:43b3c859912e8bf754b3c5142df624794b18eb7ae07cfeddc917e1a9406a3ef2", + "sha256:4fe74636ee71c57a7f65d7b21a9f127d842b4fb75511e5d256ace258826eb352", + "sha256:59445af66b59cc39530b4f810776928d75e95f41e945f0c32a3de4aceb93c15d", + "sha256:69da5b1d7102a61ce9b45deb2920a2012d52fd8f4201495ea9411d0071b0ec22", + "sha256:7094bbdecb95ebe53166e4c12cf5e28310c2b550b08c07c5dc15433898e2238e", + "sha256:8211cac9bf10461f9e33fe9a3af6c5131f3fdd0d10672afc2abb2c70cf95c5ca", + "sha256:8cf77e458bd996dc85455f10fe443c0c946f5b13253773439bcbec08aa1aebc2", + "sha256:924fc33cb4acaf6267b8ca3b8f1922620d57a28470d5e4f49672cea9a841eb08", + "sha256:99ce3333b40b7a4435e0a18baad468d44ab118a4b1da0af0a888893d03253f1d", + "sha256:a7d690b2c5f7e4a932374615fedceb1e305d2dd5363c1de15961725fe10e7d16", + "sha256:b9af590adc1e46898a1276527f3cfe2da8048ae43fbbf9b1bf9395f6c99d9b47", + "sha256:bb18422ad00c1fecc731d06592e99c3be2c634da19e26942ba2f13d805005cf2", + "sha256:c10af40ee2f1a99e1ae755ab1f773916e8bca3364029a042cd9161c400416bd8", + "sha256:c143c409e7bc1db784471fe9d0bf95f37c4458e879ad84cfae640cb74ee11a26", + "sha256:c448d2b335e21951416a30cd48d35588d122a912d5fe9e41900afacecc7d21a1", + "sha256:d30f30c044bdc0ab8f3924e1eeaac87e0ff8a27e87369c5cac4064b6ec78fd83", + "sha256:df534e64d4f3e84e8f1e1a37da3f541555d947c1c1c09b32178537f0f243f69d", + "sha256:f6fc18f9c9c7959bf58e6faf801d14fafb6d4717faaf6f79a68c8bb2a13dcf20", + "sha256:ff83dfeb04c98bb3e7948f876c17513a34e9a19fd92e292288649164924c1b39" ], "index": "pypi", - "version": "==7.2.0" + "version": "==8.1.1" }, "pycares": { "hashes": [ @@ -340,7 +339,6 @@ "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0", "sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.20" }, "pynacl": { @@ -374,7 +372,6 @@ "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c", "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.8.1" }, "pytz": { @@ -409,7 +406,6 @@ "sha256:0e7e0cfca8660dea8b7d5cd8c4f6c5e29e11f31158c0b0ae91a397f00e5a05a2", "sha256:432b788c4530cfe16d8d943a09d40ca6c16149727e4afe8c2c9d5580c59d9f24" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", "version": "==3.5.3" }, "sentry-sdk": { @@ -425,7 +421,6 @@ "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.15.0" }, "sortedcontainers": { @@ -445,11 +440,10 @@ }, "urllib3": { "hashes": [ - "sha256:1b465e494e3e0d8939b50680403e3aedaa2bc434b7d5af64dfd3c958d7f5ae80", - "sha256:de3eedaad74a2683334e282005cd8d7f22f4d55fa690a2a1020a416cb0a47e73" + "sha256:2f4da4594db7e1e110a944bb1b551fdf4e6c136ad42e4234131391e21eb5b0df", + "sha256:e7b021f7241115872f92f43c6508082facffbd1c048e3c6e2bb9c2a157e28937" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", - "version": "==1.26.3" + "version": "==1.26.4" }, "yarl": { "hashes": [ @@ -471,7 +465,6 @@ "sha256:f18d68f2be6bf0e89f1521af2b1bb46e66ab0018faafa81d70f358153170a317", "sha256:f379b7f83f23fe12823085cd6b906edc49df969eb99757f58ff382349a3303c6" ], - "markers": "python_version >= '3.5'", "version": "==1.5.1" } }, @@ -488,7 +481,6 @@ "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6", "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==20.3.0" }, "cfgv": { @@ -496,7 +488,6 @@ "sha256:32e43d604bbe7896fe7c248a9c2276447dbef840feb28fe20494f62af110211d", "sha256:cf22deb93d4bcf92f345a5c3cd39d3d41d6340adc60c78bbbd6588c384fda6a1" ], - "markers": "python_full_version >= '3.6.1'", "version": "==3.2.0" }, "distlib": { @@ -585,11 +576,10 @@ }, "identify": { "hashes": [ - "sha256:de7129142a5c86d75a52b96f394d94d96d497881d2aaf8eafe320cdbe8ac4bcc", - "sha256:e0dae57c0397629ce13c289f6ddde0204edf518f557bfdb1e56474aa143e77c3" + "sha256:46d1816c6a4fc2d1e8758f293a5dcc1ae6404ab344179d7c1e73637bf283beb1", + "sha256:ed4a05fb80e3cbd12e83c959f9ff7f729ba6b66ab8d6178850fd5cb4c1cf6c5d" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.5.14" + "version": "==2.1.3" }, "mccabe": { "hashes": [ @@ -626,7 +616,6 @@ "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" }, "pydocstyle": { @@ -634,7 +623,6 @@ "sha256:19b86fa8617ed916776a11cd8bc0197e5b9856d5433b777f51a3defe13075325", "sha256:aca749e190a01726a4fb472dd4ef23b5c9da7b9205c0a7857c06533de13fd678" ], - "markers": "python_version >= '3.5'", "version": "==5.1.1" }, "pyflakes": { @@ -642,7 +630,6 @@ "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" }, "pyyaml": { @@ -669,7 +656,6 @@ "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.15.0" }, "snowballstemmer": { @@ -684,16 +670,14 @@ "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b", "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f" ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==0.10.2" }, "virtualenv": { "hashes": [ - "sha256:147b43894e51dd6bba882cf9c282447f780e2251cd35172403745fc381a0a80d", - "sha256:2be72df684b74df0ea47679a7df93fd0e04e72520022c57b479d8f881485dbe3" + "sha256:49ec4eb4c224c6f7dd81bb6d0a28a09ecae5894f4e593c89b0db0885f565a107", + "sha256:83f95875d382c7abafe06bd2a4cdd1b363e1bb77e02f155ebe8ac082a916b37c" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==20.4.2" + "version": "==20.4.3" } } } -- cgit v1.2.3 From 1dea5902487a93d1f9a6382d838928d0a9739627 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Fri, 19 Mar 2021 15:10:58 -0400 Subject: Make .github a group, and add github repo + user commands --- bot/exts/evergreen/githubinfo.py | 72 +++++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 8 deletions(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 2e38e3ab..74371244 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -8,9 +8,12 @@ from discord.ext import commands from discord.ext.commands.cooldowns import BucketType from bot.constants import NEGATIVE_REPLIES +from bot.exts.utils.extensions import invoke_help_command log = logging.getLogger(__name__) +GITHUB_API_URL = "https://api.github.com" + class GithubInfo(commands.Cog): """Fetches info from GitHub.""" @@ -23,21 +26,27 @@ class GithubInfo(commands.Cog): async with self.bot.http_session.get(url) as r: return await r.json() - @commands.command(name='github', aliases=['gh']) - @commands.cooldown(1, 60, BucketType.user) - async def get_github_info(self, ctx: commands.Context, username: Optional[str]) -> None: + @commands.group(name='github', aliases=('gh',)) + @commands.cooldown(1, 10, BucketType.user) + async def github_group(self, ctx: commands.Context): + """Commands for finding info related to Github.""" + if ctx.invoked_subcommand is None: + await invoke_help_command(ctx) + + @github_group.command(name='user', aliases=('userinfo',)) + async def github_user_info(self, ctx: commands.Context, username: Optional[str]) -> None: """ Fetches a user's GitHub information. Username is optional and sends the help command if not specified. """ if username is None: - await ctx.invoke(self.bot.get_command('help'), 'github') + await invoke_help_command(ctx) ctx.command.reset_cooldown(ctx) return async with ctx.typing(): - user_data = await self.fetch_data(f"https://api.github.com/users/{username}") + user_data = await self.fetch_data(f"{GITHUB_API_URL}/users/{username}") # User_data will not have a message key if the user exists if user_data.get('message') is not None: @@ -74,24 +83,71 @@ class GithubInfo(commands.Cog): embed.add_field(name="Followers", value=f"[{user_data['followers']}]({user_data['html_url']}?tab=followers)") - embed.add_field(name="\u200b", value="\u200b") embed.add_field(name="Following", value=f"[{user_data['following']}]({user_data['html_url']}?tab=following)") embed.add_field(name="Public repos", value=f"[{user_data['public_repos']}]({user_data['html_url']}?tab=repositories)") - embed.add_field(name="\u200b", value="\u200b") if user_data['type'] == "User": embed.add_field(name="Gists", value=f"[{gists}](https://gist.github.com/{username})") embed.add_field(name=f"Organization{'s' if len(orgs)!=1 else ''}", value=orgs_to_add if orgs else "No organizations") - embed.add_field(name="\u200b", value="\u200b") embed.add_field(name="Website", value=blog) await ctx.send(embed=embed) + @github_group.command(name='repo', aliases=('repositories',)) + async def github_repo_info(self, ctx: commands.Context, repo: Optional[str]): + """ + Fetches a repositories's GitHub information. Repository should look like `user/reponame`. + + Repository is optional and sends the help command if not specified. + """ + if repo is None: + await invoke_help_command(ctx) + ctx.command.reset_cooldown() + return + async with ctx.typing(): + repo_data = await self.fetch_data(f"{GITHUB_API_URL}/repos/{repo}") + + # There won't be a message key if this repo exists + if repo_data.get('message') is not None: + await ctx.send(embed=discord.Embed(title=random.choice(NEGATIVE_REPLIES), + description=f"The requested repository was not found.", + colour=discord.Colour.red())) + return + + repo_owner = repo_data['owner'] + + parent = repo_data.get('parent') + + embed = discord.Embed(title=f"{repo_data['name']}", + description=repo_data["description"], + colour=0x7289da, + url=repo_data['html_url'], + timestamp=datetime.strptime(repo_data['pushed_at'], "%Y-%m-%dT%H:%M:%SZ") + ) + + # If it's a fork, then it will have a parent key + if parent: + embed.description += f"\nForked from [{parent['full_name']}]({parent['html_url']})" + + embed.set_author( + name=repo_owner["login"], + url=repo_owner["html_url"], + icon_url=repo_owner["avatar_url"] + ) + + repo_created_at = datetime.strptime(repo_data['created_at'], "%Y-%m-%dT%H:%M:%SZ").strftime("%d/%m/%Y") + + embed.set_footer(text=f"{repo_data['forks_count']} " + f"⑂ • {repo_data['stargazers_count']} ⭐ • Created At {repo_created_at} • " + " Last commit ") + + await ctx.send(embed=embed) + def setup(bot: commands.Bot) -> None: """Adding the cog to the bot.""" -- cgit v1.2.3 From b3c25c888b16ea707e974282c249eaf9799e184d Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Fri, 19 Mar 2021 15:19:05 -0400 Subject: Make alias repository, not repositories --- bot/exts/evergreen/githubinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 74371244..b683065e 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -98,7 +98,7 @@ class GithubInfo(commands.Cog): await ctx.send(embed=embed) - @github_group.command(name='repo', aliases=('repositories',)) + @github_group.command(name='repo', aliases=('repository',)) async def github_repo_info(self, ctx: commands.Context, repo: Optional[str]): """ Fetches a repositories's GitHub information. Repository should look like `user/reponame`. -- cgit v1.2.3 From 658b3b4de1112378e9694b95bcba3d4b8c5213f7 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Fri, 19 Mar 2021 15:23:24 -0400 Subject: Missed a \n --- bot/exts/evergreen/githubinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index b683065e..521b94e7 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -132,7 +132,7 @@ class GithubInfo(commands.Cog): # If it's a fork, then it will have a parent key if parent: - embed.description += f"\nForked from [{parent['full_name']}]({parent['html_url']})" + embed.description += f"\n\nForked from [{parent['full_name']}]({parent['html_url']})" embed.set_author( name=repo_owner["login"], -- cgit v1.2.3 From 01ce649b05999b029490bff00e07cd9f32e285e8 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Fri, 19 Mar 2021 15:27:53 -0400 Subject: Make flake8 happy --- bot/exts/evergreen/githubinfo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 521b94e7..2c7dd885 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -28,7 +28,7 @@ class GithubInfo(commands.Cog): @commands.group(name='github', aliases=('gh',)) @commands.cooldown(1, 10, BucketType.user) - async def github_group(self, ctx: commands.Context): + async def github_group(self, ctx: commands.Context) -> None: """Commands for finding info related to Github.""" if ctx.invoked_subcommand is None: await invoke_help_command(ctx) @@ -99,7 +99,7 @@ class GithubInfo(commands.Cog): await ctx.send(embed=embed) @github_group.command(name='repo', aliases=('repository',)) - async def github_repo_info(self, ctx: commands.Context, repo: Optional[str]): + async def github_repo_info(self, ctx: commands.Context, repo: Optional[str]) -> None: """ Fetches a repositories's GitHub information. Repository should look like `user/reponame`. @@ -115,7 +115,7 @@ class GithubInfo(commands.Cog): # There won't be a message key if this repo exists if repo_data.get('message') is not None: await ctx.send(embed=discord.Embed(title=random.choice(NEGATIVE_REPLIES), - description=f"The requested repository was not found.", + description="The requested repository was not found.", colour=discord.Colour.red())) return -- cgit v1.2.3 From 060c5403a7ea1866731ec2bb23d3e7ba4234fe8c Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Fri, 19 Mar 2021 21:07:35 -0400 Subject: Make better aliases and follow style guidelines --- bot/exts/evergreen/githubinfo.py | 41 ++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 2c7dd885..8dbcc681 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -98,37 +98,38 @@ class GithubInfo(commands.Cog): await ctx.send(embed=embed) - @github_group.command(name='repo', aliases=('repository',)) - async def github_repo_info(self, ctx: commands.Context, repo: Optional[str]) -> None: + @github_group.command(name='repository', aliases=('repo', 'git')) + async def github_repo_info(self, ctx: commands.Context, repo: str) -> None: """ Fetches a repositories's GitHub information. Repository should look like `user/reponame`. Repository is optional and sends the help command if not specified. """ - if repo is None: - await invoke_help_command(ctx) - ctx.command.reset_cooldown() - return async with ctx.typing(): repo_data = await self.fetch_data(f"{GITHUB_API_URL}/repos/{repo}") # There won't be a message key if this repo exists if repo_data.get('message') is not None: - await ctx.send(embed=discord.Embed(title=random.choice(NEGATIVE_REPLIES), - description="The requested repository was not found.", - colour=discord.Colour.red())) + embed = discord.Embed( + title=random.choice(NEGATIVE_REPLIES), + description="The requested repository was not found.", + colour=discord.Colour.red() + ) + + await ctx.send(embed=embed) return repo_owner = repo_data['owner'] parent = repo_data.get('parent') - embed = discord.Embed(title=f"{repo_data['name']}", - description=repo_data["description"], - colour=0x7289da, - url=repo_data['html_url'], - timestamp=datetime.strptime(repo_data['pushed_at'], "%Y-%m-%dT%H:%M:%SZ") - ) + embed = discord.Embed( + title=f"{repo_data['name']}", + description=repo_data["description"], + colour=0x7289da, + url=repo_data['html_url'], + timestamp=datetime.strptime(repo_data['pushed_at'], "%Y-%m-%dT%H:%M:%SZ") + ) # If it's a fork, then it will have a parent key if parent: @@ -142,9 +143,13 @@ class GithubInfo(commands.Cog): repo_created_at = datetime.strptime(repo_data['created_at'], "%Y-%m-%dT%H:%M:%SZ").strftime("%d/%m/%Y") - embed.set_footer(text=f"{repo_data['forks_count']} " - f"⑂ • {repo_data['stargazers_count']} ⭐ • Created At {repo_created_at} • " - " Last commit ") + embed.set_footer( + text=( + f"{repo_data['forks_count']} " + f"⑂ • {repo_data['stargazers_count']} ⭐ • Created At {repo_created_at} • " + " Last commit " + ) + ) await ctx.send(embed=embed) -- cgit v1.2.3 From ad3c78e7a1ed8f4c54c21ab45e85be6c18e5c63f Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Fri, 19 Mar 2021 21:25:11 -0400 Subject: Make git alias for the group instead --- bot/exts/evergreen/githubinfo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 8dbcc681..58162e42 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -26,7 +26,7 @@ class GithubInfo(commands.Cog): async with self.bot.http_session.get(url) as r: return await r.json() - @commands.group(name='github', aliases=('gh',)) + @commands.group(name='github', aliases=('gh', 'git')) @commands.cooldown(1, 10, BucketType.user) async def github_group(self, ctx: commands.Context) -> None: """Commands for finding info related to Github.""" @@ -98,7 +98,7 @@ class GithubInfo(commands.Cog): await ctx.send(embed=embed) - @github_group.command(name='repository', aliases=('repo', 'git')) + @github_group.command(name='repository', aliases=('repo')) async def github_repo_info(self, ctx: commands.Context, repo: str) -> None: """ Fetches a repositories's GitHub information. Repository should look like `user/reponame`. -- cgit v1.2.3 From 6387376cdb000b6e33dd1c67d9b7a24d1d7705b4 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Fri, 19 Mar 2021 21:26:59 -0400 Subject: Forgot a comma for the tuple --- bot/exts/evergreen/githubinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 58162e42..da2b37ac 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -98,7 +98,7 @@ class GithubInfo(commands.Cog): await ctx.send(embed=embed) - @github_group.command(name='repository', aliases=('repo')) + @github_group.command(name='repository', aliases=('repo',)) async def github_repo_info(self, ctx: commands.Context, repo: str) -> None: """ Fetches a repositories's GitHub information. Repository should look like `user/reponame`. -- cgit v1.2.3 From 9e01d6b85dd27d8ecb5f00a5cf20f332d534e584 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 20 Mar 2021 11:13:46 +0000 Subject: Only output override channels & bot commands channel on whitelist error Previously this would output all channels, and could result in an error. This change ensures only the main bot channel & and any overridden channels are shown in the embed. We do this before the categories block as the categories kwarg itself is an override, so we want to include those in any output. --- bot/utils/decorators.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bot/utils/decorators.py b/bot/utils/decorators.py index c12a15ff..f0e2ff99 100644 --- a/bot/utils/decorators.py +++ b/bot/utils/decorators.py @@ -11,7 +11,7 @@ from discord import Colour, Embed from discord.ext import commands from discord.ext.commands import CheckFailure, Command, Context -from bot.constants import ERROR_REPLIES, Month +from bot.constants import Channels, ERROR_REPLIES, Month, WHITELISTED_CHANNELS from bot.utils import human_months, resolve_current_month from bot.utils.checks import in_whitelist_check @@ -253,6 +253,12 @@ def whitelist_check(**default_kwargs: t.Container[int]) -> t.Callable[[Context], channels = set(kwargs.get("channels") or {}) categories = kwargs.get("categories") + # Only output override channels + community_bot_commands + if channels: + default_whitelist_channels = set(WHITELISTED_CHANNELS) + default_whitelist_channels.discard(Channels.community_bot_commands) + channels.difference_update(default_whitelist_channels) + # Add all whitelisted category channels if categories: for category_id in categories: -- cgit v1.2.3 From e0dbf3b9c01774fc4570ce29b6898c5a32f32a1f Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Sat, 20 Mar 2021 07:53:45 -0400 Subject: Update bot/exts/evergreen/githubinfo.py Co-authored-by: Shivansh-007 --- bot/exts/evergreen/githubinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index da2b37ac..cffdc0b2 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -101,7 +101,7 @@ class GithubInfo(commands.Cog): @github_group.command(name='repository', aliases=('repo',)) async def github_repo_info(self, ctx: commands.Context, repo: str) -> None: """ - Fetches a repositories's GitHub information. Repository should look like `user/reponame`. + Fetches a repositories' GitHub information. The repository should look like `user/reponame`. Repository is optional and sends the help command if not specified. """ -- cgit v1.2.3 From 087b58209b52f835eef6493d2269d98867f39b0c Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Sat, 20 Mar 2021 11:02:28 -0400 Subject: Follow style guildines and use better colours --- bot/exts/evergreen/githubinfo.py | 48 ++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index da2b37ac..ec2f9d98 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -1,13 +1,12 @@ import logging import random from datetime import datetime -from typing import Optional import discord from discord.ext import commands from discord.ext.commands.cooldowns import BucketType -from bot.constants import NEGATIVE_REPLIES +from bot.constants import NEGATIVE_REPLIES, Colours from bot.exts.utils.extensions import invoke_help_command log = logging.getLogger(__name__) @@ -34,25 +33,24 @@ class GithubInfo(commands.Cog): await invoke_help_command(ctx) @github_group.command(name='user', aliases=('userinfo',)) - async def github_user_info(self, ctx: commands.Context, username: Optional[str]) -> None: + async def github_user_info(self, ctx: commands.Context, username: str) -> None: """ Fetches a user's GitHub information. Username is optional and sends the help command if not specified. """ - if username is None: - await invoke_help_command(ctx) - ctx.command.reset_cooldown(ctx) - return - async with ctx.typing(): user_data = await self.fetch_data(f"{GITHUB_API_URL}/users/{username}") # User_data will not have a message key if the user exists if user_data.get('message') is not None: - await ctx.send(embed=discord.Embed(title=random.choice(NEGATIVE_REPLIES), - description=f"The profile for `{username}` was not found.", - colour=discord.Colour.red())) + embed = discord.Embed( + title=random.choice(NEGATIVE_REPLIES), + description=f"The profile for `{username}` was not found.", + colour=Colours.soft_red + ) + + await ctx.send() return org_data = await self.fetch_data(user_data['organizations_url']) @@ -72,7 +70,7 @@ class GithubInfo(commands.Cog): embed = discord.Embed( title=f"`{user_data['login']}`'s GitHub profile info", description=f"```{user_data['bio']}```\n" if user_data['bio'] is not None else "", - colour=0x7289da, + colour=discord.Colour.blurple(), url=user_data['html_url'], timestamp=datetime.strptime(user_data['created_at'], "%Y-%m-%dT%H:%M:%SZ") ) @@ -81,19 +79,27 @@ class GithubInfo(commands.Cog): if user_data['type'] == "User": - embed.add_field(name="Followers", - value=f"[{user_data['followers']}]({user_data['html_url']}?tab=followers)") - embed.add_field(name="Following", - value=f"[{user_data['following']}]({user_data['html_url']}?tab=following)") + embed.add_field( + name="Followers", + value=f"[{user_data['followers']}]({user_data['html_url']}?tab=followers)" + ) + embed.add_field( + name="Following", + value=f"[{user_data['following']}]({user_data['html_url']}?tab=following)" + ) - embed.add_field(name="Public repos", - value=f"[{user_data['public_repos']}]({user_data['html_url']}?tab=repositories)") + embed.add_field( + name="Public repos", + value=f"[{user_data['public_repos']}]({user_data['html_url']}?tab=repositories)" + ) if user_data['type'] == "User": embed.add_field(name="Gists", value=f"[{gists}](https://gist.github.com/{username})") - embed.add_field(name=f"Organization{'s' if len(orgs)!=1 else ''}", - value=orgs_to_add if orgs else "No organizations") + embed.add_field( + name=f"Organization{'s' if len(orgs)!=1 else ''}", + value=orgs_to_add if orgs else "No organizations" + ) embed.add_field(name="Website", value=blog) await ctx.send(embed=embed) @@ -113,7 +119,7 @@ class GithubInfo(commands.Cog): embed = discord.Embed( title=random.choice(NEGATIVE_REPLIES), description="The requested repository was not found.", - colour=discord.Colour.red() + colour=Colours.soft_red ) await ctx.send(embed=embed) -- cgit v1.2.3 From 7fb2134e40f7d9b47759797785d9e47ff059ff7c Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Sat, 20 Mar 2021 11:14:33 -0400 Subject: Make a new line for `created_at` Co-authored-by: Shivansh-007 --- bot/exts/evergreen/githubinfo.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index cffdc0b2..75db10d4 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -145,9 +145,10 @@ class GithubInfo(commands.Cog): embed.set_footer( text=( - f"{repo_data['forks_count']} " - f"⑂ • {repo_data['stargazers_count']} ⭐ • Created At {repo_created_at} • " - " Last commit " + f"{repo_data['forks_count']} ⑂ " + f"• {repo_data['stargazers_count']} ⭐ " + f"• Created At {repo_created_at} " + f"• Last commit " ) ) -- cgit v1.2.3 From d945ec3314500e579d8e79f086d53453886daf9a Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Sat, 20 Mar 2021 11:28:17 -0400 Subject: Fix trailing whitespace --- bot/exts/evergreen/githubinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 0b2c4c77..07175857 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -152,7 +152,7 @@ class GithubInfo(commands.Cog): embed.set_footer( text=( f"{repo_data['forks_count']} ⑂ " - f"• {repo_data['stargazers_count']} ⭐ " + f"• {repo_data['stargazers_count']} ⭐ " f"• Created At {repo_created_at} " f"• Last commit " ) -- cgit v1.2.3 From 5c8e3008ee5f37bbcab24552fd4c933c8271aa58 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Sat, 20 Mar 2021 11:37:56 -0400 Subject: Fix imports --- bot/exts/evergreen/githubinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 07175857..ebb265b5 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -6,7 +6,7 @@ import discord from discord.ext import commands from discord.ext.commands.cooldowns import BucketType -from bot.constants import NEGATIVE_REPLIES, Colours +from bot.constants import Colours, NEGATIVE_REPLIES from bot.exts.utils.extensions import invoke_help_command log = logging.getLogger(__name__) -- cgit v1.2.3 From 69569fe2c5dafb659b3c56e764d034281686492e Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Sat, 20 Mar 2021 11:41:12 -0400 Subject: Change --- bot/exts/evergreen/githubinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index ebb265b5..5559a464 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -132,7 +132,7 @@ class GithubInfo(commands.Cog): embed = discord.Embed( title=f"{repo_data['name']}", description=repo_data["description"], - colour=0x7289da, + colour=discord.Colour.blurple(), url=repo_data['html_url'], timestamp=datetime.strptime(repo_data['pushed_at'], "%Y-%m-%dT%H:%M:%SZ") ) -- cgit v1.2.3 From 85c6dfa00e01abea8b65654aed59a520af3c18a6 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Sat, 20 Mar 2021 12:15:57 -0400 Subject: Make last commit not a timestamp to improve readability --- bot/exts/evergreen/githubinfo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 5559a464..67d91589 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -133,8 +133,7 @@ class GithubInfo(commands.Cog): title=f"{repo_data['name']}", description=repo_data["description"], colour=discord.Colour.blurple(), - url=repo_data['html_url'], - timestamp=datetime.strptime(repo_data['pushed_at'], "%Y-%m-%dT%H:%M:%SZ") + url=repo_data['html_url'] ) # If it's a fork, then it will have a parent key @@ -148,13 +147,14 @@ class GithubInfo(commands.Cog): ) repo_created_at = datetime.strptime(repo_data['created_at'], "%Y-%m-%dT%H:%M:%SZ").strftime("%d/%m/%Y") + last_pushed = datetime.strptime(repo_data['pushed_at'], "%Y-%m-%dT%H:%M:%SZ").strftime("%d/%m/%Y at %H:%M") embed.set_footer( text=( f"{repo_data['forks_count']} ⑂ " f"• {repo_data['stargazers_count']} ⭐ " f"• Created At {repo_created_at} " - f"• Last commit " + f"• Last Commit {last_pushed}" ) ) -- cgit v1.2.3 From ed26d381e1959523b9a5da2866f7f1f917ee7bae Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Sun, 21 Mar 2021 08:36:09 -0400 Subject: Add the embed kwarg to ctx.send --- bot/exts/evergreen/githubinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 67d91589..1be2e385 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -50,7 +50,7 @@ class GithubInfo(commands.Cog): colour=Colours.soft_red ) - await ctx.send() + await ctx.send(embed=embed) return org_data = await self.fetch_data(user_data['organizations_url']) -- cgit v1.2.3 From 1e9a88f5b59cf7d1c4e24f48cc09aa98e5f6499b Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 21 Mar 2021 18:11:50 +0000 Subject: Replace list comp with a set update + sequence --- bot/utils/decorators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/utils/decorators.py b/bot/utils/decorators.py index f0e2ff99..60066dc4 100644 --- a/bot/utils/decorators.py +++ b/bot/utils/decorators.py @@ -266,7 +266,7 @@ def whitelist_check(**default_kwargs: t.Container[int]) -> t.Callable[[Context], if category is None: continue - [channels.add(channel.id) for channel in category.text_channels] + channels.update(channel.id for channel in category.text_channels) if channels: channels_str = ', '.join(f"<#{c_id}>" for c_id in channels) -- cgit v1.2.3 From faccb5d2828d046d5e3a1e21c63f392529be4691 Mon Sep 17 00:00:00 2001 From: Matteo Bertucci Date: Wed, 24 Mar 2021 09:24:32 +0100 Subject: Remove broken link from the April fool collection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Its’a braken --- bot/resources/easter/april_fools_vids.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bot/resources/easter/april_fools_vids.json b/bot/resources/easter/april_fools_vids.json index 5f0ba06e..d8c1efa1 100644 --- a/bot/resources/easter/april_fools_vids.json +++ b/bot/resources/easter/april_fools_vids.json @@ -16,10 +16,6 @@ "title": "Haptic Helpers: bringing you to your senses", "link": "https://youtu.be/3MA6_21nka8" }, - { - "title": "Introducing Google Gnome", - "link": "https://youtu.be/vNOllWX-2aE" - }, { "title": "Introducing Google Wind", "link": "https://youtu.be/QAwL0O5nXe0" -- cgit v1.2.3 From 8b72a57f05c85fbdd6f9735f8cf722f7d63df659 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Wed, 24 Mar 2021 13:31:13 -0400 Subject: Update docstrings because user and repo are now mandatory arguments --- bot/exts/evergreen/githubinfo.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 1be2e385..34e30d0b 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -34,11 +34,7 @@ class GithubInfo(commands.Cog): @github_group.command(name='user', aliases=('userinfo',)) async def github_user_info(self, ctx: commands.Context, username: str) -> None: - """ - Fetches a user's GitHub information. - - Username is optional and sends the help command if not specified. - """ + """Fetches a user's GitHub information.""" async with ctx.typing(): user_data = await self.fetch_data(f"{GITHUB_API_URL}/users/{username}") @@ -106,11 +102,7 @@ class GithubInfo(commands.Cog): @github_group.command(name='repository', aliases=('repo',)) async def github_repo_info(self, ctx: commands.Context, repo: str) -> None: - """ - Fetches a repositories' GitHub information. The repository should look like `user/reponame`. - - Repository is optional and sends the help command if not specified. - """ + """Fetches a repositories' GitHub information. The repository should look like `user/reponame`.""" async with ctx.typing(): repo_data = await self.fetch_data(f"{GITHUB_API_URL}/repos/{repo}") -- cgit v1.2.3 From e044bf3d716dc166704ba31def82bd34a68acb42 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Wed, 24 Mar 2021 13:34:47 -0400 Subject: Info -> information Co-authored-by: Shivansh-007 --- bot/exts/evergreen/githubinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 34e30d0b..712a516b 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -28,7 +28,7 @@ class GithubInfo(commands.Cog): @commands.group(name='github', aliases=('gh', 'git')) @commands.cooldown(1, 10, BucketType.user) async def github_group(self, ctx: commands.Context) -> None: - """Commands for finding info related to Github.""" + """Commands for finding information related to GitHub.""" if ctx.invoked_subcommand is None: await invoke_help_command(ctx) -- cgit v1.2.3 From ed5dc457c51aae388e5d4607639fb79be958ff27 Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Thu, 25 Mar 2021 19:22:12 -0400 Subject: Quote reponame and username --- bot/exts/evergreen/githubinfo.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 34e30d0b..56195e8c 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -1,6 +1,7 @@ import logging import random from datetime import datetime +from urllib.parse import quote import discord from discord.ext import commands @@ -90,7 +91,7 @@ class GithubInfo(commands.Cog): ) if user_data['type'] == "User": - embed.add_field(name="Gists", value=f"[{gists}](https://gist.github.com/{username})") + embed.add_field(name="Gists", value=f"[{gists}](https://gist.github.com/{quote(username, safe='')})") embed.add_field( name=f"Organization{'s' if len(orgs)!=1 else ''}", @@ -103,8 +104,18 @@ class GithubInfo(commands.Cog): @github_group.command(name='repository', aliases=('repo',)) async def github_repo_info(self, ctx: commands.Context, repo: str) -> None: """Fetches a repositories' GitHub information. The repository should look like `user/reponame`.""" + if repo.count('/') != 1: + embed = discord.Embed( + title=random.choice(NEGATIVE_REPLIES), + description="The repository should look like `user/reponame`.", + colour=Colours.soft_red + ) + + await ctx.send(embed=embed) + return + async with ctx.typing(): - repo_data = await self.fetch_data(f"{GITHUB_API_URL}/repos/{repo}") + repo_data = await self.fetch_data(f"{GITHUB_API_URL}/repos/{quote(repo)}") # There won't be a message key if this repo exists if repo_data.get('message') is not None: -- cgit v1.2.3 From 8f79d6705dd8d62a51d34f12f27fa9643fc3b04c Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Thu, 25 Mar 2021 21:44:26 -0400 Subject: Make requested changes --- bot/exts/evergreen/githubinfo.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 94a3166b..1b64b0eb 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -40,7 +40,7 @@ class GithubInfo(commands.Cog): user_data = await self.fetch_data(f"{GITHUB_API_URL}/users/{username}") # User_data will not have a message key if the user exists - if user_data.get('message') is not None: + if "message" in user_data: embed = discord.Embed( title=random.choice(NEGATIVE_REPLIES), description=f"The profile for `{username}` was not found.", @@ -118,7 +118,7 @@ class GithubInfo(commands.Cog): repo_data = await self.fetch_data(f"{GITHUB_API_URL}/repos/{quote(repo)}") # There won't be a message key if this repo exists - if repo_data.get('message') is not None: + if "message" in repo_data: embed = discord.Embed( title=random.choice(NEGATIVE_REPLIES), description="The requested repository was not found.", @@ -128,20 +128,21 @@ class GithubInfo(commands.Cog): await ctx.send(embed=embed) return - repo_owner = repo_data['owner'] - - parent = repo_data.get('parent') - embed = discord.Embed( - title=f"{repo_data['name']}", + title=repo_data['name'], description=repo_data["description"], colour=discord.Colour.blurple(), url=repo_data['html_url'] ) # If it's a fork, then it will have a parent key - if parent: + try: + parent = repo_data["parent"] embed.description += f"\n\nForked from [{parent['full_name']}]({parent['html_url']})" + except KeyError: + log.debug("Repository is not a fork.") + + repo_owner = repo_data['owner'] embed.set_author( name=repo_owner["login"], -- cgit v1.2.3 From f6a28d5833160dccb6d308fd8e27c6afb9729643 Mon Sep 17 00:00:00 2001 From: Neil Shah <78612612+NeilShah2026@users.noreply.github.com> Date: Fri, 26 Mar 2021 09:50:03 -0400 Subject: Added 3 More Elements To The Json --- bot/resources/easter/april_fools_vids.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bot/resources/easter/april_fools_vids.json b/bot/resources/easter/april_fools_vids.json index d8c1efa1..d029ff86 100644 --- a/bot/resources/easter/april_fools_vids.json +++ b/bot/resources/easter/april_fools_vids.json @@ -116,6 +116,18 @@ "title": "Introducing Gmail Motion", "link": "https://youtu.be/Bu927_ul_X0" } + { + "title": "Introducing GeForce GTX G-Assist", + "link": "https://youtu.be/smM-Wdk2RLQ" + } + { + "title": "The Hovering Mouse - Project McFly | Razer", + "link": "https://youtu.be/IlCx5gjAmqI" + } + { + "title": "Be the Machine | Project Venom v2", + "link": "https://youtu.be/j8UJE7DoyJ8" + } ] } -- cgit v1.2.3 From 877671523c18aad4bb5061a1a2379beb5c761e3c Mon Sep 17 00:00:00 2001 From: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> Date: Fri, 26 Mar 2021 14:54:07 -0400 Subject: Make repository accept either user/reponame or user reponame --- bot/exts/evergreen/githubinfo.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 1b64b0eb..c8a6b3f7 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -102,12 +102,17 @@ class GithubInfo(commands.Cog): await ctx.send(embed=embed) @github_group.command(name='repository', aliases=('repo',)) - async def github_repo_info(self, ctx: commands.Context, repo: str) -> None: - """Fetches a repositories' GitHub information. The repository should look like `user/reponame`.""" + async def github_repo_info(self, ctx: commands.Context, *repo: str) -> None: + """ + Fetches a repositories' GitHub information. + + The repository should look like `user/reponame` or `user reponame`. + """ + repo = '/'.join(repo) if repo.count('/') != 1: embed = discord.Embed( title=random.choice(NEGATIVE_REPLIES), - description="The repository should look like `user/reponame`.", + description="The repository should look like `user/reponame` or `user reponame`.", colour=Colours.soft_red ) -- cgit v1.2.3 From 73970e6ba6909bf7ab5023377585ee12cdc77b97 Mon Sep 17 00:00:00 2001 From: Xithrius Date: Sun, 28 Mar 2021 14:45:12 -0700 Subject: Added more topics. --- bot/resources/evergreen/py_topics.yaml | 2 +- bot/resources/evergreen/starter.yaml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/bot/resources/evergreen/py_topics.yaml b/bot/resources/evergreen/py_topics.yaml index f3b2eaa3..7d5f7cb0 100644 --- a/bot/resources/evergreen/py_topics.yaml +++ b/bot/resources/evergreen/py_topics.yaml @@ -69,7 +69,7 @@ # game-development 660625198390837248: - - + - What is your favorite game mechanic? # microcontrollers 545603026732318730: diff --git a/bot/resources/evergreen/starter.yaml b/bot/resources/evergreen/starter.yaml index 949220f9..4fec6a10 100644 --- a/bot/resources/evergreen/starter.yaml +++ b/bot/resources/evergreen/starter.yaml @@ -31,3 +31,22 @@ - What is your favorite TV show? - What is your favorite media genre? - How many years have you spent coding? +- What book do you highly recommend everyone to read? +- What websites do you use daily to keep yourself up to date with the industry? +- What made you want to join this Discord server? +- How are you? +- What is the best advice you have ever gotten in regards to programming/software? +- What is the most satisfying thing you've done in your life? +- Who is your favorite music composer/producer/singer? +- What is your favorite song? +- What is your favorite video game? +- What are your hobbies other than programming? +- Who is your favorite Writer? +- What is your favorite movie? +- What is your favorite sport? +- What is your favorite fruit? +- What is your favorite juice? +- What is the best scenery you've ever seen? +- What artistic talents do you have? +- What is the tallest building you've entered? +- What is the oldest computer you've ever used? -- cgit v1.2.3 From ab126639380b337493606bc6c90acb5046e9f76e Mon Sep 17 00:00:00 2001 From: Boris Muratov <8bee278@gmail.com> Date: Mon, 29 Mar 2021 01:00:05 +0300 Subject: Add more game dev topics --- bot/resources/evergreen/py_topics.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bot/resources/evergreen/py_topics.yaml b/bot/resources/evergreen/py_topics.yaml index 7d5f7cb0..6b7e0206 100644 --- a/bot/resources/evergreen/py_topics.yaml +++ b/bot/resources/evergreen/py_topics.yaml @@ -70,6 +70,10 @@ # game-development 660625198390837248: - What is your favorite game mechanic? + - What is your favorite framework and why? + - What games do you know that were written in Python? + - What books or tutorials would you recommend for game-development beginners? + - What made you start developing games? # microcontrollers 545603026732318730: -- cgit v1.2.3 From 4bf63f11929a22ffbb9d8859b76ed5437b0a4f13 Mon Sep 17 00:00:00 2001 From: Matteo Bertucci Date: Tue, 30 Mar 2021 16:51:29 +0200 Subject: Add missing commas to april_fools_vids.json #639 left the json file in a broken state, not letting the bot start. --- bot/resources/easter/april_fools_vids.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/resources/easter/april_fools_vids.json b/bot/resources/easter/april_fools_vids.json index d029ff86..b2cbd07b 100644 --- a/bot/resources/easter/april_fools_vids.json +++ b/bot/resources/easter/april_fools_vids.json @@ -115,15 +115,15 @@ { "title": "Introducing Gmail Motion", "link": "https://youtu.be/Bu927_ul_X0" - } + }, { "title": "Introducing GeForce GTX G-Assist", "link": "https://youtu.be/smM-Wdk2RLQ" - } + }, { "title": "The Hovering Mouse - Project McFly | Razer", "link": "https://youtu.be/IlCx5gjAmqI" - } + }, { "title": "Be the Machine | Project Venom v2", "link": "https://youtu.be/j8UJE7DoyJ8" -- cgit v1.2.3 From c22f1975144f3a96f440a1048010d91086a254e7 Mon Sep 17 00:00:00 2001 From: Matteo Bertucci Date: Wed, 31 Mar 2021 09:27:49 +0000 Subject: Update our policy documents --- CODE_OF_CONDUCT.md | 3 ++ CONTRIBUTING.md | 126 +---------------------------------------------------- SECURITY.md | 3 ++ 3 files changed, 8 insertions(+), 124 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 SECURITY.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..57ccd80e --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,3 @@ +# Code of Conduct + +The Python Discord Code of Conduct can be found [on our website](https://pydis.com/coc). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3a1803e2..f20b5316 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,125 +1,3 @@ -# Contributing to Sir Lancebot +# Contributing Guidelines -Sir Lancebot is a community project for the Python Discord community over at https://discord.gg/python. We will be providing support for those of you who are new to Git, and this project is to be considered educational. - -Our projects are open-source and are automatically deployed whenever commits are pushed to the `main` branch on each repository, so we've created a set of guidelines in order to keep everything clean and in working order. - -Note that contributions may be rejected on the basis of a contributor failing to follow these guidelines. - -## Rules - -1. You must be a member of [our Discord community](https://discord.gg/python) in order to contribute to this project. -2. Your pull request must solve an issue created or approved by a staff member. These will be labeled with the `approved` label. Feel free to suggest issues of your own, which staff can review for approval. -3. **No force-pushes** or modifying the Git history in any way. -4. If you have direct access to the repository, **create a branch for your changes** and create a pull request for that branch. If not, create a branch on a fork of the repository and create a pull request from there. - * It's common practice for a repository to reject direct pushes to `main`, so make branching a habit! - * If PRing from your own fork, **ensure that "Allow edits from maintainers" is checked**. This gives permission for maintainers to commit changes directly to your fork, speeding up the review process. -5. **Adhere to the prevailing code style**, which we enforce using [`flake8`](http://flake8.pycqa.org/en/latest/index.html) and [`pre-commit`](https://pre-commit.com/). - * Run `flake8` and `pre-commit` against your code [**before** you push it](https://soundcloud.com/lemonsaurusrex/lint-before-you-push). Your commit will be rejected by the build server if it fails to lint. - * [Git Hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) are a powerful git feature for executing custom scripts when certain important git actions occur. The pre-commit hook is the first hook executed during the commit process and can be used to check the code being committed & abort the commit if issues, such as linting failures, are detected. While git hooks can seem daunting to configure, the `pre-commit` framework abstracts this process away from you and is provided as a dev dependency for this project. Run `pipenv run precommit` when setting up the project and you'll never have to worry about committing code that fails linting. -6. **Make great commits**. A well structured git log is key to a project's maintainability; it efficiently provides insight into when and *why* things were done for future maintainers of the project. - * Commits should be as narrow in scope as possible. Commits that span hundreds of lines across multiple unrelated functions and/or files are very hard for maintainers to follow. After about a week they'll probably be hard for you to follow too. - * Avoid making minor commits for fixing typos or linting errors. Since you've already set up a `pre-commit` hook to run the linting pipeline before a commit, you shouldn't be committing linting issues anyway. - * A more in-depth guide to writing great commit messages can be found in Chris Beam's [*How to Write a Git Commit Message*](https://chris.beams.io/posts/git-commit/) -7. **Avoid frequent pushes to the main repository**. This goes for PRs opened against your fork as well. Our test build pipelines are triggered every time a push to the repository (or PR) is made. Try to batch your commits until you've finished working for that session, or you've reached a point where collaborators need your commits to continue their own work. This also provides you the opportunity to amend commits for minor changes rather than having to commit them on their own because you've already pushed. - * This includes merging main into your branch. Try to leave merging from main for after your PR passes review; a maintainer will bring your PR up to date before merging. Exceptions to this include: resolving merge conflicts, needing something that was pushed to main for your branch, or something was pushed to main that could potentionally affect the functionality of what you're writing. -8. **Don't fight the framework**. Every framework has its flaws, but the frameworks we've picked out have been carefully chosen for their particular merits. If you can avoid it, please resist reimplementing swathes of framework logic - the work has already been done for you! -9. If someone is working on an issue or pull request, **do not open your own pull request for the same task**. Instead, collaborate with the author(s) of the existing pull request. Duplicate PRs opened without communicating with the other author(s) and/or PyDis staff will be closed. Communication is key, and there's no point in two separate implementations of the same thing. - * One option is to fork the other contributor's repository and submit your changes to their branch with your own pull request. We suggest following these guidelines when interacting with their repository as well. - * The author(s) of inactive PRs and claimed issues will be be pinged after a week of inactivity for an update. Continued inactivity may result in the issue being released back to the community and/or PR closure. -10. **Work as a team** and collaborate wherever possible. Keep things friendly and help each other out - these are shared projects and nobody likes to have their feet trodden on. -11. All static content, such as images or audio, **must be licensed for open public use**. - * Static content must be hosted by a service designed to do so. Failing to do so is known as "leeching" and is frowned upon, as it generates extra bandwidth costs to the host without providing benefit. It would be best if appropriately licensed content is added to the repository itself so it can be served by PyDis' infrastructure. - -Above all, the needs of our community should come before the wants of an individual. Work together, build solutions to problems and try to do so in a way that people can learn from easily. Abuse of our trust may result in the loss of your Contributor role. - -## Changes to this Arrangement - -All projects evolve over time, and this contribution guide is no different. This document is open to pull requests or changes by contributors. If you believe you have something valuable to add or change, please don't hesitate to do so in a PR. - -## Supplemental Information -### Developer Environment -Sir Lancebot utilizes [Pipenv](https://pipenv.readthedocs.io/en/latest/) for installation and dependency management. For users unfamiliar with the Pipenv workflow, Pipenv's documentation provides a [Basic Usage](https://pipenv.readthedocs.io/en/latest/basics/) tutorial, along with some of the more advanced workflows. A project-specific installation guide can be found in [Sir Lancebot's README](https://github.com/python-discord/sir-lancebot/blob/main/README.md). - -When pulling down changes from GitHub, remember to sync your environment using `pipenv sync --dev` to ensure you're using the most up-to-date versions the project's dependencies. - -### Type Hinting -[PEP 484](https://www.python.org/dev/peps/pep-0484/) formally specifies type hints for Python functions, added to the Python Standard Library in version 3.5. Type hints are recognized by most modern code editing tools and provide useful insight into both the input and output types of a function, preventing the user from having to go through the codebase to determine these types. - -For example: - -```py -import typing as t - - -def foo(input_1: int, input_2: t.Dict[str, str]) -> bool: - ... -``` - -Tells us that `foo` accepts an `int` and a `dict`, with `str` keys and values, and returns a `bool`. - -All function declarations should be type hinted in code contributed to the PyDis organization. - -For more information, see *[PEP 483](https://www.python.org/dev/peps/pep-0483/) - The Theory of Type Hints* and Python's documentation for the [`typing`](https://docs.python.org/3/library/typing.html) module. - -### AutoDoc Formatting Directives -Many documentation packages provide support for automatic documentation generation from the codebase's docstrings. These tools utilize special formatting directives to enable richer formatting in the generated documentation. - -For example: - -```py -import typing as t - - -def foo(bar: int, baz: t.Optional[t.Dict[str, str]] = None) -> bool: - """ - Does some things with some stuff. - - :param bar: Some input - :param baz: Optional, some dictionary with string keys and values - - :return: Some boolean - """ - ... -``` - -Since PyDis does not utilize automatic documentation generation, use of this syntax should not be used in code contributed to the organization. Should the purpose and type of the input variables not be easily discernable from the variable name and type annotation, a prose explanation can be used. Explicit references to variables, functions, classes, etc. should be wrapped with backticks (`` ` ``). - -For example, the above docstring would become: - -```py -import typing as t - - -def foo(bar: int, baz: t.Optional[t.Dict[str, str]] = None) -> bool: - """ - Does some things with some stuff. - - This function takes an index, `bar` and checks for its presence in the database `baz`, passed as a dictionary. Returns `False` if `baz` is not passed. - """ - ... -``` - -### Logging Levels -The project currently defines [`logging`](https://docs.python.org/3/library/logging.html) levels as follows, from lowest to highest severity: -* **TRACE:** These events should be used to provide a *verbose* trace of every step of a complex process. This is essentially the `logging` equivalent of sprinkling `print` statements throughout the code. - * **Note:** This is a PyDis-implemented logging level. -* **DEBUG:** These events should add context to what's happening in a development setup to make it easier to follow what's going while working on a project. This is in the same vein as **TRACE** logging but at a much lower level of verbosity. -* **INFO:** These events are normal and don't need direct attention but are worth keeping track of in production, like checking which cogs were loaded during a start-up. -* **WARNING:** These events are out of the ordinary and should be fixed, but have not caused a failure. - * **NOTE:** Events at this logging level and higher should be reserved for events that require the attention of the DevOps team. -* **ERROR:** These events have caused a failure in a specific part of the application and require urgent attention. -* **CRITICAL:** These events have caused the whole application to fail and require immediate intervention. - -Ensure that log messages are succinct. Should you want to pass additional useful information that would otherwise make the log message overly verbose the `logging` module accepts an `extra` kwarg, which can be used to pass a dictionary. This is used to populate the `__dict__` of the `LogRecord` created for the logging event with user-defined attributes that can be accessed by a log handler. Additional information and caveats may be found [in Python's `logging` documentation](https://docs.python.org/3/library/logging.html#logging.Logger.debug). - -### Work in Progress (WIP) PRs -Github [provides a PR feature](https://github.blog/2019-02-14-introducing-draft-pull-requests/) that allows the PR author to mark it as a WIP. This provides both a visual and functional indicator that the contents of the PR are in a draft state and not yet ready for formal review. - -This feature should be utilized in place of the traditional method of prepending `[WIP]` to the PR title. - -As stated earlier, **ensure that "Allow edits from maintainers" is checked**. This gives permission for maintainers to commit changes directly to your fork, speeding up the review process. - -## Footnotes - -This document was inspired by the [Glowstone contribution guidelines](https://github.com/GlowstoneMC/Glowstone/blob/dev/docs/CONTRIBUTING.md). +The Contributing Guidelines for Python Discord projects can be found [on our website](https://pydis.com/contributing.md). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..fa5a88a3 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,3 @@ +# Security Notice + +The Security Notice for Python Discord projects can be found [on our website](https://pydis.com/security.md). -- cgit v1.2.3 From e3b7b3bc5b56b805112558377e25e2537cc86083 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 2 Apr 2021 14:53:27 +0100 Subject: Don't allow users to run the issue command in DMs, given error feedback. --- bot/exts/evergreen/issues.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/bot/exts/evergreen/issues.py b/bot/exts/evergreen/issues.py index 1f22f287..0f0be33a 100644 --- a/bot/exts/evergreen/issues.py +++ b/bot/exts/evergreen/issues.py @@ -7,7 +7,16 @@ from enum import Enum import discord from discord.ext import commands, tasks -from bot.constants import Categories, Channels, Colours, ERROR_REPLIES, Emojis, Tokens, WHITELISTED_CHANNELS +from bot.constants import ( + Categories, + Channels, + Colours, + ERROR_REPLIES, + Emojis, + NEGATIVE_REPLIES, + Tokens, + WHITELISTED_CHANNELS +) log = logging.getLogger(__name__) @@ -148,11 +157,20 @@ class Issues(commands.Cog): user: str = "python-discord" ) -> None: """Command to retrieve issue(s) from a GitHub repository.""" - if not( + if not ctx.guild or not( ctx.channel.category.id in WHITELISTED_CATEGORIES or ctx.channel.id in WHITELISTED_CHANNELS ): - return + await ctx.send( + embed=discord.Embed( + title=random.choice(NEGATIVE_REPLIES), + description=( + "You can't run this command in this channel. " + f"Try again in {Channels.community_bot_commands}" + ), + colour=discord.Colour.red() + ) + ) result = await self.fetch_issues(set(numbers), repository, user) -- cgit v1.2.3 From 6a8a582c49c2a3d97a2a061eca157502acb0618d Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 2 Apr 2021 17:02:47 +0100 Subject: Send error embed when a user tries to retrieve an issue in DMs --- bot/exts/evergreen/issues.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/bot/exts/evergreen/issues.py b/bot/exts/evergreen/issues.py index ca0e4494..4a73d20b 100644 --- a/bot/exts/evergreen/issues.py +++ b/bot/exts/evergreen/issues.py @@ -168,11 +168,12 @@ class Issues(commands.Cog): title=random.choice(NEGATIVE_REPLIES), description=( "You can't run this command in this channel. " - f"Try again in {Channels.community_bot_commands}" + f"Try again in <#{Channels.community_bot_commands}>" ), colour=discord.Colour.red() ) ) + return result = await self.fetch_issues(set(numbers), repository, user) @@ -198,12 +199,8 @@ class Issues(commands.Cog): @commands.Cog.listener() async def on_message(self, message: discord.Message) -> None: """Command to retrieve issue(s) from a GitHub repository using automatic linking if matching #.""" - # Ignore messages from DMs - if not message.guild: - return - - # Ignore messages not in whitelisted categories / channels - if not ( + # Ignore messages not in whitelisted categories / channels, only when in guild. + if message.guild and not ( message.channel.category.id in WHITELISTED_CATEGORIES or message.channel.id in WHITELISTED_CHANNELS_ON_MESSAGE ): @@ -213,6 +210,18 @@ class Issues(commands.Cog): links = [] if message_repo_issue_map: + if not message.guild: + await message.channel.send( + embed=discord.Embed( + title=random.choice(NEGATIVE_REPLIES), + description=( + "You can't retreive issues from DMs. " + f"Try again in <#{Channels.community_bot_commands}>" + ), + colour=discord.Colour.red() + ) + ) + return for repo_issue in message_repo_issue_map: if not self.check_in_block(message, " ".join(repo_issue)): result = await self.fetch_issues({repo_issue[1]}, repo_issue[0], "python-discord") -- cgit v1.2.3 From 50cd34e73d77bf71fe214250d5f20a2b4d98664d Mon Sep 17 00:00:00 2001 From: vcokltfre Date: Mon, 5 Apr 2021 15:01:58 +0100 Subject: fix: use get_user in 8bitify to avoid events issues --- bot/exts/evergreen/8bitify.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/exts/evergreen/8bitify.py b/bot/exts/evergreen/8bitify.py index 54e68f80..ee2b4034 100644 --- a/bot/exts/evergreen/8bitify.py +++ b/bot/exts/evergreen/8bitify.py @@ -25,7 +25,8 @@ class EightBitify(commands.Cog): async def eightbit_command(self, ctx: commands.Context) -> None: """Pixelates your avatar and changes the palette to an 8bit one.""" async with ctx.typing(): - image_bytes = await ctx.author.avatar_url.read() + author = await self.bot.get_user(ctx.author.id) + image_bytes = await author.avatar_url.read() avatar = Image.open(BytesIO(image_bytes)) avatar = avatar.convert("RGBA").resize((1024, 1024)) -- cgit v1.2.3 From 30756d4dcc2dcdba334cc3493d82eccdc9c6aded Mon Sep 17 00:00:00 2001 From: vcokltfre Date: Mon, 5 Apr 2021 15:45:10 +0100 Subject: fix: use api fetch not cache get --- bot/exts/evergreen/8bitify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/evergreen/8bitify.py b/bot/exts/evergreen/8bitify.py index ee2b4034..7eb4d313 100644 --- a/bot/exts/evergreen/8bitify.py +++ b/bot/exts/evergreen/8bitify.py @@ -25,7 +25,7 @@ class EightBitify(commands.Cog): async def eightbit_command(self, ctx: commands.Context) -> None: """Pixelates your avatar and changes the palette to an 8bit one.""" async with ctx.typing(): - author = await self.bot.get_user(ctx.author.id) + author = await self.bot.fetch_user(ctx.author.id) image_bytes = await author.avatar_url.read() avatar = Image.open(BytesIO(image_bytes)) avatar = avatar.convert("RGBA").resize((1024, 1024)) -- cgit v1.2.3 From 2d03c9956e17709d00daeda00b1e778214708d50 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Mon, 5 Apr 2021 18:56:28 +0300 Subject: Migrate GHCR_TOKEN -> GITHUB_TOKEN in Docker build action GITHUB_TOKEN has now enough permissions to be used for pushing to GHCR, so we don't need PAT anymore. --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0a006eb9..baa046ce 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -36,7 +36,7 @@ jobs: with: registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ secrets.GHCR_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} # Build and push the container to the GitHub Container # Repository. The container will be tagged as "latest" -- cgit v1.2.3 From d067f4d4a63d96d463aa289e6291ddf1710a8af5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Apr 2021 09:09:53 +0000 Subject: Bump pyyaml from 5.3.1 to 5.4 Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4. - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES) - [Commits](https://github.com/yaml/pyyaml/compare/5.3.1...5.4) Signed-off-by: dependabot[bot] --- Pipfile | 2 +- Pipfile.lock | 189 +++++++++++++++++++++++++++++++---------------------------- 2 files changed, 101 insertions(+), 90 deletions(-) diff --git a/Pipfile b/Pipfile index 2e922ec4..25e96c92 100644 --- a/Pipfile +++ b/Pipfile @@ -11,7 +11,7 @@ fuzzywuzzy = "~=0.17" pillow = "~=8.1" pytz = "~=2019.2" sentry-sdk = "~=0.19" -PyYAML = "~=5.3.1" +PyYAML = "~=5.4" "discord.py" = {extras = ["voice"], version = "~=1.5.1"} async-rediscache = {extras = ["fakeredis"], version = "~=0.1.4"} emojis = "~=0.6.0" diff --git a/Pipfile.lock b/Pipfile.lock index d09588cf..64cae8cc 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "cf7535796e0d4f4dd6a414d8db4781caaab4a624380d29abea17577209043742" + "sha256": "427595155192c24bd1b3de5e8ffc242dc55f4390b9b90257179b5fa76457b611" }, "pipfile-spec": 6, "requires": { @@ -168,10 +168,10 @@ }, "fakeredis": { "hashes": [ - "sha256:01cb47d2286825a171fb49c0e445b1fa9307087e07cbb3d027ea10dbff108b6a", - "sha256:2c6041cf0225889bc403f3949838b2c53470a95a9e2d4272422937786f5f8f73" + "sha256:1ac0cef767c37f51718874a33afb5413e69d132988cb6a80c6e6dbeddf8c7623", + "sha256:e0416e4941cecd3089b0d901e60c8dc3c944f6384f5e29e2261c0d3c5fa99669" ], - "version": "==1.4.5" + "version": "==1.5.0" }, "fuzzywuzzy": { "hashes": [ @@ -183,54 +183,49 @@ }, "hiredis": { "hashes": [ - "sha256:06a039208f83744a702279b894c8cf24c14fd63c59cd917dcde168b79eef0680", - "sha256:0a909bf501459062aa1552be1461456518f367379fdc9fdb1f2ca5e4a1fdd7c0", - "sha256:18402d9e54fb278cb9a8c638df6f1550aca36a009d47ecf5aa263a38600f35b0", - "sha256:1e4cbbc3858ec7e680006e5ca590d89a5e083235988f26a004acf7244389ac01", - "sha256:23344e3c2177baf6975fbfa361ed92eb7d36d08f454636e5054b3faa7c2aff8a", - "sha256:289b31885b4996ce04cadfd5fc03d034dce8e2a8234479f7c9e23b9e245db06b", - "sha256:2c1c570ae7bf1bab304f29427e2475fe1856814312c4a1cf1cd0ee133f07a3c6", - "sha256:2c227c0ed371771ffda256034427320870e8ea2e4fd0c0a618c766e7c49aad73", - "sha256:3bb9b63d319402cead8bbd9dd55dca3b667d2997e9a0d8a1f9b6cc274db4baee", - "sha256:3ef2183de67b59930d2db8b8e8d4d58e00a50fcc5e92f4f678f6eed7a1c72d55", - "sha256:43b8ed3dbfd9171e44c554cb4acf4ee4505caa84c5e341858b50ea27dd2b6e12", - "sha256:47bcf3c5e6c1e87ceb86cdda2ee983fa0fe56a999e6185099b3c93a223f2fa9b", - "sha256:5263db1e2e1e8ae30500cdd75a979ff99dcc184201e6b4b820d0de74834d2323", - "sha256:5b1451727f02e7acbdf6aae4e06d75f66ee82966ff9114550381c3271a90f56c", - "sha256:6996883a8a6ff9117cbb3d6f5b0dcbbae6fb9e31e1a3e4e2f95e0214d9a1c655", - "sha256:6c96f64a54f030366657a54bb90b3093afc9c16c8e0dfa29fc0d6dbe169103a5", - "sha256:7332d5c3e35154cd234fd79573736ddcf7a0ade7a986db35b6196b9171493e75", - "sha256:7885b6f32c4a898e825bb7f56f36a02781ac4a951c63e4169f0afcf9c8c30dfb", - "sha256:7b0f63f10a166583ab744a58baad04e0f52cfea1ac27bfa1b0c21a48d1003c23", - "sha256:819f95d4eba3f9e484dd115ab7ab72845cf766b84286a00d4ecf76d33f1edca1", - "sha256:8968eeaa4d37a38f8ca1f9dbe53526b69628edc9c42229a5b2f56d98bb828c1f", - "sha256:89ebf69cb19a33d625db72d2ac589d26e936b8f7628531269accf4a3196e7872", - "sha256:8daecd778c1da45b8bd54fd41ffcd471a86beed3d8e57a43acf7a8d63bba4058", - "sha256:955ba8ea73cf3ed8bd2f963b4cb9f8f0dcb27becd2f4b3dd536fd24c45533454", - "sha256:964f18a59f5a64c0170f684c417f4fe3e695a536612e13074c4dd5d1c6d7c882", - "sha256:969843fbdfbf56cdb71da6f0bdf50f9985b8b8aeb630102945306cf10a9c6af2", - "sha256:996021ef33e0f50b97ff2d6b5f422a0fe5577de21a8873b58a779a5ddd1c3132", - "sha256:9e9c9078a7ce07e6fce366bd818be89365a35d2e4b163268f0ca9ba7e13bb2f6", - "sha256:a04901757cb0fb0f5602ac11dda48f5510f94372144d06c2563ba56c480b467c", - "sha256:a7bf1492429f18d205f3a818da3ff1f242f60aa59006e53dee00b4ef592a3363", - "sha256:aa0af2deb166a5e26e0d554b824605e660039b161e37ed4f01b8d04beec184f3", - "sha256:abfb15a6a7822f0fae681785cb38860e7a2cb1616a708d53df557b3d76c5bfd4", - "sha256:b253fe4df2afea4dfa6b1fa8c5fef212aff8bcaaeb4207e81eed05cb5e4a7919", - "sha256:b27f082f47d23cffc4cf1388b84fdc45c4ef6015f906cd7e0d988d9e35d36349", - "sha256:b33aea449e7f46738811fbc6f0b3177c6777a572207412bbbf6f525ffed001ae", - "sha256:b44f9421c4505c548435244d74037618f452844c5d3c67719d8a55e2613549da", - "sha256:bcc371151d1512201d0214c36c0c150b1dc64f19c2b1a8c9cb1d7c7c15ebd93f", - "sha256:c2851deeabd96d3f6283e9c6b26e0bfed4de2dc6fb15edf913e78b79fc5909ed", - "sha256:cdfd501c7ac5b198c15df800a3a34c38345f5182e5f80770caf362bccca65628", - "sha256:d2c0caffa47606d6d7c8af94ba42547bd2a441f06c74fd90a1ffe328524a6c64", - "sha256:dcb2db95e629962db5a355047fb8aefb012df6c8ae608930d391619dbd96fd86", - "sha256:e0eeb9c112fec2031927a1745788a181d0eecbacbed941fc5c4f7bc3f7b273bf", - "sha256:e154891263306200260d7f3051982774d7b9ef35af3509d5adbbe539afd2610c", - "sha256:e2e023a42dcbab8ed31f97c2bcdb980b7fbe0ada34037d87ba9d799664b58ded", - "sha256:e64be68255234bb489a574c4f2f8df7029c98c81ec4d160d6cd836e7f0679390", - "sha256:e82d6b930e02e80e5109b678c663a9ed210680ded81c1abaf54635d88d1da298" - ], - "version": "==1.1.0" + "sha256:04026461eae67fdefa1949b7332e488224eac9e8f2b5c58c98b54d29af22093e", + "sha256:04927a4c651a0e9ec11c68e4427d917e44ff101f761cd3b5bc76f86aaa431d27", + "sha256:07bbf9bdcb82239f319b1f09e8ef4bdfaec50ed7d7ea51a56438f39193271163", + "sha256:09004096e953d7ebd508cded79f6b21e05dff5d7361771f59269425108e703bc", + "sha256:0adea425b764a08270820531ec2218d0508f8ae15a448568109ffcae050fee26", + "sha256:0b39ec237459922c6544d071cdcf92cbb5bc6685a30e7c6d985d8a3e3a75326e", + "sha256:0d5109337e1db373a892fdcf78eb145ffb6bbd66bb51989ec36117b9f7f9b579", + "sha256:0f41827028901814c709e744060843c77e78a3aca1e0d6875d2562372fcb405a", + "sha256:11d119507bb54e81f375e638225a2c057dda748f2b1deef05c2b1a5d42686048", + "sha256:1233e303645f468e399ec906b6b48ab7cd8391aae2d08daadbb5cad6ace4bd87", + "sha256:139705ce59d94eef2ceae9fd2ad58710b02aee91e7fa0ccb485665ca0ecbec63", + "sha256:1f03d4dadd595f7a69a75709bc81902673fa31964c75f93af74feac2f134cc54", + "sha256:240ce6dc19835971f38caf94b5738092cb1e641f8150a9ef9251b7825506cb05", + "sha256:294a6697dfa41a8cba4c365dd3715abc54d29a86a40ec6405d677ca853307cfb", + "sha256:3d55e36715ff06cdc0ab62f9591607c4324297b6b6ce5b58cb9928b3defe30ea", + "sha256:3dddf681284fe16d047d3ad37415b2e9ccdc6c8986c8062dbe51ab9a358b50a5", + "sha256:3f5f7e3a4ab824e3de1e1700f05ad76ee465f5f11f5db61c4b297ec29e692b2e", + "sha256:508999bec4422e646b05c95c598b64bdbef1edf0d2b715450a078ba21b385bcc", + "sha256:5d2a48c80cf5a338d58aae3c16872f4d452345e18350143b3bf7216d33ba7b99", + "sha256:5dc7a94bb11096bc4bffd41a3c4f2b958257085c01522aa81140c68b8bf1630a", + "sha256:65d653df249a2f95673976e4e9dd7ce10de61cfc6e64fa7eeaa6891a9559c581", + "sha256:7492af15f71f75ee93d2a618ca53fea8be85e7b625e323315169977fae752426", + "sha256:7f0055f1809b911ab347a25d786deff5e10e9cf083c3c3fd2dd04e8612e8d9db", + "sha256:807b3096205c7cec861c8803a6738e33ed86c9aae76cac0e19454245a6bbbc0a", + "sha256:81d6d8e39695f2c37954d1011c0480ef7cf444d4e3ae24bc5e89ee5de360139a", + "sha256:87c7c10d186f1743a8fd6a971ab6525d60abd5d5d200f31e073cd5e94d7e7a9d", + "sha256:8b42c0dc927b8d7c0eb59f97e6e34408e53bc489f9f90e66e568f329bff3e443", + "sha256:a00514362df15af041cc06e97aebabf2895e0a7c42c83c21894be12b84402d79", + "sha256:a39efc3ade8c1fb27c097fd112baf09d7fd70b8cb10ef1de4da6efbe066d381d", + "sha256:a4ee8000454ad4486fb9f28b0cab7fa1cd796fc36d639882d0b34109b5b3aec9", + "sha256:a7928283143a401e72a4fad43ecc85b35c27ae699cf5d54d39e1e72d97460e1d", + "sha256:adf4dd19d8875ac147bf926c727215a0faf21490b22c053db464e0bf0deb0485", + "sha256:ae8427a5e9062ba66fc2c62fb19a72276cf12c780e8db2b0956ea909c48acff5", + "sha256:b4c8b0bc5841e578d5fb32a16e0c305359b987b850a06964bd5a62739d688048", + "sha256:b84f29971f0ad4adaee391c6364e6f780d5aae7e9226d41964b26b49376071d0", + "sha256:c39c46d9e44447181cd502a35aad2bb178dbf1b1f86cf4db639d7b9614f837c6", + "sha256:cb2126603091902767d96bcb74093bd8b14982f41809f85c9b96e519c7e1dc41", + "sha256:dcef843f8de4e2ff5e35e96ec2a4abbdf403bd0f732ead127bd27e51f38ac298", + "sha256:e3447d9e074abf0e3cd85aef8131e01ab93f9f0e86654db7ac8a3f73c63706ce", + "sha256:f52010e0a44e3d8530437e7da38d11fb822acfb0d5b12e9cd5ba655509937ca0", + "sha256:f8196f739092a78e4f6b1b2172679ed3343c39c61a3e9d722ce6fcf1dac2824a" + ], + "version": "==2.0.0" }, "idna": { "hashes": [ @@ -384,22 +379,30 @@ }, "pyyaml": { "hashes": [ - "sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97", - "sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76", - "sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2", - "sha256:6034f55dab5fea9e53f436aa68fa3ace2634918e8b5994d82f3621c04ff5ed2e", - "sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648", - "sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf", - "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f", - "sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2", - "sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee", - "sha256:ad9c67312c84def58f3c04504727ca879cb0013b2517c85a9a253f0cb6380c0a", - "sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d", - "sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c", - "sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a" + "sha256:02c78d77281d8f8d07a255e57abdbf43b02257f59f50cc6b636937d68efa5dd0", + "sha256:0dc9f2eb2e3c97640928dec63fd8dc1dd91e6b6ed236bd5ac00332b99b5c2ff9", + "sha256:124fd7c7bc1e95b1eafc60825f2daf67c73ce7b33f1194731240d24b0d1bf628", + "sha256:26fcb33776857f4072601502d93e1a619f166c9c00befb52826e7b774efaa9db", + "sha256:31ba07c54ef4a897758563e3a0fcc60077698df10180abe4b8165d9895c00ebf", + "sha256:3c49e39ac034fd64fd576d63bb4db53cda89b362768a67f07749d55f128ac18a", + "sha256:52bf0930903818e600ae6c2901f748bc4869c0c406056f679ab9614e5d21a166", + "sha256:5a3f345acff76cad4aa9cb171ee76c590f37394186325d53d1aa25318b0d4a09", + "sha256:5e7ac4e0e79a53451dc2814f6876c2fa6f71452de1498bbe29c0b54b69a986f4", + "sha256:7242790ab6c20316b8e7bb545be48d7ed36e26bbe279fd56f2c4a12510e60b4b", + "sha256:737bd70e454a284d456aa1fa71a0b429dd527bcbf52c5c33f7c8eee81ac16b89", + "sha256:8635d53223b1f561b081ff4adecb828fd484b8efffe542edcfdff471997f7c39", + "sha256:8b818b6c5a920cbe4203b5a6b14256f0e5244338244560da89b7b0f1313ea4b6", + "sha256:8bf38641b4713d77da19e91f8b5296b832e4db87338d6aeffe422d42f1ca896d", + "sha256:a36a48a51e5471513a5aea920cdad84cbd56d70a5057cca3499a637496ea379c", + "sha256:b2243dd033fd02c01212ad5c601dafb44fbb293065f430b0d3dbf03f3254d615", + "sha256:cc547d3ead3754712223abb7b403f0a184e4c3eae18c9bb7fd15adef1597cc4b", + "sha256:cc552b6434b90d9dbed6a4f13339625dc466fd82597119897e9489c953acbc22", + "sha256:f3790156c606299ff499ec44db422f66f05a7363b39eb9d5b064f17bd7d7c47b", + "sha256:f7a21e3d99aa3095ef0553e7ceba36fb693998fbb1226f1392ce33681047465f", + "sha256:fdc6b2cb4b19e431994f25a9160695cc59a4e861710cc6fc97161c5e845fc579" ], "index": "pypi", - "version": "==5.3.1" + "version": "==5.4" }, "redis": { "hashes": [ @@ -432,11 +435,11 @@ }, "soupsieve": { "hashes": [ - "sha256:407fa1e8eb3458d1b5614df51d9651a1180ea5fedf07feb46e45d7e25e6d6cdd", - "sha256:d3a5ea5b350423f47d07639f74475afedad48cf41c0ad7a82ca13a3928af34f6" + "sha256:052774848f448cf19c7e959adf5566904d525f33a3f8b6ba6f6f8f26ec7de0cc", + "sha256:c2c1c2d44f158cdbddab7824a9af8c4f83c76b1e23e049479aa432feb6c4c23b" ], "markers": "python_version >= '3.0'", - "version": "==2.2" + "version": "==2.2.1" }, "urllib3": { "hashes": [ @@ -576,10 +579,10 @@ }, "identify": { "hashes": [ - "sha256:46d1816c6a4fc2d1e8758f293a5dcc1ae6404ab344179d7c1e73637bf283beb1", - "sha256:ed4a05fb80e3cbd12e83c959f9ff7f729ba6b66ab8d6178850fd5cb4c1cf6c5d" + "sha256:43cb1965e84cdd247e875dec6d13332ef5be355ddc16776396d98089b9053d87", + "sha256:c7c0f590526008911ccc5ceee6ed7b085cbc92f7b6591d0ee5913a130ad64034" ], - "version": "==2.1.3" + "version": "==2.2.2" }, "mccabe": { "hashes": [ @@ -620,10 +623,10 @@ }, "pydocstyle": { "hashes": [ - "sha256:19b86fa8617ed916776a11cd8bc0197e5b9856d5433b777f51a3defe13075325", - "sha256:aca749e190a01726a4fb472dd4ef23b5c9da7b9205c0a7857c06533de13fd678" + "sha256:164befb520d851dbcf0e029681b91f4f599c62c5cd8933fd54b1bfbd50e89e1f", + "sha256:d4449cf16d7e6709f63192146706933c7a334af7c0f083904799ccb851c50f6d" ], - "version": "==5.1.1" + "version": "==6.0.0" }, "pyflakes": { "hashes": [ @@ -634,22 +637,30 @@ }, "pyyaml": { "hashes": [ - "sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97", - "sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76", - "sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2", - "sha256:6034f55dab5fea9e53f436aa68fa3ace2634918e8b5994d82f3621c04ff5ed2e", - "sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648", - "sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf", - "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f", - "sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2", - "sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee", - "sha256:ad9c67312c84def58f3c04504727ca879cb0013b2517c85a9a253f0cb6380c0a", - "sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d", - "sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c", - "sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a" + "sha256:02c78d77281d8f8d07a255e57abdbf43b02257f59f50cc6b636937d68efa5dd0", + "sha256:0dc9f2eb2e3c97640928dec63fd8dc1dd91e6b6ed236bd5ac00332b99b5c2ff9", + "sha256:124fd7c7bc1e95b1eafc60825f2daf67c73ce7b33f1194731240d24b0d1bf628", + "sha256:26fcb33776857f4072601502d93e1a619f166c9c00befb52826e7b774efaa9db", + "sha256:31ba07c54ef4a897758563e3a0fcc60077698df10180abe4b8165d9895c00ebf", + "sha256:3c49e39ac034fd64fd576d63bb4db53cda89b362768a67f07749d55f128ac18a", + "sha256:52bf0930903818e600ae6c2901f748bc4869c0c406056f679ab9614e5d21a166", + "sha256:5a3f345acff76cad4aa9cb171ee76c590f37394186325d53d1aa25318b0d4a09", + "sha256:5e7ac4e0e79a53451dc2814f6876c2fa6f71452de1498bbe29c0b54b69a986f4", + "sha256:7242790ab6c20316b8e7bb545be48d7ed36e26bbe279fd56f2c4a12510e60b4b", + "sha256:737bd70e454a284d456aa1fa71a0b429dd527bcbf52c5c33f7c8eee81ac16b89", + "sha256:8635d53223b1f561b081ff4adecb828fd484b8efffe542edcfdff471997f7c39", + "sha256:8b818b6c5a920cbe4203b5a6b14256f0e5244338244560da89b7b0f1313ea4b6", + "sha256:8bf38641b4713d77da19e91f8b5296b832e4db87338d6aeffe422d42f1ca896d", + "sha256:a36a48a51e5471513a5aea920cdad84cbd56d70a5057cca3499a637496ea379c", + "sha256:b2243dd033fd02c01212ad5c601dafb44fbb293065f430b0d3dbf03f3254d615", + "sha256:cc547d3ead3754712223abb7b403f0a184e4c3eae18c9bb7fd15adef1597cc4b", + "sha256:cc552b6434b90d9dbed6a4f13339625dc466fd82597119897e9489c953acbc22", + "sha256:f3790156c606299ff499ec44db422f66f05a7363b39eb9d5b064f17bd7d7c47b", + "sha256:f7a21e3d99aa3095ef0553e7ceba36fb693998fbb1226f1392ce33681047465f", + "sha256:fdc6b2cb4b19e431994f25a9160695cc59a4e861710cc6fc97161c5e845fc579" ], "index": "pypi", - "version": "==5.3.1" + "version": "==5.4" }, "six": { "hashes": [ -- cgit v1.2.3 From 22ba746b3892857d1b2050eab7c1c72cd435ef48 Mon Sep 17 00:00:00 2001 From: onerandomusername <71233171+onerandomusername@users.noreply.github.com> Date: Thu, 8 Apr 2021 13:01:36 -0400 Subject: Remove topic that doesn't make sense in discord Removed the `Name one thing you like about a person to your right.` topic as it doesn't make sense in discord --- bot/resources/evergreen/starter.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/bot/resources/evergreen/starter.yaml b/bot/resources/evergreen/starter.yaml index 4fec6a10..6b0de0ef 100644 --- a/bot/resources/evergreen/starter.yaml +++ b/bot/resources/evergreen/starter.yaml @@ -6,7 +6,6 @@ - "What is better: Milk, Dark or White chocolate?" - What is your favourite holiday? - If you could have any superpower, what would it be? -- Name one thing you like about a person to your right. - If you could be anyone else for one day, who would it be? - What Easter tradition do you enjoy most? - What is the best gift you've been given? -- cgit v1.2.3