#dev-log

1 messages ยท Page 25 of 1

regal archBOT
#
jb3
[python-discord/bot] New branch created: jb3/bugfix/user-alts-response-code-error
#
jb3

Restores previous behaviour that allows the !user command to look up users who
are not in the guild.

When the alts feature was implemented we added a new API call to
/bot/users/{user_id}, which was fine, but it meant that if that 404'd and a
ResponseCodeError was raised then the bot would start returning erroneous
responses that implied a user does not exist, when they did exist, they were
just not in our site database.

odd spireBOT
regal archBOT
#
jb3
[python-discord/king-arthur] branch deleted: renovate/configure
odd spireBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/king-arthur] branch deleted: renovate/sentry-sdk-2.x
odd spireBOT
regal archBOT
#
jb3
[python-discord/forms-backend] branch deleted: renovate/configure
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/forms-backend] branch deleted: renovate/actions-checkout-4.x
odd spireBOT
regal archBOT
#
jb3
[python-discord/forms-backend] branch deleted: renovate/major-github-artifact-actions
odd spireBOT
regal archBOT
#
jb3
[python-discord/forms-backend] branch deleted: renovate/sentry-sdk-2.x-lockfile
#
jb3
[python-discord/forms-backend] branch deleted: renovate/azure-k8s-set-context-4.x
odd spireBOT
regal archBOT
#
jb3
[python-discord/forms-backend] branch deleted: renovate/pydantic-2.x
odd spireBOT
regal archBOT
#
jb3
[python-discord/forms-backend] branch deleted: renovate/docker-login-action-3.x
#
jb3
[python-discord/forms-backend] branch deleted: renovate/docker-setup-buildx-action-3.x
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
jb3
[bot] Branch jb3/bugfix/user-alts-response-code-error was force-pushed to `2b3cf22`
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
jb3
[bot] Branch jb3/bugfix/user-alts-response-code-error was force-pushed to `55533d4`
odd spireBOT
regal archBOT
#
jb3
[bot] Branch jb3/bugfix/user-alts-response-code-error was force-pushed to `56cbae1`
#
jb3
[bot] Branch jb3/bugfix/user-alts-response-code-error was force-pushed to `10df677`
odd spireBOT
regal archBOT
#
jb3
[python-discord/bot] branch deleted: jb3/bugfix/user-alts-response-code-error
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-robin] New branch created: cj11_permissions_updates
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/sir-robin] branch deleted: cj11_permissions_updates
thin oysterBOT
#
Sir Robin

Connected!

odd spireBOT
odd spireBOT
oak estuaryBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

oak estuaryBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: more-frameworks
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
jb3
[python-discord/site] branch deleted: more-frameworks
odd spireBOT
regal archBOT
#
[python-discord/forms-frontend] New branch created: add-redis-for-local-dev
#
[python-discord/forms-backend] New branch created: redis-member-cache
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/forms-backend] New branch created: redis-role-cache
regal archBOT
#

Looks good, though I have two questions:

odd spireBOT
regal archBOT
#

Thanks for the PR! I haven't tested the code yet, but here are some comments.

A few more things I'd like to point out:

  • I'm not sure what you mean by "the annotations were wrong before". Could you elaborate a bit on that?
  • Thread isn't a subclass of TextChannel so TextOrVoiceChannel should be updated accordingly. Renaming it to something like SilencableChannel also seems reasonable.
  • The existing method names sound pretty inconsistent. This isn't your fault, but maybe they co...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
odd spireBOT
oak estuaryBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#

The watched_users pop here remains, but can't the same issue occur if you're trying to remove a user and list the users at the same time? Maybe it's worth converting the iterator in prepare_watched_users_data into a list before looping over it.

I guess so, I'll do that.

For the other two dicts, does this definitely resolve the issue? Looking at on_message, you could theoretically have multiple consume_messages tasks. If one task clears a queue while another is iterating over it, won...

odd spireBOT
regal archBOT
#

8eb4dc9 Timeline: Migrate to Markdown source files - in... - hedyhli
07e5006 Timeline: Remove files from old implementation - hedyhli
93c5ca6 Timeline: Move the new timeline.css in and have... - hedyhli
046199e Timeline: Use pydis blurple as default icon bac... - hedyhli
0626af3 Timeline: More muted heading links for entries - hedyhli

#
[python-discord/site] branch deleted: feat/timeline-from-yaml
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

7d84cb8 Make watched_users a dict, not a defaultdict - wookie184
fb21018 Check if user is watched before sending message... - wookie184
36f335f Pass watch info through to functions to avoid K... - wookie184
bfd9e44 Fix: dict.values() -> dict.items() - wookie184
25acba4 Copy watched_users into list to prevent modific... - wookie184

