GitHub Actions run 17450097750 succeeded.
#dev-log
1 messages ยท Page 30 of 1
[python-discord/forms-backend] Checks Successful on PR: #296 Update dependency sentry-sdk to v2.35.2
GitHub Actions run 17459582017 succeeded.
GitHub Actions run 17469268627 succeeded.
GitHub Actions run 17470186708 succeeded.
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
...
GitHub Actions run 17472550764 failed.
eac0e9b Update in_whitelist_check to check against the ... - ChrisLovering
[python-discord/bot-core] New branch created: Check-parent-channel-in-whitelist-check
[bot-core] Branch Check-parent-channel-in-whitelist-check was force-pushed to `5a4888e`
GitHub Actions run 17479713822 failed.
Arguments wrong way around, this was probably my snippet that I wrote on mobile, apologies.
log.exception(
"Failed to upload message %d in channel %d to paste service when redirecting output",
ctx.message.id, ctx.message.channel.id
)
No worries, all good. Just commited
GitHub Actions run 17480622316 succeeded.
This probably isn't a warning really, it's expected behaviour that we are catching.
log.info(
"Failed to DM %s with redirected command paste removal link, user has bot DMs disabled",
ctx.author.name
)
Done.But this was your suggestion.
GitHub Actions run 17480702014 succeeded.
[python-discord/forms-backend] Checks Successful on PR: #296 Update dependency sentry-sdk to v2.36.0
GitHub Actions run 17493337064 succeeded.
[python-discord/bot] New branch created: nedbat-patch-1
43b18c6 A list is a better expression of the intent - nedbat
GitHub Actions run 17506006160 succeeded.
Connected!
GitHub Actions run 17507321696 succeeded.
Connected!
Connected!
[python-discord/forms-backend] Checks Successful on PR: #296 Update dependency sentry-sdk to v2.37.1
GitHub Actions run 17586384475 succeeded.
GitHub Actions run 17597556559 succeeded.
GitHub Actions run 17627379268 failed.
Thank you for the PR! FYI it'll take me a while to review this, I'm a bit swamped with work right now :-)
Thank you for the PR! FYI it'll take me a while to review this, I'm a bit swamped with work right now :-)
NP take your time
Description
Source: python-discord/meta#93
https://github.com/python-discord/meta/discussions/93
Edited for grammar, formatting, and inline code.
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 to the contributing guidelines?
GitHub Actions run 17665764083 succeeded.
GitHub Actions run 17665804255 succeeded.
GitHub Actions run 17666093615 failed.
GitHub Actions run 17666111323 failed.
GitHub Actions run 17666273644 succeeded.
GitHub Actions run 17666510546 failed.
GitHub Actions run 17666709462 failed.
GitHub Actions run 17681976345 succeeded.
Description
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...
GitHub Actions run 17684106666 failed.
GitHub Actions run 17701876774 succeeded.
GitHub Actions run 17706240442 succeeded.
GitHub Actions run 17719579690 succeeded.
Connected!
GitHub Actions run 17738677913 succeeded.
Python was invented by Guido van Rossum, affectionately known as the 'Benevolent Dictator For Life' (BDFL) of Python until he stepped down in 2018.
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 :)
Public release is more precise, and I think the wording "even a few years before Java" is a bit weird.
Python's first public release was in 1991, making it a few years older than Java!
This one is pretty meh, I'd probably remove it.
At the time of writing, small integers in Python (from -5 to 256) are cached and reused, so they will always compare identically (`a is b` will be `True` if `a` and `b` are the same number and in this range).
I don't think "primitive type" is that well defined, this feels a little weak/meaningless.
GitHub Actions run 17745790365 succeeded.
@wookie184 Comments should all be addressed; thank you very much for the review! ๐
Resolved by incorporating proposed change
Resolved by incorporating proposed change
Resolved by incorporating proposed change
Resolved by incorporating proposed change
Resolved by removing fact - wasn't able to find implementation
Won't this raise an AttributeError as .parent doesn't exist on TextChannels
Thanks for the report. It should be fixed once this PR is merged and lancebot is updated https://github.com/python-discord/bot-core/pull/305
Mostly looks good, thanks for the PR.
log.exception does not stop program flow, so you will get a NameError further down where you try to use paste_response.
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 :)
Feel free to assign me. @wookie184
In this case it seems like a user uploaded a zip file with a txt extension. I assume the same could happen if you tried to share an executable with a txt extension? If so it could be an indication of somebody trying to bypass filters, though seemlingly rare so not a high priority.
Hi, sorry for the slow review, this looks great, thank you!
I have two minor comments.
This path indicates something is wrong, it's probably a good idea to raise an error so it will be logged and we can look into it. res.raise_for_status() can be used to do this.
- 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)",
}
...
[python-discord/site] New comment on pull request #773: Add guide for working with Python on Windows
With the introduction of PEP 773 and uv this is pretty outdated and I'm not interested in working on it, so I'll close this.
[python-discord/sir-lancebot] Pull request opened: #1698 Removing tree to trigger christmas reaction
This PR aims to address the issue of reactions to the word โtreeโ that are unrelated to the season.
Closes #1403
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 to the contributing guidelines?
GitHub Actions run 17748302828 succeeded.
[python-discord/forms-backend] Checks Successful on PR: #296 Update dependency sentry-sdk to v2.37.1
GitHub Actions run 17753235429 succeeded.
Thanks! One minor comment but not too important.
The outer group isn't needed.
"christmas tree": Trigger(r"\b(christ|x)mas\b", ["\U0001F384"]),
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.
GitHub Actions run 17759327572 succeeded.
Thanks! One minor comment but not too important.
Pushed changes.
Ah yeah missed that in my review.
@DragonSenseiGuy You need to add back the initialisation of paste_response, it didn't get added when you removed paste_link here: https://github.com/python-discord/bot/pull/3377/commits/2ac2b908f0980bcbd36b08405b4cd0673aa2ca4e
It is intentional we don't stop execution.
Thanks. Looks good besides the comment about exception handling.
Maybe we should only be doing this when
RedirectOutput.delete_invocationis 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...
Relevant Issues
closes https://github.com/python-discord/sir-lancebot/issues/1697
Description
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 to the contributing guidelines?
GitHub Actions run 17772546739 succeeded.
Ah yeah missed that in my review.
@DragonSenseiGuy You need to add back the initialisation of
paste_response, it didn't get added when you removedpaste_linkhere: 2ac2b90It is intentional we don't stop execution.
Oh, sorry haven't been paying attention to this PR, I don't understand what the problem is, can someone explain it to me in detail?
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 ...
Thanks. Looks good besides the comment about exception handling.
Maybe we should only be doing this whenRedirectOutput.delete_invocationis 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...
[...]
So an
ifstatement over the entireaysnc with ClientSession() as session?
Yes, as well as the variable declaration.
GitHub Actions run 17799065655 succeeded.
GitHub Actions run 17835613012 succeeded.
1532382 Add rest of python facts from github suggestion... - greyblue9
85771ca Removing tree to trigger christmas reaction (#1... - ibirothe
Connected!
GitHub Actions run 17839609231 was cancelled.
Connected!
GitHub Actions run 17839633643 succeeded.
[bot-core] Branch Check-parent-channel-in-whitelist-check was force-pushed to `9f0162c`
Ah yeah, had my type checker off. Fixed in https://github.com/python-discord/bot-core/compare/5a4888e7bc1118e0e82e948aa2d44dcf1d882a98..9f0162c0869ee8e0ae158636c8f0eac96159a675
If this issue is still up for grabs, feel free to assign me.
GitHub Actions run 17841139483 succeeded.
If this issue is still up for grabs, feel free to assign me.
I've assigned you ๐
GitHub Actions run 17842921651 failed.
The problem is located in the converters.py, where the search for a sub does return an html (likely 404 page).
I suggest to replace this with a request for https://oauth.reddit.com/r/{sub}/about.json to validate the existence of a sub.
Is that a valid approach in your opinion?
GitHub Actions run 17858171790 succeeded.
This makes the error messages consistently use "fewer" over "less" and changes the display of the activity_blocks message to look like ... 9 10-minute blocks ... which I think is preferable to mixing numerals and words for numbers.
GitHub Actions run 17863256160 succeeded.
...9 10-minute is a bit hard to read, and that's why its words rather than numerals.
would 9/nine different 10-minute blocks be preferable? It's probably clearer as well.
GitHub Actions run 17867715604 succeeded.
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 ...
That would make more sense, yeah, agreed.
Joe, what about the following?
You have not been active for long enough to speak in voice. Keep chatting!
You have not been in the server for long enough to speak in voice. Keep chatting!
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...
GitHub Actions run 17872342065 succeeded.
GitHub Actions run 17872365040 succeeded.
GitHub Actions run 17873760737 succeeded.
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?
So, how about consolidating all of the activity requirement strings to "you haven't been active on the server for long enough"?
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...
GitHub Actions run 17895202089 succeeded.
I suggest the one I proposed for the activity blocks, and as mentioned we should get rid of the total_messages threshold (which will require other changes than just these messages).
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."
These images are not decorative. If they are the primary (and in this case sole) component within an <a> tag then they are by definition not decorative, they are serving a purpose as a hyperlink to the code jam pages and as such must have appropriate alt text.
These images are not decorative. If they are the primary (and in this case sole) component within an
<a>tag then they are by definition not decorative, they are serving a purpose as a hyperlink to the code jam pages and as such must have appropriate alt text.
I'm just following what the issue says, but I can add it if needed.
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, ...
On it, probably will have a new commit in like 1-2 days.
this will break if paste_response is None
(smh why is there no type checker in CI)
I think the logs stop it from executing?
They don't, as mentioned in wookie's previous review (logs explicitly do not stop execution, nor do we want them to).
This will need wrapping with an if paste_response:
then no else or is there a fallback option?
We don't need an else because if there isn't a paste_response then we didn't upload their paste.
GitHub Actions run 17931963803 succeeded.
Connected!
GitHub Actions run 17932015984 succeeded.
Thanks for the merge @jb3 !
this should use ctx.bot.http_session rather than creating a whole new session.
noticed this earlier but didn't see it get fixed
this is a simple fix that lessens creating an
unnecessary session
GitHub Actions run 17936086070 succeeded.
GitHub Actions run 17936112982 succeeded.
GitHub Actions run 17948661741 succeeded.
Connected!
GitHub Actions run 17951830924 succeeded.
a69fb04 Address some issues from the accessibility mile... - DragonSenseiGuy
GitHub Actions run 17987424462 failed.
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:...
Please do not take it upon yourself to approve issues.
Issues must achieve consensus amongst the class before being approved for work.
I will meet with the steering committee in the next 3-10 working days to discuss the desired output of this issue.
Chris, apologies, my agentic GPT-5 10x Developer Personality added the label, I have updated the system prompt accordingly.
Apology accepted.
Due to scheduling conflicts the steering committee meeting was moved to 13 seconds ago. We used Claude to summarise your issue description and have found it sufficiently interesting to approve for promotion to the kanban board backlog.
Thanks for your continued contribution.
Noticed some spotty grammar when reading the testing readme.
We need to fix this immediatelyโmisleading our users like this is unacceptable.
GitHub Actions run 17991418045 succeeded.
Connected!
GitHub Actions run 17991455768 succeeded.
I embarked on fixing this issue as instructed by GitHub but it did not work. I am afraid we will have to close this with "won't fix"
<img width="521" height="202" alt="Image" src="https://github.com/user-attachments/assets/2c9619ba-170f-497e-90e1-bb8ff5c0e2aa" />
I embarked on fixing this issue as instructed by GitHub but it did not work. I am afraid we will have to close this with "won't fix"
Sorry to hear you're having issues with GitHub Copilot.
Might I suggest you try Claude instead?
[python-discord/forms-backend] Checks Successful on PR: #296 Update dependency sentry-sdk to v2.38.0
GitHub Actions run 18003782159 succeeded.
GitHub Actions run 18013295026 failed.
Any update here? My company is relying on this feature. Please fix ASAP @HassanAbouelela @shtlrs @ChrisLovering @jb3
@jchristgit Then perhaps your company would sponsor the development effort? We estimate it'll take one person 3 sprints. Thanks.
Um... should be an easy enough fix. Can I take it if no else will?
GitHub Actions run 18024526886 succeeded.
GitHub Actions run 18024579334 succeeded.
I did minimal manual testing, checking I could trigger the gate while not fulfilling the requirements, then editing the metricity data to pass the requirements to ensure I didn't get the item in the checks.
@jb3 Should we mark this as closed?
Works for me [here](#bot-commands message)
<img width="696" height="390" alt="Image" src="https://github.com/user-attachments/assets/92d542f2-972e-48f3-ad49-e75dc5a45a34" />
@jb3 Should we mark this as closed?
It's a separate issue no? I split them out intentionally because this behaviour is unrelated to the behaviour you changed in your PR.
Works for me here
It does not always produce this result, we haven't seen this behaviour in a bit I don't think but it's (as specified originally) not something that always manifests.
Is this is the change needed in bot#3390 ?
<img width="699" height="593" alt="Image" src="https://github.com/user-attachments/assets/315f9c2e-4b2b-4794-b23a-3c3a59812f20" />
@MarkKoz unfortunately we are out of our OSS budget of 0โฌ this quarter. As a YC-backed startup, we can'T afford any more. I am happy to see this issue is being worked on. Please also see my comments in these two other issues because we also need the features urgently: jb3/blog#1 jb3/blog#10
@DragonSenseiGuy that looks good, please send it to the Committee for review.
@DragonSenseiGuy that looks good, please send it to the Committee for review.
Yes but do you want exec to be the default and eval and e being the aliases or exec being the alias?
GitHub Actions run 18064399141 succeeded.
@jchristgit I have made a PR #3392 . Hope this effects your YC backed company.
GitHub Actions run 18064483182 succeeded.
Summoning my second reviewer.
f0e4d45 Add !exec alias to clarify command behavior (... - DragonSenseiGuy
Connected!
GitHub Actions run 18064596470 succeeded.
The problem is located in the converters.py, where the search for a sub does return an html (likely 404 page).
I suggest to replace this with a request for
https://oauth.reddit.com/r/{sub}/about.jsonto validate the existence of a sub.Is that a valid approach in your opinion?
That approach sounds good to me!
@jb3 is there anything else needed for this to be merged?
GitHub Actions run 18177666371 succeeded.
(This also applies to WolframAlpha and presumably all other Lancebot functionality. Looks like that's taken care of though in the PR.)
GitHub Actions run 18201996737 succeeded.
GitHub Actions run 18203151919 succeeded.
GitHub Actions run 18206194853 failed.
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
[python-discord/forms-backend] Checks Successful on PR: #296 Update dependency sentry-sdk to v2.39.0
GitHub Actions run 18282124918 succeeded.
Connected!
Happened again yesterday after I attempted to remove the disnake inventory (because it seemed to have moved). After that, all !d invocations led to this issue until the bot was restarted.
[python-discord/bot] New branch created: wookie/lower-warning-to-info
e4b1dc7 Lower level of log about missing channel to info - wookie184
[python-discord/bot] Checks Successful on PR: #3395 Lower level of log about missing channel to info
GitHub Actions run 18324389352 succeeded.
d4347e2 Fix incorrect variable used in mentions logic - wookie184
[python-discord/bot] New branch created: wookie184/fix-mentions-reply-resolving
resolved is always None here, as the logic is for the case when resolved is None. Instead we want to use the channel and message ID from ref directly, which are always defined here.
GitHub Actions run 18324757967 succeeded.
Python has just released a stable version of 3.14(the newest python), more details here
Will I be willing to work on it?
Yes.
Thanks to @wookie184 for mentioning that we should wait for 3.14.1 so they can iron out major bugs
Eval command python versions are maintained in https://GitHub.com/python-discord/snekbox
Reproduction
The stuck typing issue is reproducable by running:
!d setdoc disnake https://docs.disnake.dev/en/latest/objects.inv https://docs.disnake.dev/en/latest/api/!d disnake.Role.color!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...
Python has just released a stable version of 3.14(the newest python), more details here
This is for the !eval command only
Will I be willing to work on it?
Yes.
GitHub Actions run 18330673895 succeeded.
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.
GitHub Actions run 18333913209 failed.
GitHub Actions run 18334396630 succeeded.
GitHub Actions run 18341174528 succeeded.
can i take up this issue?
i would like to take up this issue
GitHub Actions run 18344051341 succeeded.
Doc item doc_item.symbol_id='string-concatenation' present in loaded documentation inventories not found on site, inventories may need to be refreshed.
GitHub Actions run 18351148264 succeeded.
why was this opened in the first place? @LeVraiMatx32
can i take up this issue?
Sure, I have assigned you.
Attachment.content_type can be None, but there are some places where we assume it is a string:
- https://github.com/python-discord/bot/blob/f0e4d45cb30208c35fa55372e15ea524ea573123/bot/exts/filtering/filtering.py#L238
- https://github.com/python-discord/bot/blob/f0e4d45cb30208c35fa55372e15ea524ea573123/bot/exts/utils/attachment_pastebin_uploader.py#L81
- https://github.com/python-discord/bot/blob/f0e4d45cb3...
Automatic attachment uploading currently has some issues in DMs, one is that it uses clear_reactions
https://github.com/python-discord/bot/blob/f0e4d45cb30208c35fa55372e15ea524ea573123/bot/exts/utils/attachment_pastebin_uploader.py#L67
Which raises an error if you attempt to use it in DMs (BOT-3ZK).
IMO it doesn't make much sense in DMs so I think we should just disable it.
Sentry Issue: BOT-428
UnboundLocalError: cannot access local variable 'result' where it is not associated with a value
File "bot/exts/info/code_snippets.py", line 306, in on_message
message_to_send = await self._parse_snippets(message.content)
File "bot/exts/info/code_snippets.py", line 285, in _parse_snippets
if isinstance(result, list):
Unhandled exception in on_message.
If an error is raised, result will not be set so we get this error
https://github.com/python-discord/bot/blob/f0e4d45cb30208c35fa55372e15ea524ea573123/bot/exts/info/code_snippets.py#L274-L289
Sentry Issue: BOT-42G
Configured channels do not exist in server: [('rule_alerts', 1386490058739290182)].
This warning is raised here
https://github.com/python-discord/bot/blob/f0e4d45cb30208c35fa55372e15ea524ea573123/bot/exts/backend/config_verifier.py#L16-L32
Seemingly because it is not actually a channel
https://github.com/python-discord/bot/blob/f0e4d45cb30208c35fa55372e15ea524ea573123/bot/constants.py#L92-L93
This is pretty minor, the easiest solution is probably to add a special case to ignore this constant in the config verifier.
[python-discord/snekbox] New branch created: jb3/3.14-release
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...
Actually, looking at https://github.com/python/cpython/issues/128838 there is a
chance this is coming from the fact we add --with-system-expat.
I'm not 100% sure why we add that flag currently or what changed between the
release candidate and 3.14.0 that would cause this to suddenly cause problems?
It was probably copied from the build arguments in the official Python Docker image.
I think it's okay to remove if it's causing us trouble.
Hi @wookie184, Iโm having trouble setting up the Redis environment to test my changes. I thought this would be a good first issue. Could you help me out with running Redis locally or suggest an easier way to test my modifications?
Can you describe what you did to set it up ? and what do you mean by trouble ? Maybe of you have some logs that would be helpful too.
Also, on which os are you trying to run all this?
The Redis server is now running on macOS. I also modified the information.py file to streamline the role_info function. Additionally, Iโve created a Discord bot connected to a server, but Iโm unsure how to run it. I tried executing it with python -m bot, but encountered the following error:
TypeError: duplicate base class TimeoutError
[python-discord/bot] New branch created: jb3/eval-command-3.14
Updates the eval command to default to executing user code with snekbox's Python 3.14 binary.
See python-discord/snekbox#245 for the related snekbox change to switch from 3.14.0rc1 to 3.14.0.
The notice about 3.14 jobs being pre-release is also removed by this PR.
GitHub Actions run 18377769018 failed.
GitHub Actions run 18378542623 succeeded.
Should we drop 3.13t for 3.14t now too?
Maybe we update this to be the following so we don't need to touch it as we use new free threaded versions
if job.version[-1] == "t":
[python-discord/forms-backend] Checks Successful on PR: #296 Update dependency sentry-sdk to v2.40.0
GitHub Actions run 18382438878 succeeded.
GitHub Actions run 18383078353 failed.
GitHub Actions run 18383098374 succeeded.
GitHub Actions run 18383135819 succeeded.
[python-discord/snekbox] New branch created: jb3/3.14t-and-deps
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
i hate emacs
bdfc43f Update eval packages and remove unnecessary ver... - jb3
b03d964 Update numpy version used for integration tests... - jb3
861a825 TEMP: Set multiprocessing start method to fork ... - jb3
c8c5550 Temporarily reduce PID limits for test_forkbomb... - jb3
This should be in a finally block in case an assertion fails so other tests aren't impacted.
Never mind I read the commit message
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
GitHub Actions run 18414968440 succeeded.
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
[python-discord/snekbox] branch deleted: jb3/3.14t-and-deps
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
[python-discord/bot] branch deleted: jb3/eval-command-3.14
Connected!
GitHub Actions run 18421272016 succeeded.
[python-discord/snekbox] New branch created: jb3/3.14-jit
Adds new build support for adding the --enable-experimental-jit flag when a version is passed with a j suffix (e.g. 3.14.0j).`
04cdb59 Add integration test for validating JIT builds ... - jb3
Is this not being worked on? I am willing to take it up.
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_...
btw I would be willing to take this up.
Can still repro. #bot-commands message
It's not a solved issue and I don't think there are any PRs open to solve it yet, it's not a transient bug, it's a permanent bug with how the feature is implemented.
@Anuradha-Agrawal-07 thank you! I've assigned you to the issue, let me know if you need something.
@wilson @nedbat @godlygeek , i would like to join the organisation , could you please help me out to join ?
@Adez017 Please don't use our issues system to make these kind of requests, that's not the purpose.
Joining the organization isn't on a request basis, but on a merit one.
You need to join our discord community and be an active member there, and you might get selected.
I'd be willing to solve this with yarl parsing.
GitHub Actions run 18457346829 succeeded.
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...
saw the automerge too late lol
Connected!
GitHub Actions run 18466344986 succeeded.
Add URL normalization checks using yarl in code snippets.
closes #3315
Thanks to @decorator-factory for the idea.
[python-discord/bot] New branch created: jb3/eval-3.14j
Add support for the JIT-compiled version of Python 3.14 via eval commands (and
other commands such as !timeit).
Depends on merging of python-discord/snekbox#247.
GitHub Actions run 18480957216 failed.
GitHub Actions run 18480974982 succeeded.
Connected!
GitHub Actions run 18484635590 succeeded.
Adding slash command functionality to some commands.
Note:
Each command will have it's own separate PR as @jb3 has pointed out.
You can comment suggestions for commands to add slash command support to!
I don't think any helper or moderator commands will be moved.
btw all commands that get slash will also have ! variant.
I think making the !help command into slash will be best? As new users are more likely to use that.
[python-discord/forms-backend] Checks Successful on PR: #296 Update dependency sentry-sdk to v2.41.0
GitHub Actions run 18523811041 succeeded.
GitHub Actions run 18558274081 succeeded.
GitHub Actions run 18575999724 failed.
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?
9f0162c Update in_whitelist_check to check against the ... - ChrisLovering
[python-discord/bot-core] branch deleted: Check-parent-channel-in-whitelist-check
[python-discord/bot-core] New tag created: v11.8.0
cf16350 Deploying to docs from @ python-discord/bot-cor... - jb3
7fa6e0c Dependency bumps (including pydis_core to 11.8.0) - jb3
GitHub Actions run 18601097232 succeeded.
Connected!
Connected!
GitHub Actions run 18601064456 succeeded.
GitHub Actions run 18601103332 succeeded.
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...
Upstream PR is merged and pydis_core updated on this repo, should be resolved.
Connected!
GitHub Actions run 18601663632 succeeded.
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...
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 ...
This seems overcomplicated. My mental construction of how this looks is a lot simpler.
- Store binaries such as
python-3.14j,python-3.14in/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...
That makes sense. I do like the idea of python being specially handled, but its not a requirement.
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.
[python-discord/snekbox] New branch created: jb3/pydis-version-separation
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 ...
GitHub Actions run 18618326882 succeeded.
344af49 Amend paths from pre-built images - jb3
b241b85 Handle memory OOMs instead of process kills - jb3
bae37a8 Use local registry for final deploy stage - jb3
[python-discord/forms-backend] Checks Successful on PR: #296 Update dependency sentry-sdk to v2.42.0
GitHub Actions run 18657077149 succeeded.
GitHub Actions run 18660877544 succeeded.
GitHub Actions run 18692130806 succeeded.
GitHub Actions run 18692324631 succeeded.
Connected!
GitHub Actions run 18692347186 succeeded.
Looks good, should we add & pin yarl as we are now explicitly using it? (I know it's present as a dependency of aiohttp but we should probably pin it ourselves).
Connected!
GitHub Actions run 18693386293 was cancelled.
GitHub Actions run 18693437009 was cancelled.
Connected!
GitHub Actions run 18693455374 succeeded.
GitHub Actions run 18694275968 succeeded.
GitHub Actions run 18694509319 was cancelled.
GitHub Actions run 18694513961 succeeded.
GitHub Actions run 18694548261 succeeded.
"activity_blocks": "not been active enough on the server yet",
"have" is already included here
We also want to offer to upload files like text/csv or application/json, I think having a charset is enough to offer to upload it.
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 ...
Let me check that before you merge
Planned to merge these with a larger update to the contributing documentation, but wanted to get these out of the way so they don't get held up by my time constraints.
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...
GitHub Actions run 18695477962 succeeded.
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
Never mind I just misread the code, I see no issues with this
IIRC uv installs the Python version you need for you so this step probably isn't necessary any more I guess?
Connected!
GitHub Actions run 18695908400 succeeded.
Connected!
GitHub Actions run 18696233714 succeeded.
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)
[python-discord/bot] Pull request opened: #3416 chore: add pre-commit hook for checking uv is locked
Oops.
If this PR looks good I can go ahead and make a similar pr to site and sir-lancebot.
GitHub Actions run 18696454713 succeeded.
GitHub Actions run 18696495081 succeeded.
Hmmm, should I check that the charset actually equals utf-8?
Nevermind, didn't notice that was already checked in https://github.com/onerandomusername/pydis-bot/blob/main/bot/exts/utils/attachment_pastebin_uploader.py#L40-L41
GitHub Actions run 18696595922 succeeded.
GitHub Actions run 18696527086 succeeded.
Connected!
GitHub Actions run 18696814775 succeeded.
It may be useful to keep somewhat documented, as uv installed from a distro-packaged uv may result in a uv with automatic downloads to be disabled without the user knowing.
Reference: https://github.com/astral-sh/uv/issues/15625
https://src.fedoraproject.org/rpms/uv/blob/rawhide/f/uv.toml
This also matches the existing contributing guides for sir-lancebot and site which don't mention that uv can install python. That feels out of scope for this pull.
I'd keep it but probably remove the note about it being system Python. UV is good at discovering it even if it's non-system (for example on macOS I use Homebrew versions of Python, but UV figures that out).
GitHub Actions run 18697063518 succeeded.
Connected!
GitHub Actions run 18697314285 succeeded.
GitHub Actions run 18697512760 succeeded.
GitHub Actions run 18697625958 succeeded.
GitHub Actions run 18697648525 succeeded.
GitHub Actions run 18697722141 succeeded.
GitHub Actions run 18697724195 was cancelled.
GitHub Actions run 18697741852 succeeded.
GitHub Actions run 18697745042 succeeded.
If we somehow map rule-alerts to be a thread attached to channel mod-alerts, this could be both checked, validated its in the right channel, and used in botstrap.
I'm thinking that mirroring the existing Webhook/Webhooks configuration makes sense for this.
(Still in progress.)
closes #3414
GitHub Actions run 18700621242 succeeded.
GitHub Actions run 18700656459 succeeded.
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...
GitHub Actions run 18700895347 succeeded.
GitHub Actions run 18700973520 succeeded.
GitHub Actions run 18701033388 succeeded.
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....
GitHub Actions run 18702786475 succeeded.
GitHub Actions run 18703630162 succeeded.
GitHub Actions run 18705474331 succeeded.
GitHub Actions run 18705828540 succeeded.
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 ...
What about putting api_client on a mixin? I don't quite know if that's possible but it would allow the consumers to have a properly typed api_client (not None if it exists, and won't exist instead of being None)
.
it should also be added that sir-robin doesn't even have this command at the moment, and this would give it that ability.
there are multiple differing implementations of the source command.
I propose that these commands would benefit from a shared location for the source code. If the source code is private (such as with black knight) this should be able to be optionally enabled.
We could add a basic configuration which checks the channel's last_message_id and if and only if its the same one we could edit the old output. That would give a basic implementation before adding support for potentially editing if its within the last few messages on the channel.
Do we even need dm_message intents at all? Is there anything in dms that actually needs to work? To my knowledge all commands are disabled in DMs as it is, we could not listen to any of those events.
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.
related to #3422
(basedmypy is no longer maintained btw)
(
basedmypyis no longer maintained btw)
(Tch, that's so unbased.)
GitHub Actions run 18768317688 failed.
GitHub Actions run 18771864284 succeeded.
I've sent more info on #dev-contrib, stdlib.h is my handle (seriously).
Explained in #dev-contrib, this is expected behaviour.
We notify the channel when a user leaves but do not close it (still closes after regular inactivity window). This is to ensure we don't disrupt other users who may now be discussing a topic in the channel.
Converted to draft for now as I forgot to add checking for the other use mentioned in the attached issue: https://github.com/python-discord/bot/blob/f0e4d45cb30208c35fa55372e15ea524ea573123/bot/exts/filtering/filtering.py#L238
What's the purpose of hosting a registry in our job?
What does the help output look like now?
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.
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.
GitHub Actions run 18801029539 succeeded.
Connected!
GitHub Actions run 18801038167 succeeded.
289cb28 fix: update required python version of bot - onerandomusername
4c420a7 fix dead link to statisic infrastructure page - onerandomusername
1c1c926 use a descriptive link name for bot contributin... - onerandomusername
80ee7f3 add snippet about installing python with uv - onerandomusername
5f4cf8f Merge pull request #1566 from onerandomusername... - jchristgit
Connected!
GitHub Actions run 18801396731 succeeded.
GitHub Actions run 18801385611 succeeded.
GitHub Actions run 18801377379 succeeded.
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...
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...
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.
I'm not sure the ...
Global leaderboard no longer exists, so this thread can be created at exactly 0500 and opened to conversation.
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+.
Discord has split these features and users can now be given pin message permissions in their channel without being given delete message permissions ๐
If this change is still desired, I'm interested in implementing this!
I am interested in implementing this, once a new decision regarding implementation around a lack of a global leaderboard is decided
GitHub Actions run 18807172174 succeeded.
Few review comments.
Can we also squash down the history a little bit? I don't think we need 21 commits for the changes here. Obviously keep the constants one separate but I think we can squash down a lot of the other ones.
# Filter out the send typing monkeypatch logs from bot core when we import to get constants
current_flags = self.app_info.get("flags", 0)
Bit of spacing
new_flags = current_flags | 1 << 15 | 1 << 19
Redundant to use f-string when this is always going to be alongside the channel name when shown in Discord.
headers={"X-Audit-Log-Reason": "Creating forum channel as part of PyDis botstrap"},
log.fatal(f"Couldn't find key: {item} in dict: {self.name}")
GitHub Actions run 18807903347 succeeded.
I was working on reworking this segment to instead clone all of the configured emojis. No longer only making a best-effort approach, it is now full effort.
Honestly, meant to make it a non-meme exit code. I didn't realise the bot's exit code is actually following a standard. This should either be 69 or 77 from what I can tell.
GitHub Actions run 18808220786 succeeded.
To be fair, given the template now has the forum channel in it, this could be removed entirely. In my testing the code that upgrades python-help doesn't run when a guild is created from the template.
GitHub Actions run 18808388593 succeeded.
GitHub Actions run 18808657133 succeeded.
GitHub Actions run 18808695730 succeeded.
GitHub Actions run 18808777873 succeeded.
@jb3 I've compressed the history and addressed your comments in the updated history. Comments should now follow pep8, formatted with ruff, and silenced pyright.
Why is is the default shown twice now?
They're now options rather than positional arguments. That's confusing.
I forgot that steps within the same job don't share the cache. But I thought that's what the existing cache-to/from already solve.
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...
fixed the attribute error in filtering and marked as ready for review again
GitHub Actions run 18813015699 succeeded.
Thanks for addressing review feedback.
Only a couple of points left now, but also a couple of wider points:
- I think the
withblock 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 ...
for channel in self.guild_channels:
I'd use path-params to document this and where that snowflake comes from (even though it's obvious). Also, not sure the size is necessary given we don't then use it for the subsequent request.
# Emojis are located at https://cdn.discordapp.com/emojis/{emoji_id}.png
Maybe we can also check the status here? Avoids us having problems from a transient Discord error that we should surface in a different way.
Sorry for these comments all being in parts, just keep doing scans and picking up new bits.
Can we also standardise on whether you're using f-strings in this file or using %s interpolation? There is a mix currently (I appreciate it was f-strings before which is not correct, but if you're adding some f-strings and some %s strings we may as well unify).
Missing a newline after this & the id argument is shadowing id().
We don't check these errors as it is, we just fail hard on them. Good point regarding our raise_for_status hook. We should maybe try again if it's 5xx and fail on 4xx.
GitHub Actions run 18826783385 succeeded.
GitHub Actions run 18830793843 succeeded.
GitHub Actions run 18839046631 succeeded.
Yeah it could go in the hook, I just think specifically with this case you're silencing server errors. The current behaviour elsewhere being failing hard is fine but this is not failing hard, this is all 4XX and 5XX being treated the same and silenced.
GitHub Actions run 18841989524 succeeded.
GitHub Actions run 18844847429 succeeded.
GitHub Actions run 18850221681 succeeded.
GitHub Actions run 18853701702 succeeded.
GitHub Actions run 18854414699 succeeded.
headers={"X-Audit-Log-Reason": "Creating emoji as part of PyDis botstrap"},
Cleaner when not done inline:
image_data = base64.b64encode(emoji_data).decode('utf-8')
payload = {
"name": new_name,
"image": f"data:image/png;base64,{image_data}",
}
I'm not sure if this is the way this should be done or whether it'd be cleaner to create a DiscordClient here, pass it into the botstrap initialiser and then avoid having to define the __exit__ method for the BotStrapper class.
e.g.
with DiscordClient(guild_id=GUILD_ID) as discord_client:
botstrap = BotStrapper(client=discord_client)
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...
This should define the dict with all keys instead of adding individually:
e.g.
config = {
"categories": self.get_categories(),
...
}
I would prefer to manage the DiscordClient internally on the botstrap class, even if we use contextlib to manage the context manager.
DiscordClient should not be used by anything other than the BotStrap class, and an instance of it outside of botstrap doesn't need to exist.
GitHub Actions run 18890626266 succeeded.
GitHub Actions run 18893459147 succeeded.
[python-discord/sir-lancebot] New branch created: Matiiss-patch-1
dddf49f Fix regex for 'spooky' trigger pattern - Matiiss
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...
GitHub Actions run 18894117431 succeeded.
cb14fcf Fix regex for 'spooky' trigger pattern (#1705) - Matiiss
[python-discord/sir-lancebot] branch deleted: Matiiss-patch-1
Connected!
GitHub Actions run 18894157089 succeeded.
No need to return a value here if you never consume it.
Should this be here? Feels like a weird operation to have in the method to get channels.
log = logging.getLogger("botstrap") # Note this instance will not have the .trace level
# Format the dictionary into .env style
# In order to support commented sections, we write the following
nitpick: dict[str, object] (avoid Any unless really necessary)
@property should never be doing an HTTP request IMO. Maybe change these to methods?
fullmatch, not match, I think? unless only the prefix must match
Maybe a good case for a switch to a method with https://docs.python.org/3/library/functools.html#functools.cache
GitHub Actions run 18895416567 succeeded.
GitHub Actions run 18898507907 succeeded.
I sort of cleaned up this code but I'm not sure about the separate method with just how many specific inputs are required.
[python-discord/forms-backend] Checks Successful on PR: #296 Update dependency sentry-sdk to v2.42.1
GitHub Actions run 18906750554 succeeded.
This fixes issue #3411
[!Note]
This is still Work in Progress and not ready for review
GitHub Actions run 18938898031 failed.
If this gets approved I can work on it if @onerandomusername is not interested.
I can also take this if @onerandomusername is not interested.
Added the code that consumes it.
Closing for now following discussion in Discord that this is not the correct solution. Please feel free to re-open/open a new PR when attempting a more complete and functional solution.
Connected!
GitHub Actions run 18953288040 succeeded.
GitHub Actions run 18953383753 failed.
Connected!
GitHub Actions run 18953453059 succeeded.
GitHub Actions run 18953719476 succeeded.
Connected!
GitHub Actions run 18953685407 succeeded.
[python-discord/bot] New branch created: dependabot/pip/pip-5e502e9552
166719b Bump deepdiff from 8.5.0 to 8.6.1 in the pip gr... - dependabot[bot]
GitHub Actions run 18953770426 failed.
Connected!
GitHub Actions run 18953802983 succeeded.
Connected!
GitHub Actions run 18953912537 succeeded.
GitHub Actions run 18954707629 succeeded.
GitHub Actions run 18955057267 succeeded.
- Updates to Python 3.14 in pyproject & Docker
- Upgrades uv to 0.9
- Upgrades all dependencies to latest available version
- Implements fixes for 3.13 -> 3.14 changes
- Implements linting fixes for newer versions of Ruff & Python
GitHub Actions run 18955562999 failed.
All imports from future involving annotations should be cut entirely.
These are no longer required. Possibly added to the banned imports for ruff flake8-banned-api configuration as well.
GitHub Actions run 18956077072 failed.
GitHub Actions run 18956358317 succeeded.
GitHub Actions run 18956673318 failed.
GitHub Actions run 18957093453 succeeded.
GitHub Actions run 18957591203 succeeded.
GitHub Actions run 18959610746 failed.
checked the code, there is no goofy image in the images folder
Please do not make Issues like this @Zoulife-maker It is not even an issue.
Do we want to use https://docs.astral.sh/uv/reference/settings/#required-version for enforcing a minimum version of uv that supports python 3.14?
I also see that CI is not pinning the version of uv to 0.9, so there's a chance that CI as it is can break with a breaking change in eg uv 0.10.0.
This has typing changes, and an API shift. Check usage of shift() and whether check_imaginary=False is worth providing due to the runtime changes.
should note this hasn't had a release in 4+ years. Might be time to move to a different library. (Yes, it works, but its slowly becoming unmaintained)
checked the code, there is no goofy image in the images folder
because it is from a url
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...
GitHub Actions run 19001802109 succeeded.
GitHub Actions run 19001815929 succeeded.
Closes #3422
Changes the response the bot gives to delete a paste in DM's when a user uploads a file.
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.
Not all attachments form media galleries.
We could filter and run introspection on the types of attachments and allow 10 in specific cases.
Six file embeds is still longer than a gallery of ten images. Which would still be allowed.
<img width="489" height="1384" alt="Image" src="https://github.com/user-attachments/assets/559e2a37-81ee-44c9-88df-0a31727b648d" />
Specifically, how I should have made this issue:
when all attachments are media image files, they should be allowed to be viewed
GitHub Actions run 19002644431 succeeded.
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...
GitHub Actions run 19003611129 succeeded.
Formatting & content changes.
await message.author.send(
f"[Click here](<{paste_response.removal}>) to delete the pasted attachment"
f" contents copied from [your message](<{message.jump_url}>)"
)
GitHub Actions run 19003747835 succeeded.
Indented way too much.
await message.author.send(
f"[Click here](<{paste_response.removal}>) to delete the pasted attachment"
f" contents copied from [your message](<{message.jump_url}>)"
)
GitHub Actions run 19003783310 succeeded.
The user has already reacted to say they want it uploaded, having the deletion link is a nicety but isn't required, DevOps can still delete pastes or they expire after a period, it's not the end of the world.
Instead of specifically importing Forbidden, use discord.Forbidden here.
@copilot Please address review feedback.
GitHub Actions run 19006466586 succeeded.
Connected!
GitHub Actions run 19006475210 succeeded.
[python-discord/bot] branch deleted: copilot/fix-timeit-eval-issue
Any not necessary for these. +1
Shouldn't fetch webp if you then submit image/png, even if Discord is accepting it this doesn't seem right.
Space.
with botstrap:
changes_made = botstrap.run()
if changes_made:
log.info("Botstrap completed successfully. Updated configuration has been written to %s", ENV_FILE)
else:
log.info("Botstrap completed successfully. No changes were necessary.")
Why exit with an error if we make changes? Makes sense for a linter, not for this.
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...
Relevant Issues
Closes #1706
Description
- Make
bot/utils/quote.pyfor API requests using aiohttp. - Add
.quoteand.daily_quotecommands inbot/exts/fun/fun.pywith aliases such as.rquotefor random quote and.dquotefor 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 ...
GitHub Actions run 19027608560 succeeded.
Was this issue approved? Or discussed anywhere? As per the contributing guide, Core Developers are supposed to add the approved label to issues before PRs are welcomed.
I'll have a look at the PR but please bear this in mind for future.
Connected!
GitHub Actions run 19052966501 succeeded.
Connected!
No the issue was not approved that is why the PR is still a draft and not ready for review yet. Thank you for still considering having a look at the PR and I will keep this in mind for future.
GitHub Actions run 19082893784 succeeded.
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...
Little overkill on the aliases
@commands.command(name="quote", aliases=("randomquote",))
This is not how exception handling works. Raise an exception and catch it, do not do it based on the return value.
Same as above, this is not how exceptions work.
Once using the bot HTTP session, this dependency does not need to be pinned anymore.
๐ง 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...
Bot always runs in a timezone where there are no imaginary times, so not sure we need to change anything here.
GitHub Actions run 19087528500 succeeded.
GitHub Actions run 19088079954 succeeded.
GitHub Actions run 19089289871 succeeded.
Thanks for the detailed review, I'll work on implementing these changes and push as soon as possible/
GitHub Actions run 19096330133 failed.
GitHub Actions run 19096430462 succeeded.
GitHub Actions run 19096679571 succeeded.
GitHub Actions run 19098165074 succeeded.
What is the motivation behind this in ci only?
Where else would it be? It's a parameter for the action, not for uv itself (despite uv having a identically named parameter).
We want to:
- Always use the lowest confirmed working version of
uvin CI (for us it'll use0.9.7since our specifier is>=0.9.7) - Simultaneously, we don't want to annoy people developing locally with newer versions of uv by addi...
Ah, thanks! Its a slightly confusingly named parameter.
GitHub Actions run 19115469739 succeeded.
GitHub Actions run 19115752853 succeeded.
GitHub Actions run 19125304622 succeeded.
GitHub Actions run 19125331798 succeeded.
Awesome! Thanks for making those changes, looks much cleaner than the original implementation. Also, nice work integrating Redis for the caching.
Few more feedback points below:
Don't really need this, it's just noise.
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.
Same feedback about embed formatting (and no need for author).
await ctx.send(":x: Something unexpected happened. Try again later.")
Same feedback about exception formatting.
Connected!
GitHub Actions run 19149202015 succeeded.
Closing for now as this appears to have gone stale โ feel free to reopen/comment if this is something you would like to continue working on.
You may need to pull in some updates from the main branch, if you no longer have time that's also completely okay!
If you need any help or guidance feel free to drop a message in the #dev-contrib channel.
GitHub Actions run 19153397375 failed.
Relevant Issues
Discussion: #python-discussion message
Description
Added http as additional alias for http_status.
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 to the [contributing guidelines](https://pythondiscord.com/pages...
GitHub Actions run 19155707192 succeeded.
Arguably can we change the name to http, with http_status as an alias? It would look nicer in the help command.
GitHub Actions run 19156147011 succeeded.
GitHub Actions run 19159563927 succeeded.
The uv.lock changes can be reverted now as well since aiohttp is unpinned.
I think the author needs escaping here otherwise it'll create a bullet point (note the \ in my suggestion). Same in the other function.
quote = f"{data[0]['q']}\n\โ {data[0]['a']}"
GitHub Actions run 19165507971 failed.
It actually will not create a bullet point becuase โ is used and not -. I did this anyways though.
GitHub Actions run 19165545882 succeeded.
Connected!
GitHub Actions run 19174987388 succeeded.
Why no lock dependabot ๐
Why no lock dependabot ๐
I believe it's because the ecosystem set is pip and not uv.
Why no lock dependabot ๐
I believe it's because the ecosystem set is pip and not uv.
No, it's set to uv, it just needs the beta ecosystem disabling/removing.
There was a conversation in #dev-contrib where we discovered that locking will only happen when you use the mainline dependabot environment (in which the uv support is more featureful than the beta).
Ah, I noticed pip in the branch whereas uv uses uv in the branch.
GitHub Actions run 19176827615 succeeded.
Threw a fix into https://github.com/python-discord/site/pull/1567 (copied directly from bot)
Ah! If you've used symbols you don't need the escape. The \ that you've added will now create a literal .
You can remove the \ entirely now, there is nothing to escape.
GitHub Actions run 19190538595 succeeded.
It was not creating a literal actually but I tested after removing it as well and it did not seem to have made a difference so I have removed it.
GitHub Actions run 19190568852 succeeded.
The global leaderboard is no more! So we should change our global leaderboard command.
The change should cover the following things:
- Command itself should not be removed
- Embed should state that global leaderboard is no longer, link to reddit announcement from Wastl
- Link or provide instructions for how to view ...
We still have our completionist role, but it probably shouldn't check for the full 50 stars anymore.
How many stars should we check for? Let's go with 12 for now.
I've asked the AoC organizers for confirmation on this, but haven't heard back yet. When I do I'll post here and inform the person implementing this change as well.
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.
This issue is now superseded by a milestone that more breaks down the necessary tasks with more granularity.
@janine9vn just wanted to ask, what's the reasoning behind making only the link/unlink commands fully slash commands, and making the other hybrids?
I don't want to clutter channels with the link/unlink messages. It would make it more in-line with the join behavior which is preferable in my eyes.
if a user is linked and provided, we add an additional line to
allow viewing the top 10 PLUS the user
if the user is in the top ten, we don't want this additional line
closes #107
GitHub Actions run 19199549639 failed.
GitHub Actions run 19199578104 succeeded.
GitHub Actions run 19199586285 succeeded.
Noticed this while working on aoc changes. Doesn't change much but if there were a workaround this would make sure a user couldn't mention everyone or large scale roles if they tried.
GitHub Actions run 19200251768 succeeded.
GitHub Actions run 19200352636 succeeded.
GitHub Actions run 19201621432 succeeded.
In accordance with https://github.com/python-discord/sir-robin/issues/65 this may be more relevant this year.
Working on this. aoc day_star doesn't seem to support looking at previous years.
Assuming 24 stars and the number of stars hasn't changed on account of the wording on the private leaderboard page; its already been updated to be different from 2024, and the api handling is similar as well.
<img width="1195" height="300" alt="Image" src="https://github.com/user-attachments/assets/67263502-260c-4b09-aff2-4c7d9b9ca17f" />
closes #159
closes #160 (aoc daystar currently doesn't take a year as an option)
closes #158
GitHub Actions run 19203251892 succeeded.
closes #157
Screenshots of updated embeds:
about
global leaderboard
New changes subcommand:
Input and wording suggestions are greatly appreciated.
GitHub Actions run 19203924492 was cancelled.
GitHub Actions run 19203927926 succeeded.
GitHub Actions run 19204255996 succeeded.
Connected!
GitHub Actions run 19209682463 succeeded.
GitHub Actions run 19209736783 succeeded.
Connected!
GitHub Actions run 19209802545 succeeded.
Connected!
GitHub Actions run 19209809144 succeeded.
Connected!
GitHub Actions run 19209836608 succeeded.
GitHub Actions run 19209981529 succeeded.
GitHub Actions run 19209968832 succeeded.