#dev-log

1 messages ยท Page 30 of 1

odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#

Description

.latex command doesn't seem to be allowed inside help post threads

Steps to Reproduce

just typing the .latex command inside any help post thread

Expected Behaviour

the .latex command to work and render the inputted latex in a python help thread like it says it should

Actual Behaviour

says its only allowed within #python-help but clearly doesn't work for threads

Known Impacted Platforms

  • [ ] Web
  • [ ] Desktop
  • [ ] Android App
  • [ ] iOS App

...

odd spireBOT
regal archBOT
#
[python-discord/bot-core] New branch created: Check-parent-channel-in-whitelist-check
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: nedbat-patch-1
odd spireBOT
regal archBOT
#
jb3
[python-discord/bot] branch deleted: nedbat-patch-1
oak estuaryBOT
odd spireBOT
oak estuaryBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#

Description

https://github.com/python-discord/sir-lancebot/blob/c8526d7935ee37389d10b03e833ccdeb2faa5101/bot/exts/utilities/githubinfo.py#L123-L125

This data is provided in the issue body under the pull_request key. We don't need to fetch a second time.

Reasoning

This will halve the requests used to look up a pull request, which stacks when looking up 2 or 3 pull requests at a time.

Proposed Implementation

Additional Details

Would you like to implement this yoursel...

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

They are not particularly hidden, and referring to them as built-in seems a little confusing.

A blank Python file has the following pre-defined variables:  `__doc__, __name__, __cached__, __spec__, __loader__, __package__, __annotations__, __file__`, and `__builtins__`

Still not a massive fan, it would be more accurate to say "a Python module ... pre-defined attributes:", but that may be overly pedantic :)

odd spireBOT
regal archBOT
#

Is this issue still up for grabs? Would it be a valid approach to split the cases and match Christmas ๐ŸŽ„ and Tree ๐ŸŒฒ? If so, I would like to take on this one.

Hi, This is still up for grabs!

I think we want to avoid matching anything on just tree as the main issue currently is that it's quite noisy, especially since a tree is a common data structure.

If you are still interested feel free to open a PR :)

