Should we unify the top key for stats? Some are under help_forum and some under help.
#dev-log
1 messages ยท Page 5 of 1
Not majorily important, but this whole function can basically be reduced to return getattr(channel, "parent_id", None) == constants.Channels.help_system_forum
The only reason I kept this one the same is to keep the previous stats together with the new stats
Fair enough, that works for me.
GitHub Actions run 3455860518 succeeded.
Connected!
[python-discord/bot] Checks Successful on PR: #2318 Update help channel system to use forum channels
GitHub Actions run 3455864416 succeeded.
One thing I wanted to be sure to resolve is whether or not the yellow downloads button on https://www.python.org/downloads/ really does download the best version the suits the computer, since I said it did in the "Recommended Installed" tutorial:
Go to python.org/downloads and click the big yellow "Download Python 3.x.x" button near the top of the page. That should start the download of the latest Windows Python installer that best suits yo...
I don't think we should link to the workaround, as I don't think there's a case where that should be used and it will likely cause other problems.
We could mention that if a package from pypi has a hyphen in the name the actual import is probably different, and if they're trying to import a local file they should rename it.
[python-discord/bot] Checks Successful on PR: #2318 Update help channel system to use forum channels
GitHub Actions run 3455895407 succeeded.
I had just updated my config chris!
Beautiful work.
Unfortunately, I didn't test this since I don't have access to the forum feature.
Thanks Chris !
Description
Install multiple python versions within the container, and add an option in the API to select between them.
Rationale
Currently, the bot supports evaluation of both 3.10 and 3.11 code, something I think should be kept and expanded in the future (to include major/important python versions). This is achieved by using the latest 3.10 image published here. This is fine for now, but it makes it harder to provide feature parity and avoid issues when users switch between m...
Sentry Issue: SIR-LANCEBOT-90
We should better handle the case when the API itself is having internal issues (class 5xx of responses), and return an appropriate response to the user telling them to try again later. Here is the error handling for this function, it simply needs to catch and handle the 5xx type exceptions:
https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/fun/latex.p...
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #1142
Description
This change adjusts the regex pattern used in detecting spooky to include fun variants such as spoopy and spookier. The k is replaceable with a p, the y can be interchanged with i allowing ier and iest endings. (yer and yest are also valid). The number of os remains at two (2) or more.
Did you:
- [x] Join...
[python-discord/sir-lancebot] Checks Successful on PR: #1147 Enhance spooky react to be more spoopy.
GitHub Actions run 3456366485 succeeded.
A couple of points to discuss when I publish this PR:
- Upon creating an issue and when a member is not found, should we delete the nomination ?
- Should we update our contribution guide to detail the new config that needs to be added in case someone wants to use/test the feature?
Yeah (at least on Win 10) when you have the App Installer ones on but no MS store Python installed a python.exe and python3.exe still show up in C:\Users\user\AppData\Local\Microsoft\WindowsApps.
GitHub Actions run 3456400526 succeeded.
Alright, I can remove the workaround. I agree it's bad to send people towards unrecommended problem fixes.
Thanks for finding that OS check code. Weird they don't check for 32-bit since it is possible. But oh well, I mention to go the the releases page on 32-bit.
GitHub Actions run 3456473128 succeeded.
Connected!
GitHub Actions run 3456650347 succeeded.
Consider changing CODEOWNERS
I'm not convinced we should keep 3.10 as an option, if 3.11 is stable and has wheels for all of the libraries we use. I'm ok with removing the button without removing the code for switching between versions.
I'm not sure this is the intended behavior of the test. If the default version is now 3.11 then it makes more sense to change the tests to use 3.11.
[python-discord/bot] Checks Successful on PR: #2318 Update help channel system to use forum channels
GitHub Actions run 3461504177 succeeded.
3.11 was already deployed (and we donโt need wheels since we have gcc in the snekbox image)
[python-discord/bot] Checks Successful on PR: #2318 Update help channel system to use forum channels
GitHub Actions run 3463231148 succeeded.
[python-discord/bot-core] branch deleted: d\.py\-2\.1
918f913 Handle not being able to delete the interaction... - ChrisLovering
[python-discord/bot-core] New branch created: handle\-thread\-close\-on\-interactin
[bot-core] Branch handle\-thread\-close\-on\-interactin was force-pushed to `7362f80`
[bot-core] Branch handle\-thread\-close\-on\-interactin was force-pushed to `c5fb2bf`
These exceptions seem a little too overreaching to be handled by just a debug log. Wouldn't you get HTTPExceptions and NotFound in many other cases, including misconfigurations? We should at least promote to an info/warning logs so we have something to refer to if we need to debug.
[bot-core] Branch handle\-thread\-close\-on\-interactin was force-pushed to `7e17123`
[bot-core] Branch handle\-thread\-close\-on\-interactin was force-pushed to `fe29777`
[python-discord/bot-core] branch deleted: handle\-thread\-close\-on\-interactin
[python-discord/bot-core] New tag created: v9\.1\.1
I stumbled across this as I was looking for test suites. Just an idea... Would it make sense to extract those Mocks into a lib?
Yeah a discord.py mock library is a nice idea, but it's not something we're likely to pursue at the moment. Our approach to the mocks (and tests in general) is "good enough", but maintaining a high-quality library would require significantly more work, especially if we try to cover all of discord.py instead of just the parts we need.
Side note: I didn't realise we have two tags for virtual environments, maybe we should combine them into one (not in this PR)
I think that's what Tizzy meant by opening #1835
GitHub Actions run 3465174966 succeeded.
GitHub Actions run 3466108815 succeeded.
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #1145
Description
After a user invokes the ".topic" command and reacts with the reroll emoji, the embed will now show the previous few conversation prompts. It cannot display more than 256 characters because of the limit on embed title character length, which is usually around 5 prompts.
Did you:
- [x] Join the [Python Discord Community](https://disc...
GitHub Actions run 3467380265 succeeded.
I'll keep this open, but be sure next time to get your issue approved by a core dev before continuing with a PR.
GitHub Actions run 3467609527 failed.
[python-discord/bot] Checks Successful on PR: #2318 Update help channel system to use forum channels
GitHub Actions run 3469572532 succeeded.
Looks good ! Just a couple of tiny comments.
async def mass_ban(ctx: CustomContext, members: commands.Greedy[discord.Member]):
Nit: customizability *
I agree with Ronin here, if you want your method to be "protected" or "private" then I'd suggest to prefix it with either a "_" or a "__"
Example:
def _protected_method(...) OR def __private_method(...)
And I don't see the use of Greedy if you have no other parameters after it, so I think a list of discord.Member will work as much
[python-discord/site] New comment on pull request #773: Add guide for working with Python on Windows
I think #794 now has all the content of your PR combined there, isn't it ? Should we just keep one PR then ?
Closes #114, #103
Implementation of a Memory-based file system and sending binary files from snekbox to requester.
Sending of files to snekbox from API is not within scope.
Current plan
File system
- [x] 1. Implement a unique tempdir generator backed by
dev/shm - [ ] 2. Change runtime config to mount an unique tempdir to each snekbox execution
- [ ] 3. Make this the working directory for the python file
- [ ] 4. Use a written python file for better compatibility ...
Yes, true. That would require a lot more of work.
Covering everything would be nice, yes.. but starting off small and, if someone needs a mock, adding it step by step would also work.
I myself just started to dig into testing, so I can't really help in that way :/
Connected!
[python-discord/bot] New branch created: swfarnsworth\-tags
Made the tag more brief without any substantial changes to its overall approach.
GitHub Actions run 3474375755 succeeded.
[python-discord/site] New comment on pull request #773: Add guide for working with Python on Windows
I think #794 now has all the content of your PR combined there, isn't it ? Should we just keep one PR then ?
I'm for that. I think #794 is ready to be merged into here (or however that works exactly) if wookie signs off on it.
The "TODO: Add more screenshots" is done, and #794 has articles that could be linked from most of the proposed !install, !windows-path, etc. tags (to supplement, not replace the tags).
I think the official documentation link should be kept
Personally, I think this change makes it harder to understand what exactly a return statement is. My opinion is to revert this change
โข When you want to print a value from a function, it's best to return the value and print the *function call* instead, for example, `print(square(5))`.
GitHub Actions run 3475242884 succeeded.
The target audience for this tag are those who are so unfamiliar with programming that they do not know what a return statement is or does, and who may not be proficient in English. The expected use case is to resolve confusion when beginners print the result of the function's computation instead of returning it.
While there might be beginners who expect variables defined in the function to be written to the global scope (especially if there is already a variable with the same name), I thi...
I do not think anyone will actually click that link, and I do not think the target audience would find it helpful if they did. The official docs contains formal statements about the semantics of return wrt exception handling and generators, which I think would confuse the target audience, if anything.
I am indifferent to this change, but I would prefer "instead; for example," instead of "instead, for example".
[python-discord/bot] New branch created: snekbox\-files
09a5d57 Add support for displaying files from snekbox - ionite34
Related to https://github.com/python-discord/snekbox/pull/159 for https://github.com/python-discord/snekbox/issues/114 and https://github.com/python-discord/snekbox/issues/103
Requires snekbox's PR to be merged first as this depends on the new API response fields.
GitHub Actions run 3483648926 failed.
Reliant on #19 being merged first.
I'd like to make the leaderboard invite code a slash command or semi-permanent button with an ephemeral message. This will allow people to keep their DMs closed and overall make the process smoother.
#19 needs to be merged first.
I'd like to use a Forum Channel for per-day spoiler-friendly discussions. It's a better user experience than alternatives.
The Basics
Ideally, what I would like is:
- Per-day thread is created at midnight or shortly before, locked to everyone (except Events Lead (& Admins))
- Bot posts a link to the current puzzle, possible pulling a short description as the first message/an embed (see Revival of Code for inspiration)
- There should be a command to u...
Could you share a screenshot of what this looks like after being used a few times?
I think we will also need to add a limit to the number of previous topics that get shown, if there isn't already present. Users could easily spam the button and cause a very large embed from the bot otherwise.
3.11 was already deployed (and we donโt need wheels since we have gcc in the snekbox image)
yeah the bottom line is that if we can have all of the usual libraries available then I don't think we need to have 3.10 as an option. We had two versions only because we wanted to promote 3.11 before its release.
Discord sets the limit on the number of characters in the title of an embed to be 256. From my testing, that seems to mean there's around 4 or 5 topics that can be on display at once. Personally I think 4 or 5 is enough for people to have something to talk about, so it seems good to me.
Here's some screenshots of my bot running the code

Will merge into my branch now since we'll need 2 approvals on my PR before merging to main anyway, thanks again!
efa1ef3 Rewrote and added more info to python on ms sto... - discretegames
952c4a5 added right aligned drake image and a few tweak... - discretegames
13779f3 final tweaks to ms store article - discretegames
3668202 Redid windows guide titles/slugs/descriptions t... - discretegames
19caa0a Rewrote safe method for adding Python to path, ... - discretegames
GitHub Actions run 3491012872 succeeded.
GitHub Actions run 3491185309 succeeded.
09b69ba Include users with no messages in response, and... - wookie184
This is ready for review now.
What I'm thinking is, if we "desperately" want that information, we can have some sort of query post-processing before the API returns a response, and non existent user will have a value of -1 for example.
We don't need that information currently, so it's probably not worth overcomplicating it.
GitHub Actions run 3491560472 succeeded.
GitHub Actions run 3491597036 succeeded.
Connected!
GitHub Actions run 3491637732 succeeded.
I think "like" is fine, and prefer anything that is shorter
I agree wtih Steele; the more basic a topic, the less useful a technical explanation will be to a beginner
This sentence alone might not explain how return works, but it does point a beginner in the right direction. If they want something from inside a function, this motivates them to learn how return works.
GitHub Actions run 3493453418 succeeded.
Hello,
Please follow the contributing guidelines when creating pull requests. I will be closing this PR.
GitHub Actions run 3499140933 succeeded.
05a2b1a Add size and compression to attachment fields - ionite34
Not a proper review yet, just some comments from a quick look over.
Unmounting a tmpfs deletes the contents, so this shouldn't be necessary.
I'm not sure there's much point including the mimetype if we're only using the filename to guess it, and are returning the file name anyway.
This feels pretty fragile, changing behaviour just based on whether there is a letter c in the arguments and having to hardcode support in for timeit isn't great.
Maybe we should make the input API parameter optional, and then only add main.py if that was passed, otherwise just use the args given (which could contain code). This would be pretty simple behaviour and also flexible. Not sure how we deal with breaking changes for snekbox though.
Same for size and compression type. If we're only using one compression type then there's no need to include it in the response (and I think supporting multiple compression types is overkill unless there's a real need for it). And with the size, is it really needed?
It seems from my testing it still leaves the folder, should I do a tmp.unlink() instead then?
<img width="350" alt="image" src="https://user-images.githubusercontent.com/13956642/202793747-edcfc299-d642-42c3-a187-090aaf6f50f6.png">
Since we're planning on having a higher file size limit on the snekbox end and doing so on the bot end, it might be a waste of resources to uncompress a very large and well compressed content just to discover it's over our discord-side limit. Some 48MB of repetitive strings could compress to ~4KB, for example.
My understanding (from skimming over the barely existant documentation and confusing cpp parser source, is that this mounts a regular folder (in this case backed by tmpfs on the docker side) onto nsjail as a tmpfs, so it isn't actually a tmpfs created on the nsjail side, but a fake one? This might be completely wrong, I'm not sure.
However the space here is usable to the full limit of our memfs allocation, and not the memory limit of the instance, so that would suggest it's not using nsj...
The fact that DEBUG isn't declared in __all__, which I guess I understand the intention there?
Yeah I agree this isn't ideal, I was just trying to make this work without breaking changes mostly.
The timeit situation mainly stems from the fact that it requires string input
{
"input": "[i for i in range(100)]",
"args": ["-m", "timeit"]
}
->
python3 -m timeit "i for i in range(100)"
whereas something like unittest would requires a module/file
python3 -m unittest main.py
So, not sure how we can really decide on snekbox side, maybe this should be so...
Optionally we can just fix input to always write a file, and if the user wanted -c or timeit strings, require that to be in args instead?
My understanding (from skimming over the barely existant documentation and confusing cpp parser source), is that this mounts a regular folder (in this case backed by tmpfs on the docker side) onto nsjail as a tmpfs, so it isn't actually a tmpfs created on the nsjail side, but a fake one? This might be completely wrong, I'm not sure.
I did some testing and I think my guess was correct and it just creates a new tmpfs ignoring the source. To demonstrate this you can modify the code to this:...
Okay cool thanks for the testing and info. Yeah I agree in that case the config approach in #113 is probably better then and will be remove the shm mounting in this PR.
This is what the American country has been looking forward to for years. As a single nation, we are finally able to provide a detailed and in-depth aggregation of information on American citizens, which further improves our commitment to a brighter future for our citizens. It is imperative to be aware of our environmental impact, and I am hereby signing this pull request into master.
GitHub Actions run 3467609527 succeeded.
Hi @SebastiaanZ, did you have some time to check out this issue or do you mind if I snag it from you?
Thanks for simplifying this!
I felt a couple of comments, let me know what you think :D
I suggest to turn this into: A function will ... if it doesn't have a return statement in it
It doesn't necessarily need to end with it (even though it's not a good practice)
โข When you want to print a value from a function, it's best to return the value and print the *result of the function call* instead, like `print(square(5))`.
Might help to enumerate the common mistakes here
Ah, the directory left isn't the tmpfs, it's just the mountpoint directory created in mount_tmpfs. I think it would be better to use tmp.rmdir() and add a comment to make that clear.
Why is a chmod needed here? (also all the other chmods)
I've made a quick research on how this could be done in Postgres, and I've found quite a good example.
Implementation would only depend on how resilient & precise we want it to be (in terms of consistency & persistence)
Using Redis leverages the fact that we don't need to set up this model & endpoints in our site project if we'd go with having a queue in our DB, but also the fact that it's simpler to implement but would die wheneve...
[python-discord/site] New branch created: fix\-manage\-py\-no\-args
[python-discord/site] Pull request opened: #798 Fix error when invoking manage\.py with no arguments
Previously when running python manage.py:
Traceback (most recent call last):
File "C:\Users\wookie184\Documents\GitHub\site\manage.py", line 217, in
main()
File "C:\Users\wookie184\Documents\GitHub\site\manage.py", line 198, in main
_static_build = "distill" in sys.argv[1]
IndexError: list index out of range
Now displays the help command instead
GitHub Actions run 3503796386 succeeded.
What if we allow creating 1 thread per user via a command ? That way we can have more control over how many threads a user can open, and it can be scoped in terms of allowed channels ?
The limit would still be one thread / user / topical channel, and we can use the redis cache to store how many threads this user has open in a particular channel to determine whether we should allow it or not.
However, we run the risk of having our Redis DB die, which will allow users to create another t...
Have tested, one more thing and this looks good ๐
Should check for it being none first
for nomination in history:
if nomination.thread_id is None:
continue
try:
thread = await get_or_fetch_channel(nomination.thread_id)
GitHub Actions run 3504049546 succeeded.
marked do not merge pending bot PR, not sure if it would actually cause any issues merging before but easiest to wait rather than risk it.
GitHub Actions run 3504151663 succeeded.
I think this was a remanent when there used to be exposed access to this folder. Removed in a0c908a. The chmods for the home directory would have to stay because that needs to be read/write.
GitHub Actions run 3504245446 succeeded.
GitHub Actions run 3504256803 succeeded.
What change are you suggesting specifically?
I picked this wording carefully, because a function can have a return statement and still have an implicit return None if the return statement is never executed (ex, if the only return statement is in an if block that isn't entered). But we can hand-wave that away if others find my proposed wording confusing.
I'm suggesting to make the separation of the common mistakes clearer by saying sth like:
- Common mistake 1:
... - Common mistake 2:
...
It's important that the tag be as brief as possible. What value do you think this additional text contributes when the code examples are already there?
I agree with that, I just am afraid people will think that the return statement can only be at the end
For total beginners, code might not be an "obvious" thing. And I believe having context helps them better position themselves & understand it better
I don't think these extra words have added value given that an example immediately follows.
Sure, no need to change it
Thoughts on adding a test that creates lots of empty directories to ensure there are limits on that? Memory taken up by them doesn't count towards the tmpfs size afaict. Currently the limit seems to be due to it hitting cgroup_mem_max, which is fine, although we could also consider setting nr_inodes in the mount options to explicitly limit that if we wanted to.
The file size limit is a different thing to the tmpfs size, and I think this is just testing the file size limit (rlimit_fsize parameter in nsjail, set to 1mb by default). To test the tmpfs size we'd have to create a bunch of files below 1mb. We should then get a different error, OSError: [Errno 28] No space left on device
I guess we could not include the + 1, since the current process will count as 1, although it doesn't really matter.
I think we should probably just add DEBUG to __all__
I see no issues with the current implementation of this feature.
I'll just have it as Gist to keep it consistent.
We'll probably have a guide on it in the future.
I agree with your statement.
directory should be module in this case.
I've made a note above the first instance of discord.Intents.default() with a link to the factory, along with what's excluded from all the intents.
GitHub Actions run 3505669984 succeeded.
Sorry for the amount of comments. Most of them are nit picks so it should be quite simple to do deal with. Feel free to disagree with them. However, there is one thing about the intents that I think should be addresses. Thank you ! :D
@shtlrs No problem. All of them have been looked at and resolved in 5a25a52.
Implemented new api format in ba6d0a8 which avoids parsing / guessing on snekbox's side in favor of the client providing all arguments and files.
"args": ["main.py"],
"files": [
{
"name": "main.py",
"content": "print(1)"
}
]
Removed mime and compression in ba6d0a8
Are the exposed packages going to be an issue, or can we simply install all the same versions to all python interpreters.
I think it would be a nice idea to be able to have different packages installed. Any c-extension could compile differently based on the targeted python version, so it would be nice to have different versions.
This is the final stretch !
- The only difference here too is that the `MySlashGroup` class directly subclasses the **Group** class from discord.app_commands which automatically registers all the methods within the group class to be commands of that specific group. So now, the commands such as `ping` can be run using **/uwu ping** and `command` using **/uwu command**.
- The only difference used here is `group = app_commands.Group(name="uwu", description="...")` and `group.command`. `app_commands.Group` is used to initiate a group while `group.command` registers a command under a group. For example, the ping command can be run using **/ping** but this is not the case for group commands. They are registered with the format of `group_name command_name`. So here, the **command** command of the **uwu** group would be run using **/uwu command**. N...
The latest and up-to-date usable discord.py version can be installed using `pip install -U discord.py`. If you get an error such as: `'git' is not recognized...`, it means that you don't have git installed on your platform. In that case, you will need to do so by going through the required steps for [installing git](https://git-scm.com/downloads) and make sure to enable the `add to path` option while in the installation wizard. After installing git you can run `pip install -U d...
GitHub Actions run 3508190355 succeeded.
Thanks for taking care of all my picky comments !
LGTM :D
ecc249f Add metricity query for messages in past n days - wookie184
4ce5937 Add API endpoint for activity data - wookie184
fca7893 Add tests for metricity activity endpoint - wookie184
798c499 Change the endpoint to be a POST not a GET - wookie184
09b69ba Include users with no messages in response, and... - wookie184
[python-discord/site] branch deleted: messages\-in\-past\-n\-days\-endpoint
GitHub Actions run 3508343846 succeeded.
GitHub Actions run 3508364840 succeeded.
GitHub Actions run 3508369867 succeeded.
My proofread wasn't super thorough but i'm hapy with this for now.
oh wait my approval doesn't count any more rip
Also not super thorough, but overall it looks good
oh wait my approval doesn't count any more rip
Here, take mine
GitHub Actions run 3508560938 succeeded.
d33b811 Bump pip-licenses from 4.0.0 to 4.0.1 (#1149) - dependabot[bot]
5d77223 Bump sentry-sdk from 1.10.1 to 1.11.0 (#1150) - dependabot[bot]
GitHub Actions run 3509530941 succeeded.
GitHub Actions run 3509528162 was cancelled.
GitHub Actions run 3509543768 succeeded.
Another thing that would be nice would be to have a UI where you can see all the responses to specific questions, sort of like Google Forms and Jotforms. Graphs or something of the sort for multiple-choice questions, and a list of text responses for free-response questions.
await interaction.response.defer(ephemeral=True)
We don't want to use thinking because if we don't use a followup the thinking state will never go away.
thinking (bool) โ Indicates whether the deferred type should be [InteractionResponseType.deferred_channel_message](https://discordpy.readthedocs.io/en/stable/interactions/api.html?highlight=interactionresponse#discord.InteractionResponseType.deferred_channe...
@app_commands.checks.cooldown(1, 30)
edit_original_message has been renamed to edit_original_response. On top of that - I don't know if this works with a defer because there isn't really an interaction response to "edit"
7cbc5dc Drop "in Python" from title. - swfarnsworth
28fbcbf Add PyCharm logo. - swfarnsworth
63fa1c0 Create discord-messages-with-colors.md - Krypton
934218e Update discord-messages-with-colors.md - Krypton
40bb274 Preliminary structure - camcaswell
[python-discord/site] branch deleted: keeping\-tokens\-safe
GitHub Actions run 3509935424 succeeded.
I don't know about this either, but I'll rename for now.
Hi @Robin5605
Can you please look into combining these duplicate files? They share duplicate content.
GitHub Actions run 3511002080 failed.
GitHub Actions run 3511017542 failed.
GitHub Actions run 3511237516 succeeded.
[python-discord/site] New branch created: Robin5605\-patch\-1
There are 2 pages on VPS services:
I have no clue how both of these ended up making it - but vps_services.md has all the content of vps-services.md and ...
GitHub Actions run 3511276342 succeeded.
GitHub Actions run 3511322826 succeeded.
[Link to internal discussion](#organisation message). We were discussing how certain responses from the bot could be simplified. Especially the responses that are sent when the bot detected unformatted or improperly formatted code, as these happen quite a bit and can be disruptive to chat when there's such a large embed containing a lot of information to take in at once.
Please leave your thoughts on if and how we should cond...
GitHub Actions run 3511604816 succeeded.
Why was this changed to a list? Ditto for the other test below.
Why is the root excluded now?
This line will not be reached if an assertion above fails. A try-finally could be used, or just a new NsJail instance specific to this test (I don't think having multiple instances would cause problems).
Ditto for the other test.
Why was this change necessary?
Thoughts on naming this files instead of attachments, similar to how the request already calls this files?
msg = f"{msg[:-3]} with the arguments {args}."
is_absolute covers the / case, and "\\" is of no concern since it's not considered absolute on Posix.
This only checks a single dot. Shouldn't it also check ..? I wonder if there is a more convenient way to detect this. Maybe https://stackoverflow.com/a/45190125 ?
Hey @Xithrius! I'll be finishing this up soon, thanks for the reminder
277ea7e Make The Latex API URL Configurable - HassanAbouelela
[python-discord/sir-lancebot] New branch created: latex\-url
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Skipping issue, approved by me.
Description
This PR makes the latex URL configurable via an environment variable, in an on-going dev-ops experiment. We may host the API renderer internally.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or...
GitHub Actions run 3512787293 succeeded.
A message link to where an infraction was issued could provide better context regarding an infraction. This feature has been suggested multiple times in #mod-meta and #mod-tools.
If the infraction was issued in a modmail category, the infraction log field for this feature will instead display "Infraction invoked in ModMail channel" or something similar. In future, the modmail log link for the thead can be displayed.
This feature will also require PR to the site repo since a new fiel...
LGTM but i have not tested :frowning_man: , please forgive.
[python-discord/sir-lancebot] branch deleted: latex\-url
Connected!
GitHub Actions run 3513213080 succeeded.
GitHub Actions run 3513367642 succeeded.
I was thinking there might be issues if we had multiple threads? Though I suppose we don't have that currently. I don't think it hurts to make it thread safe for the time being though?
It's due to the fact I've changed the call within the function to a list and not a tuple since I had to do a couple extend/appends. Wasn't sure whether to cast back to a tuple or just leave it and ended up just leaving it. Do you think it's better if we cast it to a tuple at the end?
Docker recommends to only use strings for port numbers https://docs.docker.com/compose/compose-file/compose-file-v3/#short-syntax-1
Should this be -1 then? Since with no setting the default by nsjail is 1MB
should we have args implicitly include an "-c" default if "input" is non-empty?
Seems accidental. Re-added in 291119d
Make instance size lower global for the tests in a1c614d
73a5501 Remove attachment size limit, added time limit - ionite34
I am in favor of making a new record type or infraction type for storing alt accounts, and not piggybacking off the note infraction as we have been doing.
I'm envisioning this scenario:
User A and User B are the same person, we link them in the database as relationship 1. A week later a new User C comes along and we determine that they are the same person, so we add them to that same relationship so that now all 3 users are tied to the same relationship.
Now whenever we run the user ...
Removed file size limit and associated errors, added configurable file parse time limit in 73a5501
e784bf6 Limit empty str filter to start of py_args - ionite34
Limited empty string filtering to start of iterable in e784bf6
Made request accept base64 only, removed content-encoding parameter, in 4787a94
I've removed the zlib compression completely and content-encoding parsing in 4787a94
I think since compression doesn't seem essential at this point, for the file sizes we're dealing with, (and won't change API if we implement server-layer compression), I'll probably leave that for a future PR.
This is testing that we were actually able to launch exactly n-1 processed (by the numerical output) before the error. So this ensures our process limit is actually working as the exact limit, whereas before it could be failing at 0 with a limit of 6 and the test would pass.
Renamed to files in 4787a94
Renamed to path in 4787a94
Renamed to path in 4787a94
16ec190 Bump flake8-isort from 5.0.0 to 5.0.3 (#1152) - dependabot[bot]
Updated example along with changes in 4787a94
Connected!
GitHub Actions run 3516525599 succeeded.
I agree with mina.
Automating the adding of a note to corresponding alts may remove some of the potential error (like not bothering to add a note in the other direction), it still requires extra work to investigate anything to do with alts.
Making this a formal relationship, this info can be displayed automatically and provide extra details "for free".
For example, if I do !u <some user> it would be nice if there were additional pages for each alt. Having a way of adding a reason i...
Don't we delete the message from the bot about infractions manually created? Or was this changed at some point?
GitHub Actions run 3516941574 succeeded.
Automod messages are sent with the original user as the author, which means they are recorded as that user's messages in metricity. Messages with the automod type should be ignored.
I agree that is the best course of action.
Thanks for clarifying. No objections to keeping it a list.
Thanks. YAML is very cool and good.
Ah, I did not realise NsJail had a default. Unlimited is fine, I think... Ultimately we're concerned without overall disk usage being limited. If that's somehow bypassed or misconfigured, I don't see how a malicious user creating 1 large file (when rlimit is -1) vs. many small files (when rlimit is set) would have a significant impact.
Oh, this is checking the PIDs being printed! I didn't see that those get printed at first; I got lost trying to understand the string parsing happening here. A comment explaining that PIDs are being extracted from stdout would help.
If input exists, it should become the last Python argument. If input exists and args does not exist, then args should default to ["-c"] (in addition to the input becoming the last Python argument).
Gunicorn is configured with multiple workers, though right now I cannot recall if those are threads or processes. My vote is for simplicity, so a lock shouldn't be included if it's not necessary. Can you investigate further? If it is needed, then there should also be a test for whatever bad situation this lock prevents.
This doesn't cover the case of multiple empty strings at the start. I also think writing a test for this would be beneficial.
The AttachmentError: prefix seems misleading because no such exception type still exists. I don't think it's necessary.
I have mixed feelings towards having a timeout. I'm leaning towards keeping it simple and not having a timeout. It should be possible to prevent long parsing times by just limiting the amount of files, for which we already have a setting.
Furthermore, it seems unintuitive that the process may have an OK exit code with some stdout available, but it's getting overwritten by an error, and the HTTP response is still 200. This is also a concern I had with the previous code that was erroring out...
I think it's a good idea that this is configurable now.
My main concern is, if we allow nested directories in outputs, someone could create a very deeply nested directory as a denial of service attack.
In general this is a potentially lengthy part of server side code execution that can be entirely controlled by the user.
I agree that the response feels unintuitive though. Maybe it can just be a 500 error? This is more of a catastrophic fail-safe than something that is going to come up often.
GitHub Actions run 3522259770 succeeded.
@MarkKoz so apparently setting fsize limit to either -1 or inf (as documented by nsjail) will raise a ValueError during protobuf parsing. Any advice on how to proceed with implementing unlimited file size?
GitHub Actions run 3525439201 succeeded.
I have changed the returncode of the TimeoutError to None to be in-line with the previous snekbox stdout errors.
Implemented the pathlib solution since 00b7e3b as detailed in the stackoverflow post. Should be better since now we only disallow traversal beyond root.
Only using is_absolute since 00b7e3b
Created function iter_lstrip for this task, and additional unit tests since 621c835
GitHub Actions run 3527124521 succeeded.
Honestly after attempting an implementation, this seems to just increase complexity and error-prone code (like the fact that our specification will be an 'either-or-but-at-least-one' requirement of args and input. The initial inclusion of input was already largely redundant as it is directly appended to args, so args can achieve all of the previous usages of input but without the ambiguous parsing and dynamic default of "-c" that we do on our end.
In the future, if we support ...
70882b1 Abbreviate automated messages - swfarnsworth
[python-discord/bot] New branch created: swfarnsworth\-automated\-markdown\-messages
This commit abbreviates the automated messages that are triggered by code not posted in markdown blocks, or posted in ill-formatted blocks. Note that I do not have a bot development environment, and if we agree to proceed with this rewording (or a variation thereof), someone will still need to verify that they would be rendered correctly in production.
GitHub Actions run 3527700113 failed.
8c897dc Refactor MemFS set and semaphore to rely on fid... - ionite34
I think the argparse default here already makes -c the default? The previous unit tests for main also work fine.
Refactored and added comments to make this clearer in 2b20b85
Changed in 8c897dc to raise a RuntimeError on most attribute access when not initialized through __enter__
GitHub Actions run 3529355541 succeeded.
Hm, I think that sounds reasonable. I was originally trying to avoid creating any other directories in the instance /home since now there's a potential FileExistsError if an user provides a file called output in the request. Though I suppose we could check for that as a validation?
f12f8f3 Update python3 docstring - ionite34
a45ebca Merge branch 'bytes-output' of https://github.c... - ionite34
GitHub Actions run 3531013327 succeeded.
GitHub Actions run 3535806379 succeeded.
Connected!
For our usage this saves python bot having to decode a base64 content string if size already exceeds our limit, which is not a huge optimization but could be a useful information which is free for us to include.
GitHub Actions run 3538602435 failed.
GitHub Actions run 3538646873 succeeded.
[python-discord/snekbox] New branch created: add\-dep
After file system support from #2326, we should add matplotlib to our deployment.
[python-discord/site] New branch created: vivek/add\-jump\-url\-field
[python-discord/bot] New branch created: vivek/infra\-log\-add\-jump\-url
GitHub Actions run 3539570350 succeeded.
I thing this bot should have a new command called !under.
!under should show the rules for how underscores work in python. it would be very beneficial for new programmers to learn how to use underscores when naming vars/functions/classes.
Our current setup is that users must run !subscribe in bot-commands in order to bring up a view of all self-assignable roles.
We should create a permanent view in #roles with a single button which will essentially run the command (with an ephemeral message).
This is more in line with how it works in other communities, with a better UI than running a command, and arguably better discoverability.
The current !subscribe command should remain as-is for the time being.
GitHub Actions run 3545828416 succeeded.
GitHub Actions run 3547863511 succeeded.
Could you match the capitalization of SQLite to the old version.
Note that sqlite3 and SQLite is two different pieces of software:
- sqlite3 is the standard library extension module in CPython
- SQLite is the underlying C library used by the sqlite3 extension module
The link points to the Python documentation for the standard library extension module sqlite3, not to the SQLite documentation. The SQLite docs can be found here: https://www.sqlite.org/docs.html
[python-discord/bot] branch deleted: help\-channel\-rewrite
7bb24dc Update constants for new forum channel help system - ChrisLovering
d7d352a Remove unused caches - ChrisLovering
451a2d8 Update help channel system to use forum channels - ChrisLovering
a2b3c06 Use help channel util from help channels cog - ChrisLovering
a152396 Use helper util to determine if snekbox is bein... - ChrisLovering
[python-discord/bot] Checks Successful on PR: #2318 Update help channel system to use forum channels
GitHub Actions run 3551085509 succeeded.
Connected!
GitHub Actions run 3551100326 succeeded.
Sentry Issue: BOT-3AW
Forbidden: 403 Forbidden (error code: 40058): Cannot message this thread until after the post author has sent an initial message.
(1 additional frame(s) were not displayed)
...
File "bot/exts/help_channels/_cog.py", line 122, in on_thread_create
await _channel.help_thread_opened(thread)
File "bot/exts/help_channels/_channel.py", line 116, in help_thread_opened
...
dff56ab Send DM message to help post opener sooner in t... - ChrisLovering
[python-discord/bot] New branch created: help\-system\-timeout
This is to give Discord time to make the thread actually avaiulable to be posted in for the send_opened_post_message call
Closes #2334 Closes BOT-3AW
GitHub Actions run 3551219830 was cancelled.
GitHub Actions run 3551226155 succeeded.
Connected!
GitHub Actions run 3551258923 succeeded.
A couple of changes are required to modlog.py for forum post deletions to be logged properly.
First of all, thread deletion doesn't seem to be getting logged at all. This may simply be a matter of using on_raw_thread_delete rather than on_thread_delete.
Second, for moderation purposes, it would be useful to log the content of the post itself. The ID of the initial mes...
ed815a1 Simplify Help Thread Warning Log - HassanAbouelela
fcf7e1c Handle Discord API Not Being Ready - HassanAbouelela
4779d42 Don't Remove Cooldown Role From Non-Existing Users - HassanAbouelela
81a6878 Catch Failure In Pining Help Starter Message - HassanAbouelela
555ed4e Check If Thread Is Closed In wait_for_deletion - HassanAbouelela
[python-discord/bot] New branch created: help\-forum\-fixes
GitHub Actions run 3553400956 succeeded.
[python-discord/bot] New branch created: bump\-bot\-core
This also bumps all the other deps while I'm here, and updated the module name.
51468b8 Check If Thread Is Closed In Pagination - HassanAbouelela
This removes support for aioredis, since we use redis-py we're fine.
Note: There are no breaking changes in DeepDiff 6 compared to the latest DeepDiff 5 releases.
Breaking changes are only to functions we do not use.
https://more-itertools.readthedocs.io/en/stable/versions.html
Removes the --boxed cli arg, which we don't use.
bf7d452 Handle Images As Starter Messages - HassanAbouelela
GitHub Actions run 3553487602 succeeded.
GitHub Actions run 3553496006 succeeded.
Looks good, just a couple of comments
I'm curious, why did we remove the name here ? Was it resulting in an AttributeError or is is just because the name can be too long and result in clutter ?
Can't this be simplified into the following to remove these nested try except blocks ?
try:
await bot.instance.wait_for('reaction_add', check=check, timeout=timeout)
except asyncio.TimeoutError:
try:
await message.clear_reactions()
except discord.HTTPException as e:
if not isinstance(message.channel, discord.Thread):
# Threads might not be accessible by the time we try to remove the reaction.
raise e
try:
await message.delete()
except discord.NotFoun...
Are we sure that 2 seconds will always be enough ? Isn't there another event we can subscribe to, like the starter message for example ?
Sentry groups similar alerts, adding the name meant it was different enough not to group, leading to a load of alerts
This was part of the first commit, and it's for sentry. Basically in the case of a warning log, sentry doesn't get a traceback and only has the warning message to go off. Considering how much of the message itself is made up of the thread name, this leads to sentry failing to recognize and group these warnings as one thing. I'm not sure if this will fix it since the thread IDs are different as well of course, but I thought i'd try. Also having the thread name in the warning means the sentry i...
Yea, theoretically we could wait_for an on_message event which has the same message_id as the just created thread. Since this would then mean the message was sent to us via the gateway, and is also cached in d.py
except discord.HTTPException:
# Suppress if trying to act on an archived thread.
if e.code != 50083:
raise
except discord.HTTPException:
if e.code == 50083:
# Trying to act on an archived thread, just ignore and abort
break
else:
raise
except discord.HTTPException:
# Suppress if the message was not found, most likely deleted
if e.code != 10008:
raise
Did you mean to remove the as e here? We need it to get the code
I had the condition that way to clarify that the comment belongs to the condition when it's true. I guess it's fine though
0be0767 Refactor Thread Error Catching - HassanAbouelela
GitHub Actions run 3553652269 was cancelled.
GitHub Actions run 3553656671 succeeded.
GitHub Actions run 3553672164 succeeded.
GitHub Actions run 3553708882 succeeded.
ed815a1 Simplify Help Thread Warning Log - HassanAbouelela
fcf7e1c Handle Discord API Not Being Ready - HassanAbouelela
4779d42 Don't Remove Cooldown Role From Non-Existing Users - HassanAbouelela
81a6878 Catch Failure In Pining Help Starter Message - HassanAbouelela
555ed4e Check If Thread Is Closed In wait_for_deletion - HassanAbouelela
[python-discord/bot] branch deleted: help\-forum\-fixes
Connected!
GitHub Actions run 3553791593 succeeded.
GitHub Actions run 3553844705 succeeded.
GitHub Actions run 3553873216 succeeded.
Connected!
GitHub Actions run 3553894879 succeeded.
Could we potentially merge this today? I've seen this confusion come up twice since the new help system was rolled out less than 24 hours ago, and I think the new version of this message would be helpful.
ef896ac Get at store the help forum channel object on c... - ChrisLovering
0d81ac0 Consistantly refer to help posts as posts, not ... - ChrisLovering
80eef3e Don't load the help channel cog if disabled - ChrisLovering
43de954 Auto archive help forum posts after inactivity - ChrisLovering
211edb4 Listen for thread starter on_message rather tha... - ChrisLovering
[python-discord/bot] New branch created: auto\-archive\-help\-posts
This PR has a few improvements to the recently added help forum system.
Each commit is an atomic change. As such, reviewing by commit will make this PR easier to review.
GitHub Actions run 3553951699 succeeded.
GitHub Actions run 3553968301 succeeded.
GitHub Actions run 3554036855 succeeded.
GitHub Actions run 3554055512 succeeded.
GitHub Actions run 3554172271 succeeded.
GitHub Actions run 3554187114 succeeded.
GitHub Actions run 3554210925 succeeded.
GitHub Actions run 3554228589 succeeded.
GitHub Actions run 3554303197 succeeded.
GitHub Actions run 3554314807 succeeded.
GitHub Actions run 3554343447 succeeded.
GitHub Actions run 3554399765 succeeded.
Thanks, looks good as far as I can see
0c27593 Catch case where starter message is deleted bef... - ChrisLovering
GitHub Actions run 3554514367 was cancelled.
GitHub Actions run 3554519757 succeeded.
Add a debug log if you think it would be useful.
Handle the case where this raises an error if the thread doesn't exist.
This change doesn't seem related to the issue, so might be worth splitting to another PR, since there's some more logic you'll need here.
get_or_fetch_channel will raise an error if the channel isn't found, rather than returning None that you are assuming here.
In your nomination_vote_threads list comp if the thread is non, you're adding '', which will result in odd output since, it will still add the comma separator.
A couple of points to discuss when I publish this PR:
1. Upon creating an issue and when a member is not found, should we delete the nomination ? 2. We need to update our contribution guide to detail the new config that needs to be added in case someone wants to use/test the feature, right ?The issue template/content/title is still to be discussed
- Not in this PR, that can be discussed in a separate issue.
- Yea, that can be another PR to site after ...
GitHub Actions run 3554728930 succeeded.
I think we should set has_task=False here, since there won't be an event in the scheduler for a new post and so scheduler.cancel will raise a ValueError
The code you just quoted is adding this coro as a task to the scheduler
The scheduler will have a task for the post - the one scheduled in these lines.
Sentry Issue: BOT-3AR
AttributeError: 'TalentPool' object has no attribute 'cache'
File "discord/ext/commands/core.py", line 229, in wrapped
ret = await coro(*args, **kwargs)
File "bot/exts/info/information.py", line 227, in server_info
embed.add_field(name="Moderation:", value=self.get_extended_server_info(ctx))
File "bot/exts/info/information.py", line 83, in get_extended_serv...
5da9d6a Get, and store, the help forum channel object o... - ChrisLovering
dc99ba4 Consistantly refer to help posts as posts, not ... - ChrisLovering
7d33a85 Don't load the help channel cog if disabled - ChrisLovering
707ace7 Auto archive help forum posts after inactivity - ChrisLovering
8a9a279 Listen for thread starter on_message rather tha... - ChrisLovering
[python-discord/bot] branch deleted: auto\-archive\-help\-posts
Connected!
GitHub Actions run 3554799248 succeeded.
Closes #2332
As stated by Zig, subscribing to our public roles is currently not super visible since it revolves around executing the !subscribe command that usually goes by unnoticed.
To make this easier, more visible & to align with other communities have, we decided to add a persistent view in the #roles channel that allows people to subscribing to all roles by a click of a button.
GitHub Actions run 3554958467 succeeded.
I'm concerned that I'm leaving too many comments on non-blockers. Let me know if you'd prefer to defer some comments to a future PR (which doesn't necessarily have to be implemented by you). I don't want to create a draining review cycle for you.
Looks like there is a way to specify infinity in the config. Have you already tried this?
https://github.com/google/nsjail/blob/c7c0adfffe79ebebfacca003f3cd8e27ef909185/config.proto#L144-L145
https://github.com/google/nsjail/blob/c7c0adfffe79ebebfacca003f3cd8e27ef909185/config.proto#L153
https://github.com/google/nsjail/blob/c7c0adfffe79ebebfacca003f3cd8e27ef909185/config.proto#L61C6-L66
files_limit: Maximum number of files to parse for attachments.
This can fail, right? If so, there should be some API client error for it rather than just falling back to an internal failure (since that would be due to invalid client input, after all).
Speaking of which, there should be a test for invalid b64 input data.
"""Absolute file paths should be denied with 400 error."""
Yeah that's why I was leaning towards leaving it.
Okay this comment is a bit outdated now that I noticed you changed the docstring style. Still, I think this could just be changed to the one liner I suggested above.
c6811ac Don't close already closed posts - ChrisLovering
[python-discord/bot] New branch created: don't\-close\-already\-closed\-posts
GitHub Actions run 3557874955 succeeded.
GitHub Actions run 3557977095 succeeded.
This is a continuation of #2323
Soon enough, we will be tracking nominations that have been sitting for more than 2 weeks.
When tracking these nominations, we can run into the case where a particular member is no longer part of our server, which leads to asking the question: what needs to happen then ?
I think that closing the nomination & archiving the thread (if it exists) would do the job, as there's no need to keep it open.
We could potentially track if there's an open issue f...
GitHub Actions run 3558106792 succeeded.
We'll remove inactive members from the talent pool in https://github.com/python-discord/bot/issues/2302#issuecomment-1287221089. That, and ensuring we don't post vote threads for users not on the server should be enough IMO. This also avoids a user from being unnominated if they accidently left and rejoined or something similar.
Connected!
GitHub Actions run 3558514698 succeeded.
Here's what it currently looks like, please fix the linter errors and missing/extra newlines.



This sounds like a good idea for a tag. I don't think we have a similar one already.
It should list the following styles:
__name___name__namename__
Giving a very short explanation of each (and potentially linking to a resource with more information if relevant).
[bot] Branch don't\-close\-already\-closed\-posts was force-pushed to `af873d3`
GitHub Actions run 3558615474 succeeded.
GitHub Actions run 3558641135 succeeded.
Connected!
GitHub Actions run 3558662115 succeeded.
@mbaruh What do you think of redirection users to the bot-commands channel when they click on that button in the #roles channel ?
The problem is, since we want them to be ephemeral messages, the bot won't be able to edit them whenever a user clicks on a particular role, which makes it non feasible.
I worked around this by giving the 2nd view a timeout, and it gets deleted upon timeout, and it works just fine.
The only thing that worries me is that people would spam this, which causes ...
[python-discord/bot] New branch created: dont\-use\-removed\-talentpool\-cache
Closes #2340 Closes BOT-3AR
GitHub Actions run 3558710700 succeeded.
GitHub Actions run 3558714470 succeeded.
GitHub Actions run 3558742542 succeeded.
GitHub Actions run 3558780485 succeeded.
[bot] Branch don't\-close\-already\-closed\-posts was force-pushed to `0ed06cb`
[python-discord/bot] branch deleted: don't\-close\-already\-closed\-posts
[bot] Branch dont\-use\-removed\-talentpool\-cache was force-pushed to `7900bce`
GitHub Actions run 3558794239 succeeded.
Tags can have aliases, and they clutter the tags list. A person going over the possible tags will see several entries of the same tag, and might be unable to open the tag if trying to invoke its aliases one after another because of tag cooldown, leading to confusion.
Only the main tag name should be used, and we should have a better way to see a tag's aliases if we want them for anything beyond fuzzy matching (for example by showing all names in the same list entry).
GitHub Actions run 3558802106 succeeded.
Connected!
GitHub Actions run 3558812018 succeeded.
Ephemeral messages can be edited.
If they spam it and it becomes cluttered that's their problem, they're the only ones who will see the clutter.
Ok, I think I know what was wrong.
Ignore my last comment then, and thanks for the hint !
Currently, get_or_fetch_channel is only typed to return an instance of GuildChannel, which isn't always true since it can also return a Thread or a PrivateChannel
The purpose of this issue is to improve the return type hints.
GitHub Actions run 3559061809 succeeded.
GitHub Actions run 3559077088 succeeded.
GitHub Actions run 3559102596 was cancelled.
GitHub Actions run 3559106443 succeeded.
GitHub Actions run 3559126643 succeeded.
Seems the same as what discord.py types get_channel and fetch_channel as so should be good, thanks.
I think the current way is good enough and more concise.
af9612f Link directly to the sqlite3 placeholder howto - erlend-aasland
7bb24dc Update constants for new forum channel help system - ChrisLovering
d7d352a Remove unused caches - ChrisLovering
451a2d8 Update help channel system to use forum channels - ChrisLovering
a2b3c06 Use help channel util from help channels cog - ChrisLovering
[python-discord/bot] branch deleted: swfarnsworth\-tags
GitHub Actions run 3559183064 succeeded.
Connected!
GitHub Actions run 3559201906 succeeded.
8f2f188 fix: Handle uncached messages in filter editing - mbaruh
I see, then i guess your other PR should take care of all of that since it'll be activity based, right?
GitHub Actions run 3559730469 succeeded.
Connected!
GitHub Actions run 3559742285 succeeded.
GitHub Actions run 3560095870 was cancelled.
GitHub Actions run 3560098136 succeeded.
GitHub Actions run 3560108351 succeeded.
GitHub Actions run 3560124478 succeeded.
GitHub Actions run 3560145099 succeeded.
GitHub Actions run 3560155122 succeeded.
I think having a thread tagged with Solved will give better Overview on whether the issue has been actually solved or not.
This allows potential users who are searching for a question to know whether they'll potentially find the answer or not.
Executing !solved (and maybe !close) will do just that.
I can take this if approved
fca97ce Switch null byte test to use eval_code - ionite34
Changed to use setUpClass and tearDownClass and cleanups in f4494c3
315c5fa Add assertions for test_unmount_flags - ionite34
Missing assertions added in 315c5fa
407e6b2 Refactor FileAttachment as non generic - ionite34
Refactored as non-generic in 407e6b2
Refactored as non-generic in 407e6b2
fabaae9 Rename json to as_dict, FileAttachment no... - ionite34
I've renamed to as_dict since I feel the fact that this is a property and not a method, it might be confusing to share the same name to_dict as the other method ones. fabaae9
7e7c0d6 Add invalid, absolute, null byte paths to schema - ionite34
I think the only invalid path is a single / on linux? And that would be caught by as an absolute path. File writing is also in a try block with an associated OSError report.
Though I have added handling for absolute paths (any path beginning with / or \0) and unit tests for these in 7e7c0d6
I am not sure if we can do traversal checks with regex. And I think we should still ke...
With our migration to forum channels this week we are now using threads (posts) instead of channels, and closed/dormant channels now get referred to as #deleted-channel.
I'd like to suggest we add the channel name as text in the embed somewhere as well.
0442a7c Add ParsingError handling for invalid base64 - ionite34
dffd9c8 Add tests for invalid base64 file content - ionite34
Added additional unit tests in dffd9c8
I think that's better yeah, renamed to filesystem in e72032f
I've added schema level validation for \0 and paths starting with /, though I think we'll still need this for the traversal checks and for __main__ usage.
Should be yeah, clarified in 2ba9431
8272f88 parse_files refactor as instance method - ionite34
Refactored parse_files as an instance function files_list of MemFS in 8272f88. Made argument naming between files and files_list more coherent.
GitHub Actions run 3561852552 failed.
0de6825 Refactor MemFS for implicit cleanup support - ionite34
Yeah I agree, I think the context manager being optional is more in-line with conventions. I've changed it to be initialized during __init__, with a weakref.finalize running the cleanup on garbage collection with a ResourceWarning if the context manager is not used, modeled after https://github.com/python/cpython/blob/main/Lib/tempfile.py#L844
I've added compatible support for input in the API route in 84e73c1, so it is backwards compatible now. Added some associated unit tests to ensure the old input style still works.
Currently the API route requires either args or input. If input exists, args will have a default of -c if it is otherwise empty.
We've just migrated to a new shiny forum system to offer help and support for our members, (Thanks @ChrisLovering ) but the profile's readme still mentions the old help channels system.
The readme needs to be updated to account for that change.
dab4a60 Use the old stat slugs in new help system - ChrisLovering
[python-discord/bot] New branch created: record\-help\-channel\-claims
GitHub Actions run 3567568796 succeeded.
Connected!
GitHub Actions run 3568574956 succeeded.
[python-discord/sir-robin] New branch created: aoc\-straight\-migration
This is a migration of the Advent of Code cog, mostly as-is, from Sir Lancebot to Sir Robin. This is as close to a straight migration as I could manage. Any changes or improvements we want will be made in subsequent PRs once this is merged in.
How do I review this?
I've split this up into 4 commits, grouped by collections of files/changes:
- Porting over the necessary
utils/files - Updating the
constants.pyfile - A quick port of the invoke help command thingy
- Migration of ...
This has been superceded by #66, sort of. The PR taking this over is a straight migration. It does not include the new seasonal-ish locking features or the migration of information to site. That will be done in future, separate PRs.
#66 Partially handles this, but it also ports the seasonal-locks as is, which I dislike.
I'll keep this issue open for now until I can create proper issues for the other changes I'd like.
fd4d8b3 Make isort and flake8 happy - janine9vn
Advent of Code will be handled by our Events Bot, Sir Robin going forward.
https://github.com/python-discord/sir-robin/pull/66 is the PR to handle the porting it over.
Currently, this Advent of Code cog in Sir Lancebot will fail as soon as env vars are updated for the current year. Our current code using Redis Caches is incompatible with a dep bump in async-rediscache. Any join code or leaderboard invocation will fail due to inability to pull or check what's in the cache.
This PR w...
GitHub Actions run 3569901102 succeeded.
plural noun "things" requires plural verb "are"
GitHub Actions run 3577546818 succeeded.
GitHub Actions run 3577718194 succeeded.
1f592cb include Thread & PrivateChannel in get_or_fetch... - shtlrs
e4cf98f Update return.md (#2325) - swfarnsworth
1988385 Merge branch 'main' into improve-get-or-fetch-c... - ChrisLovering
206115f Merge pull request #2347 from shtlrs/improve-ge... - ChrisLovering
dab4a60 Use the old stat slugs in new help system - ChrisLovering
[python-discord/bot] branch deleted: dont\-use\-removed\-talentpool\-cache
GitHub Actions run 3577746295 succeeded.
Connected!
GitHub Actions run 3577778428 succeeded.
GitHub Actions run 3577997467 succeeded.
44d3607 Rename print-return to return-gif - janine9vn
[python-discord/bot] New branch created: return\-jif\-rename
This renames !print-return to !return-gif based on some feedback from Helpers.
It also adds !print-return and !return-jif as aliases.
GitHub Actions run 3578987735 succeeded.
I'm fine with return-jif for the meme, even though /gษชf/ is the only pronunciation I will accept.
e2798da Edited several tags (#2322) - Keyacom
af9612f Link directly to the sqlite3 placeholder howto - erlend-aasland
7bb24dc Update constants for new forum channel help system - ChrisLovering
d7d352a Remove unused caches - ChrisLovering
451a2d8 Update help channel system to use forum channels - ChrisLovering
GitHub Actions run 3579244488 failed.
Is this what the help command is supposed to look like? This looks like the vanilla.

I misunderstood what the help invoke function is about. It works (ex: &help aoc x)
[python-discord/bot] branch deleted: return\-jif\-rename
Connected!
GitHub Actions run 3580557968 succeeded.
Can someone make time to figure out which utilities are common and create an issue for them to be migrated to bot-core? The copy-pasting is fine for now given the urgency.
Will the AoC extension on the other bot be disabled for the time being, or is there a PR soon to remove that code?
Was this accidentally left in while locally debugging?
Basically this is the only other change and it looks correct ๐
I did not intend for my comments to block the merge (given that they were left with an approval). I don't know why GH is blocking. Feel free to resolve them whenever you want to merge this. I assume you're still waiting for env vars to be set in prod?
As far as I remember, when mods infracted someone, the message of the bot confirming the infraction would get deleted after a moment. A quick search seems to suggest this was changed though, since the bot messages persist
Yes, but also I do want to keep it in for a little bit. I had an issue with a leaderboard and the status alone wasn't enough info to know what happened.
Praise be to Scale who showed me how the new async-rediscache stuff works
I ripped a lot of the utils/ files from Sir Lancebot and put them in Sir Robin to get the Advent of Code cog working. That's a lot of duplicated code that can likely be de-duped via bot core.
We should take a look and see what can be migrated over.
2fbb9d0 Advent of Code Migration from Sir Lancebot (#66) - janine9vn
[python-discord/sir-robin] branch deleted: aoc\-straight\-migration
Connected!
Connected!
GitHub Actions run 3584657777 succeeded.
36ee872 Don't count bot messages as an answer in a thread - wookie184
[python-discord/bot] New branch created: maybe\-fix\-help\-stats\-bug
Not tested, as I don't have forum channels on my test server, but I think this is correct (on_message does include bot messages, right?).
I looked into this as I noticed that the unanswer rate was 0 on grafana in the past 12 hours, but there do seem to be some unanswered questions.
GitHub Actions run 3586373933 succeeded.
cbbd444 Change discord.py links in tags to use stable v... - thegamecracks
dc9413f Fix reference link in customcooldown.md - thegamecracks
a9cf7cf Update intents.md - thegamecracks
7244f4b Merge pull request #2321 from thegamecracks/dis... - wookie184
5095880 Add further clarification to intents.md - thegamecracks
GitHub Actions run 3586588793 succeeded.
Oh, okay.
We will be storing the link to the mod's message here though.
GitHub Actions run 3592328076 failed.
Our help channel guide on site still references the old system.
https://pythondiscord.com/pages/resources/guides/help-channels/
This needs to be updated to align with our new forum system.
106df17 Defer callback response for AoC selects - ChrisLovering
[python-discord/sir-robin] New branch created: fix\-daystar\-command
Discord's API now expects the interaction to be responded to, or else it will report the interaction failed. Since we an in fact defering actual feedback to the user until they press 'fetch' deferring the interaction is the correct thing to do here.
[python-discord/sir-robin] New branch created: bump\-all\-deps
This bumps all our deps, CI, and pre-commit to latest. Best reviewed per-commit
Hey, @Robin5605, seems like they are not going to re-review this, as 4 months have passed since the changes they suggested have been implemented. Is there a way to continue working with this PR without their approval?
Problem

Now, the command should be &aoc join because the prefix was changed.
Changes
The command's prefix will be dynamically added in the bad argument message. This means that if the prefix ever gets changed again, the message will be adapted automatically.
GitHub Actions run 3600716077 succeeded.
Connected!
Connected!