#
[python-discord/bot] branch deleted: fix-watchchannel-bugs
odd spireBOT
oak estuaryBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/forms-frontend] branch deleted: add-redis-for-local-dev
#
[python-discord/forms-backend] branch deleted: redis-member-cache
#
[python-discord/forms-backend] branch deleted: redis-role-cache
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/forms-backend] branch deleted: renovate/starlette-0.x
#
[python-discord/forms-backend] branch deleted: renovate/uvicorn-0.x-lockfile
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/site] New branch created: cj-judging-page-update
odd spireBOT
regal archBOT
#
jb3
[python-discord/site] branch deleted: cj-judging-page-update
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/king-arthur] branch deleted: slim-build
#
[python-discord/king-arthur] branch deleted: renovate/pydis-core-11.x
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/king-arthur] branch deleted: renovate/ruff-0.x
odd spireBOT
regal archBOT
#
[python-discord/king-arthur] branch deleted: renovate/sentry-sdk-2.x
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/site] New branch created: jb3/content/modmail-rules-update
#
jb3
[site] Branch jb3/content/modmail-rules-update was force-pushed to `4e7104a`
odd spireBOT
regal archBOT
#
jb3
[site] Branch jb3/content/modmail-rules-update was force-pushed to `4ac5345`
odd spireBOT
regal archBOT
#
jb3
[python-discord/site] branch deleted: jb3/content/modmail-rules-update
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/king-arthur] New branch created: jb3/features/ldap-bootstrapping
#
jb3
  • Add new dependencies for LDAP, FreeIPA and Keycloak interaction
  • Add new configuration options for talking to Keycloak, FreeIPA and LDAP
  • Add new constants to define enrollment parameters and requirements
  • Add new directory APIs for working with FreeIPA, Keycloak and LDAP
  • Add a cog for managing the syncronisation of enrolled users to LDAP
  • Update the Grafana team syncer to sync both LDAP and GitHub users
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
jb3
[king-arthur] Branch jb3/features/ldap-bootstrapping was force-pushed to `1d1ddd2`
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[king-arthur] Branch jb3/features/ldap-bootstrapping was force-pushed to `88c1721`
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[king-arthur] Branch jb3/features/ldap-bootstrapping was force-pushed to `3b975ff`
odd spireBOT
regal archBOT
#
jb3
[king-arthur] Branch jb3/features/ldap-bootstrapping was force-pushed to `0bb3c88`
odd spireBOT
regal archBOT
#
jb3
[python-discord/king-arthur] branch deleted: jb3/features/ldap-bootstrapping
odd spireBOT
regal archBOT
#
[python-discord/king-arthur] branch deleted: renovate/pydis-core-11.x
odd spireBOT
odd spireBOT
regal archBOT
#

Currently, if we want to use bot core's paginator, and override the emojis, we need to add the following boiler plate module in the upstream client code.

from collections.abc import Sequence

import discord
from discord.ext.commands import Context
from pydis_core.utils.pagination import LinePaginator as _LinePaginator, PaginationEmojis

from src.settings import EMOJI