regal archBOT
#
  • Reusing the bot's internal http_session is more efficient than creating a new one.
  • Including a contact method (e.g. the URL to the project) in the user agent is good practice.
            async with self.bot.http_session.get(
                "https://icanhazdadjoke.com",
                headers={
                    "Accept": "application/json",
                    "User-Agent": "Sir-Lancebot (https://github.com/python-discord/sir-lancebot)",
                }
     ...
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3

Thanks. Looks good besides the comment about exception handling.

Maybe we should only be doing this when RedirectOutput.delete_invocation is true. But in practice this is a global option and the default is true, so it's probably not worth our time. I'm not sure why we even have a config option for that.

If we have the option we may as well implement the functionality. I think just wrapping the network request section in an if statement should cover it? Once the definition for `p...

regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
jb3

Previously, you defined paste_link = None such that if the network request failed the variable would still be defined, it would be picked up that there was no link and no hyperlink would be inserted.

In the linked commit the variable was removed instead of being changed to the new variable (paste_response). You need to add back an initialisation of that variable to None before with ClientSession operations.

See also the additional comment from Mark & myself regarding supporting the ...

regal archBOT
#

Thanks. Looks good besides the comment about exception handling.
Maybe we should only be doing this when RedirectOutput.delete_invocation is true. But in practice this is a global option and the default is true, so it's probably not worth our time. I'm not sure why we even have a config option for that.

If we have the option we may as well implement the functionality. I think just wrapping the network request section in an if statement should cover it? Once the definition fo...

regal archBOT
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

I was thinking about this earlier, I'm half considering removing the explicit mentions of the thresholds or how we calculate them.

I'm tempted to make the messages a bit more generic, along the lines of "you have not been on the server for long enough" and like "you haven't actively participated in the server for long enough" instead of trying to explain the thresholds or what a 10-minute block is.

I think @Mindful-Developer and I also talked at some point about removing the threshold ...

regal archBOT
#
jb3

The CTA for not being in the server long enough being "keep chatting" doesn't necessarily make sense, they just need to kind of wait for those circumstances.

I think instead of adding it in the message we could add a generic footer to the rejection message (after the reasons list) like "Continuing to participate positively in the community will allow you to easily meet these criteria, check back soon!".

#

I was thinking about this earlier, I'm half considering removing the explicit mentions of the thresholds or how we calculate them.

I'm tempted to make the messages a bit more generic, along the lines of "you have not been on the server for long enough" and like "you haven't actively participated in the server for long enough" instead of trying to explain the thresholds or what a 10-minute block is.

I think @Mindful-Developer and I also talked at some point about removing the t...

odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#
jb3

So, how about consolidating all of the activity requirement strings to "you haven't been active on the server for long enough"?

Basically, I think the changes we need to make here are:

  • Remove the message total thresholds, removing the configuration values for those and the checks in the voice gate
  • Make the message for the activity blocks more generic, the only "message" threshold we will have will be activity blocks so use the description: `"You need to be consistently active for a...
odd spireBOT
regal archBOT
regal archBOT
#

Why do these three have alt=""? As proper links they should be clickable and with empty alt text it will be ignored by screen readers, right?

https://github.com/python-discord/site/issues/1406#issue-2446336451

"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
#
jb3

I'm just following what the issue says, but I can add it if needed.

Yes, the issue generally covers the situations where that is a problem, but this is not one of them.

Hypothetically for the following content:

<div id="main">
  <!-- where this is a decorative graphic that holds no useful user information -->
  <img src="/some/graphic.png" />
</div>

The image there is decorative, is not clickable, serves no purpose and thus is not worth having alt text for, ...

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

Opened on behalf of @python-discord/devops

Problem

Earlier today I received notice from my Vice-Best Man @ChrisLovering that we were misinforming users who were using the !eval command functionality of this project.

Chris rightly pointed out that the !eval command behavior is actually really !exec - we spawn a new Python process to execute the user's code, going far beyond the capabilities of the plain old eval() built-in.

Current Behavior

The !eval command currently:...

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

Adding a !stats command with the arguments of <timestamp_start, and.
Example response:

Stats for the bot repository:
Issues opened: 20
Issues closed: 15
Pull Requests opened: 10
Pull Requests closed: 2
Pull Requests merged: 8
Stars gained: 100
New contributors: 10
Commits:50

We can always add more statistics if needed or add more arguments to control the statistics.
This would also work for other repositories like Sir Lancebot, Pythondiscord Site, Snekbox, Sir Arthur and Metricity

odd spireBOT
oak estuaryBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: wookie/lower-warning-to-info
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: wookie184/fix-mentions-reply-resolving
odd spireBOT
regal archBOT
regal archBOT
#

Reproduction

The stuck typing issue is reproducable by running:

  1. !d setdoc disnake https://docs.disnake.dev/en/latest/objects.inv https://docs.disnake.dev/en/latest/api/
  2. !d disnake.Role.color
  3. !d refreshdoc

Issue

Due to the invalid base URL !d disnake.Role.color fails with this traceback

2025-10-07 22:39:01 2025-10-07 20:39:01 | WARNING | bot.exts.info.doc._cog | A network error has occurred when requesting parsing of DocItem(package='disnake', group='property', base_u...
odd spireBOT
regal archBOT
#
jb3

As mentioned in #dev-contrib this issue is a copy-paste of a closed bot issue and isn't actually what needed changing on snekbox. I've updated our build stage to use 3.14, so only the changes on bot (update of default version & removal of pre-release copy from 3.14 responses) are necessary now.

No issue is needed to make those bot changes, please just open a PR.

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

Doc item doc_item.symbol_id='string-concatenation' present in loaded documentation inventories not found on site, inventories may need to be refreshed.

odd spireBOT
regal archBOT
regal archBOT
#
#
regal archBOT
#
jb3
[python-discord/snekbox] New branch created: jb3/3.14-release
#
jb3

Originally introduced in commits c7fae913df7c186ea12467b10afb56b2d00c71a7 and
b7e0aeca1ebeab72fd47c7cc41b54a45542406e9.

These commits failed in CI as the tests that are run when pyenv has built a Python
binary failed:

 > [builder-py-3_14 1/1] RUN /build_python.sh 3.14.0:
996.0 
996.0 FAILED (failures=3, skipped=10)
996.0 test test_xml_etree_c failed
996.0 0:02:06 load avg: 3.06 [43/43] test_xml_etree_c failed (3 failures)
996.0 
996.0 Total duration: 2 min 6 sec
996.0 Total tests: ru...
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
jb3
[python-discord/snekbox] branch deleted: jb3/3.14-release
regal archBOT
#
jb3
[python-discord/bot] New branch created: jb3/eval-command-3.14
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/snekbox] New branch created: jb3/3.14t-and-deps
#
jb3

draft: true

Python (code eval) & dependency version upgrades

[!NOTE]
This does not change the version of Python used to run the snekbox API and
wrap around nsjail, just the versions that are available within the execution
environment.

This PR:

  • Removes Python 3.13t
  • Adds Python 3.14t
  • Defaults snekbox to use 3.14 when no version is specified
  • Upgrades Python 3.13.5 to 3.13.8
  • Updates integration tests accordingly to reflect these changes
ocean rock
#

i hate emacs

regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
jb3

forkserver becoming the default start method means this is required (both forkserver and spawn will raise RuntimeError if the main module cannot be safely imported).

In 3.14, forkserver became the default for POSIX (Windows and macOS continue to use spawn), previously fork was used which did not require this.

https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods

regal archBOT
odd spireBOT
regal archBOT
#
jb3

4f6291e Update Python versions, add 3.14t, remove 3.13t... - jb3
39620bc Update integration tests accordingly for new de... - jb3
5a7f193 Update eval packages and remove unnecessary ver... - jb3
f174f41 Update numpy version used for integration tests... - jb3
d018ee9 Update nsjail tests to try avoid multiprocessin... - jb3

#
jb3
[python-discord/snekbox] branch deleted: jb3/3.14t-and-deps
#
jb3

63ed6dd Re-order SupportedPythonVersions to default to ... - jb3
1344368 Remove notice about 3.14 being pre-release - jb3
e81b0f1 Move snekbox operational and typing constants t... - jb3
4ff670c Update EvalJob to fetch default Python version ... - jb3
92a0fb8 Stop using Literal ordering to determine defaul... - jb3

#
jb3
[python-discord/bot] branch deleted: jb3/eval-command-3.14
oak estuaryBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/snekbox] New branch created: jb3/3.14-jit
regal archBOT
#

