diff options
-rw-r--r-- | Dockerfile | 2 | ||||
-rw-r--r-- | bot/constants.py | 1 | ||||
-rw-r--r-- | bot/exts/fun/latex.py | 1 | ||||
-rw-r--r-- | bot/exts/fun/snakes/_snakes_cog.py | 8 | ||||
-rw-r--r-- | bot/utils/checks.py | 10 | ||||
-rw-r--r-- | poetry.lock | 45 | ||||
-rw-r--r-- | pyproject.toml | 10 |
7 files changed, 40 insertions, 37 deletions
@@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 ghcr.io/chrislovering/python-poetry-base:3.11-slim +FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:3.11-slim # Install dependencies WORKDIR /bot diff --git a/bot/constants.py b/bot/constants.py index fed41ab9..7e5fa1d9 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -57,6 +57,7 @@ class Channels(NamedTuple): off_topic_0 = 291284109232308226 off_topic_1 = 463035241142026251 off_topic_2 = 463035268514185226 + python_help = 1035199133436354600 sir_lancebot_playground = int(environ.get("CHANNEL_COMMUNITY_BOT_COMMANDS", 607247579608121354)) voice_chat_0 = 412357430186344448 voice_chat_1 = 799647045886541885 diff --git a/bot/exts/fun/latex.py b/bot/exts/fun/latex.py index 311b4ac2..8af05413 100644 --- a/bot/exts/fun/latex.py +++ b/bot/exts/fun/latex.py @@ -37,6 +37,7 @@ PAD = 10 LATEX_ALLOWED_CHANNNELS = WHITELISTED_CHANNELS + ( Channels.data_science_and_ai, Channels.algos_and_data_structs, + Channels.python_help, ) diff --git a/bot/exts/fun/snakes/_snakes_cog.py b/bot/exts/fun/snakes/_snakes_cog.py index 96718200..d0542c23 100644 --- a/bot/exts/fun/snakes/_snakes_cog.py +++ b/bot/exts/fun/snakes/_snakes_cog.py @@ -598,7 +598,7 @@ class Snakes(Cog): Written by Momo and kel. Modified by juan and lemon. """ - with ctx.typing(): + async with ctx.typing(): # Generate random snake attributes width = random.randint(6, 10) @@ -637,7 +637,7 @@ class Snakes(Cog): Created by Ava and eivl. """ - with ctx.typing(): + async with ctx.typing(): if name is None: name = await Snake.random() @@ -693,7 +693,7 @@ class Snakes(Cog): Made by Ava and eivl. Modified by lemon. """ - with ctx.typing(): + async with ctx.typing(): image = None @@ -1047,7 +1047,7 @@ class Snakes(Cog): Written by Momo and kel. Modified by lemon. """ - with ctx.typing(): + async with ctx.typing(): embed = Embed() user = ctx.author diff --git a/bot/utils/checks.py b/bot/utils/checks.py index 5433f436..857b6746 100644 --- a/bot/utils/checks.py +++ b/bot/utils/checks.py @@ -60,16 +60,20 @@ def in_whitelist_check( # categories, it's probably not wise to rely on its category in any case. channels = tuple(channels) + (redirect,) - if channels and ctx.channel.id in channels: + ctx_channel = ctx.channel + if hasattr(ctx_channel, "parent"): + ctx_channel = ctx_channel.parent + + if channels and ctx_channel.id in channels: log.trace(f"{ctx.author} may use the `{ctx.command.name}` command as they are in a whitelisted channel.") return True # Only check the category id if we have a category whitelist and the channel has a `category_id` - if categories and hasattr(ctx.channel, "category_id") and ctx.channel.category_id in categories: + if categories and hasattr(ctx_channel, "category_id") and ctx_channel.category_id in categories: log.trace(f"{ctx.author} may use the `{ctx.command.name}` command as they are in a whitelisted category.") return True - category = getattr(ctx.channel, "category", None) + category = getattr(ctx_channel, "category", None) if category and category.name == constants.codejam_categories_name: log.trace(f"{ctx.author} may use the `{ctx.command.name}` command as they are in a codejam team channel.") return True diff --git a/poetry.lock b/poetry.lock index cd20c2f2..e519cd01 100644 --- a/poetry.lock +++ b/poetry.lock @@ -206,14 +206,14 @@ tests-no-zope = ["cloudpickle", "cloudpickle", "hypothesis", "hypothesis", "mypy [[package]] name = "beautifulsoup4" -version = "4.11.2" +version = "4.12.0" description = "Screen-scraping library" category = "main" optional = false python-versions = ">=3.6.0" files = [ - {file = "beautifulsoup4-4.11.2-py3-none-any.whl", hash = "sha256:0e79446b10b3ecb499c1556f7e228a53e64a2bfcebd455f370d8927cb5b59e39"}, - {file = "beautifulsoup4-4.11.2.tar.gz", hash = "sha256:bc4bdda6717de5a2987436fb8d72f45dc90dd856bdfd512a1314ce90349a0106"}, + {file = "beautifulsoup4-4.12.0-py3-none-any.whl", hash = "sha256:2130a5ad7f513200fae61a17abb5e338ca980fa28c439c0571014bc0217e9591"}, + {file = "beautifulsoup4-4.12.0.tar.gz", hash = "sha256:c5fceeaec29d09c84970e47c65f2f0efe57872f7cff494c9691a26ec0ff13234"}, ] [package.dependencies] @@ -583,19 +583,19 @@ flake8 = ">=5.0" [[package]] name = "flake8-bugbear" -version = "23.2.13" +version = "23.3.23" description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle." category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8.1" files = [ - {file = "flake8-bugbear-23.2.13.tar.gz", hash = "sha256:39259814a83f33c8409417ee12dd4050c9c0bb4c8707c12fc18ae62b2f3ddee1"}, - {file = "flake8_bugbear-23.2.13-py3-none-any.whl", hash = "sha256:f136bd0ca2684f101168bba2310dec541e11aa6b252260c17dcf58d18069a740"}, + {file = "flake8-bugbear-23.3.23.tar.gz", hash = "sha256:ea565bdb87b96b56dc499edd6cc3ba7f695373d902a5f56c989b74fad7c7719d"}, + {file = "flake8_bugbear-23.3.23-py3-none-any.whl", hash = "sha256:8a218d13abd6904800970381057ce8e72cde8eea743240c4ef3ede4dd0bc9cfb"}, ] [package.dependencies] attrs = ">=19.2.0" -flake8 = ">=3.0.0" +flake8 = ">=6.0.0" [package.extras] dev = ["coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit", "pytest", "tox"] @@ -1266,14 +1266,14 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2.1)", "pytes [[package]] name = "pre-commit" -version = "3.1.1" +version = "3.2.1" description = "A framework for managing and maintaining multi-language pre-commit hooks." category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "pre_commit-3.1.1-py2.py3-none-any.whl", hash = "sha256:b80254e60668e1dd1f5c03a1c9e0413941d61f568a57d745add265945f65bfe8"}, - {file = "pre_commit-3.1.1.tar.gz", hash = "sha256:d63e6537f9252d99f65755ae5b79c989b462d511ebbc481b561db6a297e1e865"}, + {file = "pre_commit-3.2.1-py2.py3-none-any.whl", hash = "sha256:a06a7fcce7f420047a71213c175714216498b49ebc81fe106f7716ca265f5bb6"}, + {file = "pre_commit-3.2.1.tar.gz", hash = "sha256:b5aee7d75dbba21ee161ba641b01e7ae10c5b91967ebf7b2ab0dfae12d07e1f1"}, ] [package.dependencies] @@ -1683,33 +1683,30 @@ full = ["numpy"] [[package]] name = "redis" -version = "4.5.1" +version = "4.5.3" description = "Python client for Redis database and key-value store" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "redis-4.5.1-py3-none-any.whl", hash = "sha256:5deb072d26e67d2be1712603bfb7947ec3431fb0eec9c578994052e33035af6d"}, - {file = "redis-4.5.1.tar.gz", hash = "sha256:1eec3741cda408d3a5f84b78d089c8b8d895f21b3b050988351e925faf202864"}, + {file = "redis-4.5.3-py3-none-any.whl", hash = "sha256:7df17a0a2b72a4c8895b462dd07616c51b1dcb48fdd7ecb7b6f4bf39ecb2e94e"}, + {file = "redis-4.5.3.tar.gz", hash = "sha256:56732e156fe31801c4f43396bd3ca0c2a7f6f83d7936798531b9848d103381aa"}, ] -[package.dependencies] -async-timeout = ">=4.0.2" - [package.extras] hiredis = ["hiredis (>=1.0.0)"] ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)"] [[package]] name = "sentry-sdk" -version = "1.16.0" +version = "1.17.0" description = "Python client for Sentry (https://sentry.io)" category = "main" optional = false python-versions = "*" files = [ - {file = "sentry-sdk-1.16.0.tar.gz", hash = "sha256:a900845bd78c263d49695d48ce78a4bce1030bbd917e0b6cc021fc000c901113"}, - {file = "sentry_sdk-1.16.0-py2.py3-none-any.whl", hash = "sha256:633edefead34d976ff22e7edc367cdf57768e24bc714615ccae746d9d91795ae"}, + {file = "sentry-sdk-1.17.0.tar.gz", hash = "sha256:ad40860325c94d1a656da70fba5a7c4dbb2f6809d3cc2d00f74ca0b608330f14"}, + {file = "sentry_sdk-1.17.0-py2.py3-none-any.whl", hash = "sha256:3c4e898f7a3edf5a2042cd0dcab6ee124e2112189228c272c08ad15d3850c201"}, ] [package.dependencies] @@ -1820,14 +1817,14 @@ files = [ [[package]] name = "taskipy" -version = "1.10.3" +version = "1.10.4" description = "tasks runner for python projects" category = "dev" optional = false python-versions = ">=3.6,<4.0" files = [ - {file = "taskipy-1.10.3-py3-none-any.whl", hash = "sha256:4c0070ca53868d97989f7ab5c6f237525d52ee184f9b967576e8fe427ed9d0b8"}, - {file = "taskipy-1.10.3.tar.gz", hash = "sha256:112beaf21e3d5569950b99162a1de003fa885fabee9e450757a6b874be914877"}, + {file = "taskipy-1.10.4-py3-none-any.whl", hash = "sha256:b96245d7f2956d36821435acaa822143ef6d2ff6cfecc48cf0a48c4b95456c14"}, + {file = "taskipy-1.10.4.tar.gz", hash = "sha256:0006429f708f530fc7add28ca51fd41f6c6e1fbe86763ff05125e1af3e8bdc7e"}, ] [package.dependencies] @@ -1989,4 +1986,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "3.11.*" -content-hash = "9018f5c541f3c7236545ca12c35264f3c838b3fae0458ddc798b71b0b404fa50" +content-hash = "5f97ffcdaae6fd511c6f86ec9fbc6a89a6b1f08b89e86258566e4ffd0c8f7f75" diff --git a/pyproject.toml b/pyproject.toml index e4e9d956..678350bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,9 +14,9 @@ pydis_core = { version = "9.5.1", extras = ["async-rediscache"] } aiodns = "3.0.0" rapidfuzz = "2.13.7" arrow = "1.2.3" -beautifulsoup4 = "4.11.2" +beautifulsoup4 = "4.12.0" pillow = "9.4.0" -sentry-sdk = "1.16.0" +sentry-sdk = "1.17.0" PyYAML = "6.0" emojis = "0.7.0" coloredlogs = "15.0.1" @@ -28,7 +28,7 @@ pyjokes = "0.6.0" [tool.poetry.dev-dependencies] flake8 = "6.0.0" flake8-annotations = "3.0.0" -flake8-bugbear = "23.2.13" +flake8-bugbear = "23.3.23" flake8-docstrings = "1.7.0" flake8-string-format = "0.3.0" flake8-tidy-imports = "4.8.0" @@ -36,9 +36,9 @@ flake8-todo = "0.7" flake8-isort = "6.0.0" pep8-naming = "0.13.3" pip-licenses = "4.1.0" -pre-commit = "3.1.1" +pre-commit = "3.2.1" python-dotenv = "1.0.0" -taskipy = "1.10.3" +taskipy = "1.10.4" [tool.taskipy.tasks] start = "python -m bot" |