class LinePaginator(_LinePaginator):
    """
    A class that aids in paginating code blocks for Discord...
regal archBOT
#
[python-discord/bot-core] New branch created: bootstrap-paginator
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#

Sorry for the delay, i was busy doing the code jam. I tried to fix the typing issues but a lot of other errors persist from previous code, for example [see this](#dev-contrib message), a lot of things are unknown, also the Context annotation always doesn't have the bot type var. I'm using pyright in strict mode so maybe that's why but yeah, there are a lot of typing errors across all the codebase.

odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#

Why wouldn't we use a subclass of paginator that takes an additional init arg that it uses in paginate instead? Something like

class CustomPaginationEmojisLinePaginator(LinePaginator):
    def __init__(self, *args, **kwargs) -> None:
        self.pagination_emojis = kwargs.pop("pagination_emojis", ...)  # dunno default
        super().__init__(*args, **kwargs)

    @classmethod
    async def paginate(*args, **kwargs) -> discord.Message | None:
        return await super().pag...
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/king-arthur] New branch created: jb3-patch-1
#
jb3
[python-discord/king-arthur] branch deleted: jb3-patch-1
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/king-arthur] New branch created: ldap-deps-group
odd spireBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/king-arthur] branch deleted: ldap-deps-group
odd spireBOT
regal archBOT
#
[python-discord/king-arthur] New branch created: docs
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/king-arthur] New branch created: support-slash-separated-restarts
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/king-arthur] branch deleted: renovate/kubernetes_asyncio-30.x
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: fix/resources-payment-tiers
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: fix/resources-ppg
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

As pointed out in #1363:

There are multiple h1 tags, many jumps in sequence, and several subheadings that are not associated with the parent heading.

Headings convey important semantic information to assistive technology users, helping to understand the structure and organization of the page. Heading level 1 represents the main topic of the page, heading level 2 is a sub-topic of that main heading, heading level 3 as a sub-topic of the heading level 2, etc. Headings should be sequential...

#

As pointed out in #1363:

The color s for `` elements (#ff7990 foreground, #464951 background) is 3.59:1 , which is below the minimum of 4.5:1.

Users with low vision may find it difficult to distinguish this text. Tools such as the WebAIM Color Contrast Checker can be used to ensure the contrast ratios are sufficient for most people.

This affects the events, contributing, FAQ, Rules and code of conduct pages.

#

As pointed out in #1363:

There is no mechanism to skip past the navigation bar.

Repetative content across pages in a website, such as a navigation bar, should be easily skippable by keyboard users. Ideally, the first interactable element should be a โ€œSkip to main contentโ€ link that goes to the h1 tag, or the equivalent where the main part of the page starts. For reference, check out Pythonโ€™s Wikipedia page, where pressing tab the first time skips to the wiki title.

#

As outlined by #1363:

Some elements get properly focussed with the keyboard, but this is not visually communicated to the user. Namely, the discord join link in the top bar and the embedded youtubbe video lack any form of focus indication.

Users who use a keyboard need to see what is currently in focus. Each focussed element should have an easily viewable way to distinguish it, such as a high- contrast outline or shadow.

#

As outlined in #1363:

The button to go to a specific resource at the bottom left of each card lacks any description and just reads as "link" with screen readers. This means that people using screen readers will not know where links will take them. They would have to activate the link to find out, whereas sighted users could visually identify Github and Goodreads icons, for example.

Links should describe where they will take the user. The โ€œaria-labelโ€ attribute can be defined for each li...

#

As pointed out in #1363:

Python logos and other icons in the center line of the timeline are read as โ€œlogo imageโ€ and other generic names.

While descriptive text is imperative to describe images to those who canโ€™t see them, these images are purely decorative and add no value to someone not seeing the page. Use alt=โ€โ€ instead so the experience with a screen reader is less cluttered.

regal archBOT
#

c2413a1 Resources: Use kebab-case for keys of valid_fi... - hedyhli [05d15d6](https://github.com/python-discord/site/commit/05d15d62e27cd493b9f1ba5290a87fe2edcf61ce) Resources: Fix image for People, Postgres, Data - hedyhli [d405098](https://github.com/python-discord/site/commit/d405098a4fad333b78b90b66022a7a9e8762e3be) Bump ruff from 0.5.1 to 0.5.2 - dependabot[bot] [b59b24a](https://github.com/python-discord/site/commit/b59b24a798c0b67ab72fddad064510c634d1c934) Remove unnecessary S310 noqa - wookie184 [ef38732`](https://github.com/python-discord/site/commit/ef38732a028554db082587859f742fcc3e3f9e33) Merge remote-tracking branch 'origin/fix/resour... - jchristgit

#
[python-discord/site] branch deleted: fix/resources-ppg
#
[python-discord/site] branch deleted: fix/resources-payment-tiers
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: mailmap
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: mailmap
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: archived-access-rename
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
ocean rock
#

Somebodu fix this please @DevOops I'm on mobile

mint goblet
regal archBOT
odd spireBOT
ocean rock
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/modmail-plugins] New branch created: move-ban-appeal
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/modmail-plugins] branch deleted: move-ban-appeal
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
regal archBOT
#
[python-discord/bot] New branch created: log-failed-OT-name-rename
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#

Hi @ChrisLovering! Thank you for the contribution to the bot project!

I have left a review for your work. Overall, I think your code looks good. I have a minor question.

What happens now?

Per our contribution guide, the Python Discord Developer team will review your code and get back to you with comments on what they think about the code. Generally, this will include technical questions, as well as sugges...

regal archBOT
regal archBOT
#

Wouldn't it be better if we edited the channel names one by one in different try-blocks, storing any invalid names in a list, and then including only the invalid names in this message?

  • In the current approach, if the first name is invalid, the other two names won't be used. However, I believe they will still be marked as inactive in the database, putting the valid names out of rotation for no reason.
  • It will also eliminate the guesswork in identifying which names are invalid, especi...
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

What about this?

def boostrap_line_paginator_with_emojis(pagination_emojis: PaginationEmojis) -> type[LinePaginator]:
    """Bootsrap a LinePaginator class with custom emojis."""
    class _LinePaginator(LinePaginator):
        @classmethod
        async def paginate(cls, *args, **kwargs) -> discord.Message | None:
            return await cls.paginate(*args, **kwargs, pagination_emojis=pagination_emojis)

Yeah that works, I just want to avoid arg...

odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/king-arthur] New branch created: optional-env-vars
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/site] New branch created: jb3/resources/discord.py-masterclass
odd spireBOT
regal archBOT