This is my understanding.
Use the on_voice_state_update event
Check if:
-The member has the moderator role (but not โ€œmod-teamโ€).
-The channel is public (not private or stage).
-The moderator is not deafened.

Grant temporary permissions using await channel.set_permissions(member, speak=True)
or grant a temporary โ€œspeakโ€ permission to a specific role like everyone

And then check if the person has any active infacs(i don't know how to do this but I think `member.communication_disabled_...

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

Send the reminder to e.g. #bot-commands if it failed to send. Is it ok to send reminders that may have been run in a private channel to a public channel though?
Idea: send it in the parent channel if the user has permissions to send messages in the parent channel. If the user doesn't have permissions in the parent channel, dm the user. If we cannot dm the user, ping the user in bot commands.

We can also try to fetch the channel if it is a thread, in some cases it may want to be in a thread...

regal archBOT
ocean rock
#

saw the automerge too late lol

oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
regal archBOT
regal archBOT
#
jb3
[python-discord/bot] New branch created: jb3/eval-3.14j
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/snekbox] branch deleted: jb3/3.14-jit
regal archBOT
#
jb3
[python-discord/bot] branch deleted: jb3/eval-3.14j
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#
jb3
[python-discord/bot-core] branch deleted: Check-parent-channel-in-whitelist-check
#
jb3
[python-discord/bot-core] New tag created: v11.8.0
odd spireBOT
oak estuaryBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#
jb3

Noticing there's not further progress on this, but it seems that snekbox supports this, just undocumented. What do we need to do to move forward on this?

There are ongoing internal discussions about this that probably need condensing into a well-formed public issue at some point.

Step 1 is complete, we do build additional interpreters in the snekbox image. We do this in a slightly different order to the initially proposed order (we build interpreters first and then build snekbox on top of...

night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
#

Decide on how we want to separate snekbox from Python executable building (basically where the line gets drawn between snekbox as an app and pydis as a snekbox consumer)

As cool as snekbox is, it is literally named snekbox: snake: python. This name sort of locks into being a python code runner rather than anything else. Plus, the endpoint is at /eval, at the root.

Changing scope would require updating and migrating the API in a backwards compatiable manner.

As for building interpreters...

#
jb3

As cool as snekbox is, it is literally named snekbox: snake: python. This name sort of locks into being a python code runner rather than anything else. Plus, the endpoint is at /eval, at the root.

This is a little bit ridiculous and I disagree completely, I think that locking project scopes based on names is silly (unless they are descriptive names like python-eval-api or something). Snekbox can be whatever we want and we actively have had ideas internally and in #dev-contrib before ab...

#

Here are my thoughts, disregard if its not helpful.

<details>
<summary>Details</summary>

We need to decide how/if we are exposing an executable list to end users. This is also something we've discussed at length internally and the consensus seems to be returning a list of the /snekbin/ files whilst supporting symlinks from there to prevent accidental restriction of functionality.

My thoughts are as follows

Deprecate /eval, replace with the following:
/python
/python/exec/[version]

add ...

#
jb3

This seems overcomplicated. My mental construction of how this looks is a lot simpler.

  • Store binaries such as python-3.14j, python-3.14 in /snekbin/ (as we currently do), these can be added by a new Docker stage that builds after the base (instead of before like we currently have, see the end of my above comment)
  • Return a list of /snekbin/ contents via a new API endpoint, confirm they have execute bit set, the symlink destinations exist, etc.
  • Consumers can then just match bas...
#
jb3

I think if we are trying to generalise then keeping specific functionality is something we need to carefully consider, and adding an endpoint of /python/exec/3.14 that just maps into /snekbin/python-3.14 doesn't seem like it's worth keeping a specific Python thing.

The client already has to know the version to call that endpoint, and having it as a path-param vs a generic backwards compatible body parameter doesn't give a huge benefit.

regal archBOT
#
jb3
[python-discord/snekbox] New branch created: jb3/pydis-version-separation
#
jb3

This PR makes a start at decoupling the specific setup of snekbox PyDis uses and snekbox as a standalone application.

This is done by building a basic snekbox application that supports evaluation using only the system version of Python.

We then have a new separate Dockerfile.pydis that uses the pre-built versions from python-discord/python-builds.

An integration specific image using this Dockerfile is built for integration tests ...

#
jb3
[snekbox] Branch jb3/pydis-version-separation was force-pushed to `ce261ad`
regal archBOT
#
jb3
[snekbox] Branch jb3/pydis-version-separation was force-pushed to `4d1fe8e`
#
jb3
[snekbox] Branch jb3/pydis-version-separation was force-pushed to `82ffbba`
#
jb3
[snekbox] Branch jb3/pydis-version-separation was force-pushed to `ab15b8c`
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[snekbox] Branch jb3/pydis-version-separation was force-pushed to `b74419d`
#
jb3
[snekbox] Branch jb3/pydis-version-separation was force-pushed to `77685ac`
#
jb3
[snekbox] Branch jb3/pydis-version-separation was force-pushed to `77685ac`
#
jb3
[snekbox] Branch jb3/pydis-version-separation was force-pushed to `05a0526`
#
jb3
[snekbox] Branch jb3/pydis-version-separation was force-pushed to `f118990`
regal archBOT
regal archBOT
#
jb3
[snekbox] Branch jb3/pydis-version-separation was force-pushed to `d08f0bc`
oak estuaryBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
#

There is some potential for false positives here as there is nothing inherently wrong with an unnormalised URL. I don't think it's really an issue because I can only think of examples that you would have to craft on purpose, e.g. if you percentage encode part of the URL (e.g. if you had a file called # or ? :D) and decide to do it in lowercase %3f, yarl will normalise to uppercase %3F.

This is definitely better than allowing arbitrary requests to be made, and I can't really think of ...

#

Botstrap can be enhanced to provide a few additional useful features for a user using botstrap for the first time.

  • if the bot isn't in the configured guild, it can print an invite link for itself
  • it can update its application flags to support message and member intents

There's also the following issues:

  • If botstrap quits early, it only shows a warning: paired with the rest of the logging this isn't apparent that execution stopped early. This should be upped to an error or even fata...
odd spireBOT
regal archBOT
#

Tested on this branch, seems to work:
<img width="1166" height="227" alt="image" src="https://github.com/user-attachments/assets/e259272c-544d-4c92-9c4b-91dd4e75bb66" />

Meanwhile, on main:
<img width="1264" height="201" alt="image" src="https://github.com/user-attachments/assets/3153bcaf-e8d2-4c0f-9490-ade83fc7f79b" />

raw url tested: https://github.com/onerandomusername/ghre-tester/blob/9be3025d879813db5f6524338002539ad0264e45/README.md%3Fplain%3D1#L1

#

5aa0398 Implement URL normalization in code snippet han... - onerandomusername
b8ab113 build: add explicit dependency on yarl - onerandomusername
4b36bfc clarify when yarl performs this normalisation - onerandomusername
db15f63 Merge pull request #3409 from onerandomusername... - wookie184

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

This is a valid link to a snippet on GitHub https://github.com/astral-sh/uv-pre-commit/blob/571189337017c8bdbf22a0977b9e44d33b5e5ae9/.pre-commit-hooks.yaml#L11C1-L20C38

This should be considered in the codesnippets cog at least for github

IMO nothing special needs to be done for characters for github, as there's not a good way to portray that in discord, so we only need to fix the regex (and any additional handing)

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

I have a test guild that hasn't been updated recently. I understand that while I'm probably an outlier, it would be nice to be able to upgrade existing test guilds, if sir-lancebot, sir robin, or bot gets an update that requires a new channel or role that doesn't exist in the user guild.

This would need to be opt-in, in order to not delete channels or roles or webhooks the user has created for a different reason. It should have options to upgrade the server and ask on every delete, or approv...

odd spireBOT
regal archBOT
#

Another configuration update? Didn't we just stop using yaml?!

As apparent while working on botstrap and updating the contributing guide, it is very confusing how to configure specific variables for the environment without having to configure a LOT of manual values. Some people additionally don't want to manually configure their bot or have a large test server where they don't want to run botstrap.

A toml file configuration format should be supported, and .env.server should be deprecated....

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

This has been discussed more by @decorator-factory and @jb3 in the discord server, and shared in the dev-contrib channel.

One of the takeaways is that using something with a baseline such as basedpyright or basedmypy would allow us to essentially ignore all of the existing errors and fix them as the code in those files is touched. This is what I've done for my own bot (under @decorator-factory's reccomendation) and its seemed to work pretty well: I have 50 errors remaining under pyright's ...

regal archBOT
regal archBOT
#

In the following line, it would be helpful to provide the context to the end-user regarding where this message was uploaded. This can be done with adding a simple [Context](message.url) where message.url is a link to either the user's sent message or the replied message involving the paste link. I think for this case, it makes sense to provide a context url to the replied message.

It is this segment of lines that need to be modified:
https://github.com/python-discord/bot/blob/2640aaa5665...

#

We're not catching or responding when a user cannot be DMed when uploading a paste message: we should try/catch the author.send() method.

I don't know what behaviour we should have regarding deleting the paste, continuing with the upload, or what we should do if DMs are closed.

https://github.com/python-discord/bot/blob/2640aaa5665426e5350b3ce81a743a9f4c3898aa/bot/exts/utils/attachment_pastebin_uploader.py#L131

related to #3422

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

Example: #ot2-never-nesterโ€™s-nightmare message

This leads to some false positives when a gallery of 7 or more attachments are sent on a message.

https://github.com/python-discord/bot/blob/2640aaa5665426e5350b3ce81a743a9f4c3898aa/bot/exts/filtering/_filters/antispam/attachments.py#L12-L21

It would be great to support full 10 attachments before triggering this rule so a single message with 10 attachments doesn't trigger the antispam rule.

odd spireBOT
oak estuaryBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#
jb3

Having a registry allows us to use the newly built ghcr.io/python-discord/snekbox image for our snekbox-pydis build (you will see later that images are pushed to localhost:5000).

https://stackoverflow.com/a/63927832

There is probably some combination of cache-to/cache-from that may also work here but creating a local registry is a 3 second operation that then ensure we are using the right images and there will be no attempt made to pull images if the cache operations fail for what...

#
jb3

Old:

root@snekbox-6c47cc4bf5-9gchm:/snekbox# python -m snekbox --help
usage: snekbox [-h] code [nsjail_args ...] [--- py_args ...]

positional arguments:
  code         the Python code to evaluate
  nsjail_args  override configured NsJail options (default: [])
  py_args      arguments to pass to the Python process (default: ['-c'])

options:
  -h, --help   show this help message and exit

New:

root@a7cdb21501e0 /snekbox
โฏ python -m snekbox --help
usage: snekb...
regal archBOT
#

Description

Dead image in monster survey command.

Steps to Reproduce

.monster show goofy

Expected Behaviour

Show the image of goofy.

Actual Behaviour

Image is not shown.

Known Impacted Platforms

All platforms

Possible Solutions

This link is no longer present on the server we hosted it from.

https://github.com/python-discord/sir-lancebot/blob/17dc08a70531eac2f9ed5a3501bfc59b9ae2c079/bot/resources/holidays/halloween/monstersurvey.json#L18

I'm not sure the ...

#

This year, AOC is only 12 days long, and there is no global leaderboard.

https://adventofcode.com/2025/about#faq_num_days

Robin may already support 12 days, but it seems there are some places in revival of code that will need to support this new development.

Any code relating to this year and global leaderboard should be removed, and any commands that assume days 13-25 exist should respect the number of days in the year: 25 for 2015-2024, and 12 for 2025+.

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

Why is the default shown twice now?

We hard-coded it previously but now switching it from store_const appears to display it again, we can remove our hardcoding.

They're now options rather than positional arguments. That's confusing.

Yeah, I'll be honest I'd just updated it to maintain functionality because argparse in 3.14 broke it, hadn't looked at how it changed the help command.

I'll have a play around to see if I can maintain behaviour on 3.14 and keep the help command use...

regal archBOT
odd spireBOT
regal archBOT
#
jb3

Thanks for addressing review feedback.

Only a couple of points left now, but also a couple of wider points:

  • I think the with block we use now to run the script is too long and I think things like the webhook management & emoji management should be moved into their own methods that we then call (the with should be as small as possible really).
  • The existing webhook if statement is still a bit scary (I thought I'd left a review comment but can't see/find it now!), I'd prefer creating ...
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
jb3

I have commented every review this needs changing ๐Ÿฅฒ.

Split out to a helper method without the complex conditions. Also, comments should always have a capital (and only be present if they actually add something, for simple conditionals they generally don't).

def find_matching_webhook(existing_webhooks, webhook_model, formatted_name, channel_id):
    for hook in existing_webhooks:
        if hook["id"] == str(webhook_model.id):
            return hook["id"]
        if hook["nam...
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: Matiiss-patch-1
#

Relevant Issues

https://discordapp.com/channels/267624335836053506/635950537262759947/1432895836609712128

Description

Removed | used within [] in a regex pattern where the intended purpose seems to have been to use it as an "or" pattern, but since it's inside [] (as opposed to ()), this is redundant and now it can match patterns like spoo||aaaa

That said, maybe it should be left as is (as a little Easter Egg)?

Did you:

  • [x] Join the [**Python Discord Communit...
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/bot] New branch created: jb3/3.14-upgrade
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
jb3

I am changing the scope slightly of this.

We will not support messages with more than 6 attachments still, as anything over that just generates huge screen filling messages that don't really have a place in Python Discord.

However, for the first instance of a user posting >6 attachments we should not mute, just delete & notify the user (all should be possible through the existing filter system).

If a user then continues to post attachments within a certain cooldown period (let's say 2 minu...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

I see no harm in allowing 10 attachments when we allow three embeds from websites:

<img width="1027" height="1390" alt="Image" src="https://github.com/user-attachments/assets/6b2863e0-7d68-4b9f-8a07-fe2e710591fc" />

<img width="999" height="1403" alt="Image" src="https://github.com/user-attachments/assets/178f5593-a3d6-459b-a70c-1a92bb7c5bc1" />

The ten (media) attachments is smaller than 3 embeds from GitHub. This should be considered when moderating 10 attachments on messages.

odd spireBOT
regal archBOT
#
jb3

This has been discussed internally amongst Moderators and the specified behaviour above maintaining the max 6 attachments (but improving the UX for users caught by the filter) is what has been decided.

In future (and in separate issues), maybe we should think about:

  • Auto-suppressing embeds when a message has loads of them, because it is just as noisy
  • Lowering the attachment limit to something lower (e.g. 3) if the attachments are non-images.

For this specific issue though, the specifica...

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

Description

Implement commands like .quote or .rquote for retrieving random quotes and commands like .dquote or .daily_quote to retrieve a daily quote that is consistent throughout the day.

Reasoning

It will be a fun command for people to use when they are bored or need motivation.

Proposed Implementation

API like zenquotes api can be used.

Would you like to implement this yourself?

  • [x ] I'd like to implement this feature myself
  • [ ] Anyone can implement this fea...
regal archBOT
#

Relevant Issues

Closes #1706

Description

  • Make bot/utils/quote.py for API requests using aiohttp.
  • Add .quote and .daily_quote commands in bot/exts/fun/fun.py with aliases such as .rquote for random quote and .dquote for the daily quote.

Did you:

  • [x] Join the Python Discord Community?
  • [x] Read all the comments in this template?
  • [x] Ensure there is an issue open, or link relevant discord discussions?
  • [x] Read and agree ...
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3

These commands should be in a group together (e.g. .quote random and .quote daily).

See review comments, but additionally:

  • The API usage is metered, so you should cache the daily quote for a period instead of making frequent requests.
  • The ZenQuotes license mandates that you provide attribution when you use quotes from their API on their free plan (see https://docs.zenquotes.io/zenquotes-documentation/#use-limits). We need to either do this or find an API that does not require attribu...
regal archBOT
regal archBOT
#
jb3

๐Ÿ”ง Internalizing async-rediscache into pydis_core

Given that the upstream async-rediscache package has become largely unmaintained ๐Ÿš๏ธ and no longer receives timely updates or fixes ๐Ÿ›, it would be prudent to internalize its functionality within our own project.

By moving the relevant components into a vendored utility inside pydis_core ๐Ÿ“ฆ, we can ensure:

  • Long-term stability ๐Ÿ›ก๏ธ - No more waiting on abandoned dependencies
  • Maintained compatibility ๐Ÿ”— - Better integration wit...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3

Where else would it be? It's a parameter for the action, not for uv itself (despite uv having a identically named parameter).

https://github.com/astral-sh/setup-uv/blob/30ce38e20653a26dd16caa082b010cec334ccf56/src/download/download-version.ts#L180-L183

We want to:

  • Always use the lowest confirmed working version of uv in CI (for us it'll use 0.9.7 since our specifier is >=0.9.7)
  • Simultaneously, we don't want to annoy people developing locally with newer versions of uv by addi...
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
jb3

This can be formatted nicer, e.g.:

<img width="255" height="172" alt="Image" src="https://github.com/user-attachments/assets/93eaa976-a916-44b4-9a96-f0e013e540d1" />

I created that one with:

e = Embed(
  title="Daily Quote",
  description="> Test, test, test...\n*\- Some person*\n\n-# Powered by [zenquotes.io](https://zenquotes.io)"
)

Also, can we set a colour on the embed? There should be some somewhere in constants that we can use.

regal archBOT
#
jb3
[python-discord/bot] branch deleted: copilot/fix-dm-closed-error-handling
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

The global leaderboard is no more! So we should change our global leaderboard command.

The change should cover the following things:

#

AoC has been 25 days for 10 years--since it's creation. We rely on that fact in several places in our our codebase. This issue will capture changing all those various places in one fell swoop. Some of these issues get tricky if they are commands that allow us to look at previous years, because we then need to add some special casing to allow for prior 25-day years and the future 12-day years.

Here's a probably non-exhaustive but at least a good start list:

  • Parsing raw leaderboard data shou...
#

Our day-star command supports looking at previous years for how people were able to complete specific day-star combinations.
This gets complicated with future years now only being 12-days but the command being able to look back in time at years with the full 25-days.

This command should be able to gracefully handle both. How? I am open to suggestions from whoever wants to implement this.

If this goes unimplemented by Dec 1, I'll likely just disable this command for the time being.

regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
thin oysterBOT
#
Sir Robin

Connected!

odd spireBOT
regal archBOT
odd spireBOT
thin oysterBOT
#
Sir Robin

Connected!

odd spireBOT
thin oysterBOT
#
Sir Robin

Connected!

odd spireBOT
thin oysterBOT
#
Sir Robin

Connected!

odd spireBOT
regal archBOT
odd spireBOT