#dev-log
1 messages ยท Page 10 of 1
GitHub Actions run 4468449390 succeeded.
There are no longer any in-server users with the role, so usages of it can be safely removed.
GitHub Actions run 4468537699 succeeded.
CI is failing because lint-test.yaml isn't updated to be triggered on workflow_call, so the static previews aren't being built
Connected!
This fixes BOT-3EXhttps://python-discord.sentry.io/issues/4021640618/?project=2724195&referrer=slack
For some reason, the context's command is lost upon automute.
This PR sets the context command explictly.
GitHub Actions run 4470385741 succeeded.
Connected!
uses: ./.github/workflows/sentry-release.yaml
File name is hyphen separated. We should likely make all of these consistent, either hyphen or underscores.
GitHub Actions run 4473701572 succeeded.
exc_info is redundant when log.exception is used within an except block.
Yeah, fair enough if we stick with something like versions.json. However, I am considering that maybe arbitrary paths is better. It's more flexible, it's less complex, and requires no additional configuration. What problem or use case are we trying to solve by restricting the binaries to a predefined set?
The step was removed, so this seems like it will no longer work. Did you mean inputs.sha_tag? Same thing on line 82, and perhaps elsewhere that I missed.
We'd need to define the python versions statically somewhere at any rate, so we can actually define them in the dockerfile. We might be able to get away with an image that has all python versions already so we don't need to specify them, but that would require an external image most likely. I linked an example in the original issue, but that is no longer maintained.
On a more general level though, I'm not sure arbitrary binaries is the best approach. Different binaries would require differ...
Absolutely right, done in 36c9988028accc5eefaa61a630ccbb355fdd0067
06a6aec Use the correct id for the sha-tag input - ChrisLovering
GitHub Actions run 4477680927 succeeded.
GitHub Actions run 4478227128 succeeded.
bc1dab2 Bump python-dotenv from 0.21.0 to 0.21.1 - dependabot[bot]
f704524 Merge branch 'main' into dependabot/pip/python-... - Xithrius
25e6c80 Merge pull request #855 from python-discord/dep... - Xithrius
9ce6d8e Bump sentry-sdk from 1.13.0 to 1.14.0 - dependabot[bot]
827d2c2 Merge pull request #859 from python-discord/dep... - Xithrius
Add our newest 10th rule that dictates usage of chatgpt & other ai tools to the list of api rules used by bot
GitHub Actions run 4480653643 succeeded.
Add Rule 10 to the rules page
LGTM, thanks for the quick turn around on it
GitHub Actions run 4481467291 succeeded.
799efdf Update docs for upstream documentation change (... - jchristgit
GitHub Actions run 4481716741 was cancelled.
GitHub Actions run 4481719277 was cancelled.
GitHub Actions run 4481725061 was cancelled.
GitHub Actions run 4481750259 succeeded.
GitHub Actions run 4481789959 succeeded.
f4ff92d Bump coverage from 7.2.1 to 7.2.2 (#904) - dependabot[bot]
ef64124 Replace removed path-to-lcov option with new i... - ChrisLovering
GitHub Actions run 4481915208 succeeded.
GitHub Actions run 4482281826 succeeded.
bca23b1 Enable sentry profiling - ChrisLovering
only recording traces half of the time, to not impact performance too much.
GitHub Actions run 4482354971 succeeded.
The docs say "The profiles_sample_rate setting is relative to the traces_sample_rate setting.", which I guess would mean we get 25% of profiling events with this?
I also wonder whether this will work properly without hooking into discord.py to create transactions e.g. for messages/commands (https://docs.sentry.io/platforms/python/performance/instrumentation/custom-instrumentation). From what can guess from the docs, it may be that thi...
After 1.17.0 (https://github.com/python-discord/bot/pull/2474) the profiles_sample_rate is a normal arg instead of in the experiments thing.
GitHub Actions run 4482794443 succeeded.
Connected!
I do quite like in-file constants for cog specific stuff, they're really easy to add/change, and only really make sense along with their usage anyway, so it's quite nice to have everything together for quick reference when writing code.
For durations the annoying thing is that it's hard to configure to use a shorter duration for testing in development (so you don't have to wait 45 days to see if it works :P). You have to change it and then change it back before commits.
Overall I don't ...
I will not correct the errors.
At least not now. Let's wait for the new Kubernetes setup. Scale already has to debug the mons not entering consensus, we don't need to debug YAML linter rules in addition to that.
For durations the annoying thing is that it's hard to configure to use a shorter duration for testing in development (so you don't have to wait 45 days to see if it works :P). You have to change it and then change it back before commits.
That is actually the only thing that I find annoying.
Let's leave them here then, it's not something we got to work on / change / test that frequently anyway.
For logging I think we usually use this style across the bot, https://blog.pilosus.org/posts/2020/01/24/python-f-strings-in-logging/ has some reasons and I think there's also potential security issues if you're passing untrusted input (not relevant in this case)
The docs suggest that the default value is 180 (https://discordpy.readthedocs.io/en/stable/interactions/api.html?highlight=discord ui view#discord.ui.View), and iirc it worked fine when I was testing.
I could have confused the sections I've read then. 180 seems fine indeed
The test failure looks interesting, seems to be here:
https://github.com/python-discord/bot/blob/395e058c52ebc718f7c0c9acec710c71f45d7b38/tests/_autospec.py#L53-L54
not surprising since it seems like that was intended to be a private method.
Maybe replacing it with pkgutil.resolve_name will fix it? (https://github.com/python/cpython/pull/18544)
Since this is the error handler I think it's alright to have a bit of extra safety. e,g, if we ever had a command that we did want to work in dms (like bm delete on lancebot).
The test failure looks interesting, seems to be here:
not surprising since it seems like that was intended to be a private method.
Maybe replacing it withpkgutil.resolve_namewill fix it? (python/cpython#18544)
I had actually forgotten about this PR.
I'll try to look into the option you proposed.
one oth...
ca8a7a6 add rule 10 to the list - shtlrs
9f22d57 Merge pull request #909 from shtlrs/add-rule-10 - ChrisLovering
147f21e Add Rule 10 for ChatGPT answers (#910) - brad90four
799efdf Update docs for upstream documentation change (... - jchristgit
96b9f89 Bump sentry-sdk from 1.16.0 to 1.17.0 (#903) - dependabot[bot]
We discussed this in the site meeting today and decided that due to the reasons Sebastiaan mentioned it's infeasible to implement this unfortunately.
Closing as the bot issue https://github.com/python-discord/bot/issues/658 was closed.
@MarkKoz do you still want to tackle this issue or would you prefer if someone else took it over?
https://www.pythondiscord.com/events/code-jams/8/ has the winners on the webpage, https://www.pythondiscord.com/events/code-jams/9/ has not. We should add it and make it clear that the code jam has finished.
@MarkKoz I'll gladly have a go at this if you decide to not do it yourself.
I updated the desktop screenshot.
A good place to add a new invite link might be on the border, central between the introduction and event cards and the who are we section, or a prominent button around the who are we section.
If you're keen to work on it, you're welcome to. However, I do recall having some strong opinions on how to approach this, so I'd like to try to stay in the loop. We should decide on a final schema design before implementation begins.
Hi @hedyhli, were you able to find some possible fix for mobile? If it's too much of a hassle I believe we should also just be able to skip adding the edit button on mobile outright, as it's probably much less used than on desktop.
Hi @doublevcodes, are you still interested in working on this? If not I would put this up for grabs :slightly_smiling_face:
@minalike mentions this is mostly solved, but having a link on the resources page to something setting the process in text may be a good idea.

(handcrafted in hours of work by mina)
f9dae3d Bump sentry-sdk from 1.16.0 to 1.17.0 (#2474) - dependabot[bot]
@HassanAbouelela do you know if we can action this issue somehow?
GitHub Actions run 4483829024 was cancelled.
Part of the issue is we use some redirects even within the main site, particularly in things like nav. Removing the redirects from static builds makes parts of the site non-functional.
Great words in markdown, thank you
Connected!
GitHub Actions run 4483871439 succeeded.
@Bluenix2 just so I understand it correctly: is this about having an endpoint that exposes the query parameter filtering support of site endpoints?
GitHub Actions run 4483878305 was cancelled.
Ok, it seems I missed the mark. Is this about exposing the filters in this dictionary? https://github.com/python-discord/site/blob/main/pydis_site/apps/resources/views/resources.py#L68
GitHub Actions run 4483887054 was cancelled.
GitHub Actions run 4483895302 succeeded.
Connected!
GitHub Actions run 4483903252 succeeded.
a81e3d6 Update mention of the partners channel - jchristgit
@n0Oo0Oo0b thank you for your suggestion. Could you clarify how this would differ from the documentation on this topic by discord.py itself? We don't want to duplicate information on the site that may run out of date as discord.py itself update.
Connected!
@Robin5605 @Bluenix2 would either of you like to take over this PR?
Connected!
GitHub Actions run 4483958385 was cancelled.
Connected!
71208aa Add a README for the events app - jchristgit
GitHub Actions run 4484327829 succeeded.
Sure thing.
I have some questions that come off the bat
It may be redundant since the status could be determined by doing a query for the most recent action. Furthermore, an expired infraction could be determined by comparing expired_at to the current time. However, in both cases, using the status field is faster and more convenient.
Why would we query the most recent action here ? Wouldn't it depend also on the type of action executing ?
Meaning, if I mute someone, the mute inf...
Why would we query the most recent action here ? Wouldn't it depend also on the type of action executing ?
Yes. What I likely meant is to query for the most recent action filtered by type. To check if an infraction is active, we can query for actions filtered by that infraction's ID and by action types that would affect the status. For example, if we just queried the most recent action, we may get an action for editing the description, and we'd be unable to deduce the status. Thus, we'd ...
The test failure looks interesting, seems to be here:
not surprising since it seems like that was intended to be a private method.
Maybe replacing it with
pkgutil.resolve_namewill fix it? (python/cpython#18544)
Yeah, this is intended to be like [this](https://github.com/python/cpython/blob/3.11/Lib/unittest/...
The most flexible system would be statically defined sets of configurations
I agree, and we want to leave the door open for that in the future.
Different binaries would require different configurations, be that resources, mounts, or permissions.
This is true, but not always. It is feasible for a single NsJail config to support multiple binaries (though it can only have one default entry point I think).
We'd need to define the python versions statically somewhere at any rate...
Hi, thanks for the feature request, and the offer to implement it! I'm not familiar with what the security implications are for allowing access to its own process. I have several questions regarding this request.
First, what uses cases are we supporting by allowing access to this? If we're going to be making the default sandbox less strict, we need to have good reason to take on the potential risk. We're aiming to provide a sandbox with sane, secure defaults. Bear in mind that it is possib...
It is feasible for a single NsJail config to support multiple binaries (though it can only have one default entry point I think).
This is true, but we can probably just avoid defining a default entry point in the first place. That's more or less what this PR does for python.
It seems simpler and more intuitive to create an NsJail config, which effectively defines an environment, and have everything in that environment be available via the API.
My problem is it moves the burden of...
GitHub Actions run 4488506639 succeeded.
Let me start off by explictly saying that I think an expires_at column is also needed for the actions table.
The current timestamp column should only state when the action was executed for historical purposes, and we obviously need to record the nex expiration date, if provided.
We could also add a jump_url like we currently have for infractions, in case someone needs more context on what happened, etc.
In retrospect, we likely need the status column anyway for use in indices.
...
Very well done. The main bulk of my gripes is the underselling of the py launcher. I feel like that should be the way we tell new users to use Python on Windows. Especially if people plan on having multiple different versions of Python on their rig.
I would say that using the py launcher should be the first recommendation. Managing the aliases isn't necessary if you stick with using it. I'd say change the section a little where using py is the default recommendation, and another header saying "If you still want to using python instead of py
As above, the usage of py -m pip install can be both helpful and important. If there is an issue with the PATH or other factors, python and pip may point to different versions. Using py -m pip install guarantees that whatever you pip install will go into that py version.
I would highly recommend NOT adding python to PATH. The py launcher handles most if not all of that pathing. This will also prevent potential issues if you have multiple different versions of Python installed on your machine.
As above, I recommend not adding to PATH.
Again, py launcher can help rectify some of this, including running some even when \Scripts isn't in the path. For example if you py -m pip install black, then try to just do black it may not work. But if you do py -m black it should.
General commands like `py`, `pip` and `python` should be run in your computer's normal terminal, that is, directly in
Possibly add pdm to the list as that one has been growing in popularity. https://pdm.fming.dev/
@ionite34 Barney Gale has just merged #100282!
Create a temporary directory to manage our resource tests instead of reyling on pyfakefs to mock it away for us. This also makes the code more portable: all we need now is a way to create a temporary directory. pathlib mostly abstracts away the other parts for us. Since we're well-behaved, we clean up the temporary directory at the end of the Python interpreter's life using atexit and shutil.rmtree.
This PR was written and tested with Python 3.9 which required some hacks in `pyprojec...
GitHub Actions run 4495115542 succeeded.
If this is alive again I'll try to stay in the loop as well. Either way please check with me before starting to work on this so I can make sure the plans address the needs of the mod team.
I'm still reading, but before anything I'd like to put aside the matter of voiding. It's a new type of action that requires separate discussion (it was discussed several times in the past and has been a bit controversial), and seems out of scope for this redesign. With the right design, adding a new type of action should be fairly simple anyway.
A few questions that come up to me while looking at the schema:
- When the bot queries an infraction, will it automatically get all of the actions? in the current design, without changing the serializer the bot would need to query once for the infraction, and a second time for the infraction actions.
- How do you know the order of the actions? do you need to sort by timestamp in either the site or the bot?
To address both of these it might make sense to have an array field in the infract...
GitHub Actions run 4497541997 succeeded.
- When the bot queries an infraction, will it automatically get all of the actions? in the current design, without changing the serializer the bot would need to query once for the infraction, and a second time for the infraction actions.
That actually just depends on what we want to do, it's a matter of changing the serializer here. I imagined it'll only query the infraction, and each infraction that has gone through edits will have a flag saying it did. And then we can just query all th...
it's a matter of changing the serializer
It can be a matter of changing the serializer, I was wondering if we could do it differently. But alright, I understand your answer.
The values that have been edited will be clear in the row (it's either reason or expiration date anyways) since the ones that didn't will be null
This doesn't align with the example you gave afterwards. In the example each action contains the reason and expiration so far, rather than the new values th...
This doesn't align with the example you gave afterwards. In the example each action contains the reason and expiration so far, rather than the new values they were changed to. Meaning that if you didn't edit the reason, then the action will contain the reason of the previous action.
Forgive me, but I'm not sure how you're seeing that.
Here's the action table
| Action | Actor | Reason | Expiration | Timestamp |
|---|---|---|---|---|
| create | shtlrs | reason1 | exp... |
Ok, looks like I mixed up the table of actions and the table after that which showed the infraction after the corresponding action. Forget most of what I said.
But we're going back to the reason why I said we can't use this approach: A null expiration already has a meaning. It means the infraction was made permanent. So in the table in your latest comment, the third row is invalid.
It's only null in the actions table, which has no influence on the expiration date in the infractions table.
It's null just to say that it hasn't changed.
Maybe it's a poor value that I've chosen , as a permanent infraction has a null value and then we won't distinguish between both.
Yes, that's the problem. You can't distinguish between a non-edit and an edit to permanent that way.
And it does have an effect on the infractions table, if what you send from the bot is a POST request of a new action.
And it does have an effect on the infractions table, if what you send from the bot is a POST request of a new action.
Can you elaborate?
I was mostly thinking of a trigger at the db level upon insertion / update to the infraction table.
GitHub Actions run 4503253276 succeeded.
GitHub Actions run 4503750530 succeeded.
It should be done by adding reverse_sql="ALTER TABLE api_filter DROP CONSTRAINT unique_filters" kwarg to the RunSQL instance.
The reason I'm asking this is because when testing locally, and then wanting to move to a different branch to test something else, you'll need to apply migrations up until some version prior to yours, which will result in a
django.db.migrations.exceptions.IrreversibleError
This is ok to happen locally, as you can always drop the container & spin up a new ...
Does this still apply if we fix #681 ?
The follwing are highlights of the different approaches Zig and I had discussed, which started [here](#dev-contrib message).
@mbaruh will correct me if i'm wrong on any of these points.
Having null values in the actions table isn't a good idea. As that leads to a loss of context/meaning. Example: We make a permanent infraction, we make it non permanent (we set the value for expiration_date), and then make it permanent a...
Can you elaborate?
I was mostly thinking of a trigger at the db level upon insertion / update to the infraction table.
We also discussed this in chat, and seemed to agree that it'll be more natural to do something like editing and deactivation by POSTing a new action, which will make the site make the right change in the infractions table.
I also see that the topic of whether to use an ID as the primary key in the actions table, or some combination such as infraction ID and timestamp.
One thing I envisioned we would be able to do with these changes is to resend an earlier version of the infraction. For example, if we added internal context to the infraction reason, we would be able to use !infraction resend to resend the original reason without the added context, by specifying the action which created the desirable version...
Connected!
GitHub Actions run 4507709024 succeeded.
It would definitely resolve the issue in the short term, but we'd encounter the same issue in the future if we change other links.
I am gonna go with prefix-based commands because the name explains the usage better than text command. As slash commands are also text commands.
I am currently just adding app_commands.Group and leaving app_commands.ContextMenu.
GitHub Actions run 4509537945 succeeded.
GitHub Actions run 4510441867 succeeded.
GitHub Actions run 4510753598 succeeded.
Currently when executing !help tag it returns query not found.

It should return something similar to what it returns for prefix based commands.

You should remain consistent here, as you're including the app_command namespace in this incrementation of stats, but not in the previous.
slash_cmd.qualified_name
It would look much better with that extra letter.
I personally would have chosen slash_command.
Abbreviations like these don't really add much value since the name itself is quite shore, and making it as explicit as possible is always better
The namespace isn't quite right here.
errors is imported from discord.ext.commands
and TransformerError is found in discord.app_commands.errors
I'm not sure if it's that important as I myself have never played that much with stats.
This shouldn't raise BadArgument anymore since it's no longer a text command. Instead, it should throw TransformerEroor otherwise it won't be caugh in the error handler you've added
Then you'd leverage the value that failed to be converted and also what type it was supposed to be converted at, which should be SourceType
There's a difference between the technical & the functional terms, even though you're stating the correct technical term, it's not guaranteed that people would recognize it.
When people use the commands, they don't know it as "prefix-based" commands. A slash command is a slash command (even though technically they're based on interactions), and the prefix based command is just "command", or "text command" (even though they're based on the command prefix)
It's fine to leave it is now, b...
FYI that would result in flake8 saying line character limit reached 122 > 120.
names += [
slash_cmd.qualified_name
for slash_cmd in interaction.client.tree.get_commands()
if not isinstance(slash_cmd, app_commands.ContextMenu)
]
It would be handled by the error handler because any error raised in the transformer raises TransformerError. The reason I did this was because I wanted to pass the error message to the error handler through the cause dunder. Rasining TransformerError will only add complexity as you can't pass your own custom error message to it.
Will be removed, thanks for reminding.
I also don't know much about the namespace, are you sure?
e.original is only present for app_commands.CommandInvokeError iirc. Also the cause is the original statement that caused the error, eg:
# this happens internally somewhere(not in a transformer or a command)
raise ValueError("a is smaller than b")
The cause will be returned as "a is smaller than b".
The only times it retuns None is when you explicitly raise an app_command error.
Oh, I added the app prefix because then it will overshadow the command_invoke_error used somewhere in the error handler.
First, what uses cases are we supporting by allowing access to this? If we're going to be making the default sandbox less strict, we need to have good reason to take on the potential risk. We're aiming to provide a sandbox with sane, secure defaults. Bear in mind that it is possible to use a custom config for one's own snekbox instance.
The main use case of this (and really all that it would allow it to do) would be to allow a process to dynamically access/analyze information about itsel...
GitHub Actions run 4513587749 succeeded.
(BASE_PATH / "_info.yml").write_text(CATEGORY_INFO)
potentially neater to let pathlib handle putting these together, although not sure it actually makes a different so should be fine as is.
Why not put this atexit register right after the directory is created. This would ensure it is run only once, and also run even if the tests weren't run for some reason (e.g. selectively running tests possibly?).
Alternatively it may make more sense to move the tempdir to the test setup function, so it is only called when the tests are run. (could also use a tempfile.TemporaryDirectory which has a cleanup method instead of needing to rmtree but should be the same so doesn't matter).
Connected!
GitHub Actions run 4513807229 succeeded.
Connected!
Connected!
GitHub Actions run 4513845754 succeeded.
Connected!
GitHub Actions run 4513886910 succeeded.
In that case, I would go for app_command
it looks like show_tag isn't used anywhere, can we remove it then ?
Sentry Issue: BOT-3EZ
Forbidden: 403 Forbidden (error code: 90001): Reaction blocked
(2 additional frame(s) were not displayed)
...
File "bot/decorators.py", line 143, in inner
) -> None:
File "bot/exts/utils/snekbox/_cog.py", line 583, in eval_command
await self.run_job(ctx, job)
File "bot/exts/utils/snekbox/_cog.py", line 541, in run_job
job = await self.continue_job(ctx, response, job....
Can reproduce by
- Sending an eval command
- Blocking the bot
- Editing the eval message
The bot tries to add the redo emoji but it can't because it's blocked.
There are probably other cases in the bot with this issue. Not sure if there are any other actions that can fail due to being blocked.
I think you're probably correct that it shouldn't ever be None with the current code. I mainly put the check there because it's more obviously correct since self.message has the type Message | None, and it doesn't do any harm to check.
Sure sure, which is why I said that I was only curious to know. Not that there's an issue with the way it is or anything
GitHub Actions run 4514460891 succeeded.
Oh, I didn't know that the command would be enclosed with `TransformerError.
Yeah TransformerError doesn't allow you to do that much, even though you could bend around it by passing the error messafe to the opt_type parameter.
I just don't like the fact that we'd be throwing a test command error from a slash one.
It's fine to leave it as error. or now
I don't know if theres a better way maybe we can raise ValueError instead?
Sure, I was referring to the case when we'd raise an app command error explicitly. As I said before, I don't like raising a TextCommand error from within a slash command context
The cause should be present when an exception if raised from another.
try:
raise ValueError("initial")
except ValueError as e:
raise KeyError("second") from e
when you catch that later,
try:
...
except KeyError as e:
print(e.__cause__)
# this will print: initi...
Honestly I wonder if we should bother addressing it. It's a very unlikely scenario chosen by the user, we could technically just ignore this
Oh sorry for that, it got mixed up when i changed to code to try exception related stuff
I don't think app command errors are meant to be raised explicitly, I maybe wrong.
Sorry, I don't understand the second part of your comment. Can you elaborate?
Since it causes an error I think it's worth handling. It causes a message to be sent in the channel saying that it's unexpected behaviour and to let us know, and sends a sentry alert, neither of which are ideal.
The handling should be simple, possibly just exiting the function if the error is raised.
cc36306 Improve wording in botstrap error - wookie184
Added a missing space at the start of a new sentence, and removed "likewise" as it's not the correct word in this context. Happy to bikeshed!
GitHub Actions run 4514916145 succeeded.
Minor optional suggestion: Parts about the env files that say "set <name> to <val>" could be just "set <name>=<val>", which allows for easy copy pasting. Here's an example place: https://github.com/python-discord/site/pull/885/files#diff-16c8836a056b70e4f7b983c19a7bedb018065fe3d424539b2ce29fcaf55d4ebeR172
Traceback (most recent call last):
...
File "C:\Users\wookie\Documents\GitHub\bot\botstrap.py", line 158, in
webhook_channel_id = int(all_channels[webhook_name])
KeyError: 'big_brother'
Not worked out exactly what this is yet, although we should probably handle it and raise a clearer error/warning. fwiw this was me trying to run botstrap on my old test server, but I decided to just make a new one and it worked perfectly :D
It's not 100% backwards compatible with old severs.
It's included in the guide that the server needs to comply exactly with the template that we have set up, otherwise matching will not work.
I agree on the clearer error though. Do you want to do it, or do you want me to take care of it ?
This error is, in part, a usage error. The bootstrap script is not intended to support old or random configurations, but to work from well-defined states. Itโs trading off the maximum possible utility, with simplifying the program greatly.
To that end, I went through and manually updated the staff test server to make it fully compatible, and updated the template to make sure it works as expected. Weโre also currently working on adding a sort of migration system to make sure you always have...
Hmm yeah the message is an issue. The alert can be suppressed
re https://github.com/python-discord/site/issues/752#issuecomment-1482122887
After some more conversation it might make more sense to go with option 3. It will give us more control over the information and make migrations saner.
8815799 Register cleanup job after module load - jchristgit
This is a good shout. I have implemented it in 88157999.
As for having the tempdir in the test setup function, I do think it's a good idea, but it would require a larger refactoring due to the places BASE_PATH is referenced.
I'm fine with the new looks of it.
I would, when the guide is finished, add a reference to it maybe.
Thank you !
GitHub Actions run 4515658689 succeeded.
GitHub Actions run 4515801023 failed.
Let's go with raising a ValueError, which will then become TransformerError, and catch it here
At least one of our unit tests in the content apps seems to make requests to GitHub while it runs. When running multiple times, for instance when retrying tests after issues, this will cause 403 errors to appear. This also affects CI pipelines: https://github.com/python-discord/site/actions/runs/4515801023/jobs/7953504322?pr=916
When ratelimited, two other tests, will also log some form of "Could not find GitHub repository metadata from response!".
We should ideally mock away these HTTP req...
GitHub Actions run 4518982501 succeeded.
I have also added unit tests for error handler so someone in future doesn't break them, or if they they will get notified.
Netlify broke for some reason and after reviewing the diff it does not seem related. Merging.
This defaults site_paste to our production pastebin as i don't think no one will ever host their own pastebin service. And this moves it to BaseURLs
Same goes for site_logs_view, however this one can be overriden if people want to access logs from their local sites. So it'll be included in the guide as an optional section to work with mod logs.
After the previously mentioned changes, site and site_schema aren't needed anymore, so need for the useless config.
site_staff isn'...
GitHub Actions run 4519507585 succeeded.
IMO the name was clear before so renaming it is unnecessary and will only cause conflicts.
How will it cause conflicts?
The reason I changed it is because when I was renaming the url value assigned to ''site_api'', this one got impacted as well and that's because it doesn't reflect exactly what it does since we clearly have different definitions of whay site_api is.
Plus, it's only a suffix I've added that reflects the class it's representing.
1385060 Make the unique constraint reversible - mbaruh
I added it anyway, it can't hurt 1385060
However if you need to switch to another branch then I'm not sure if some of the other migrations are reversible. I use a separate clone for this project.
GitHub Actions run 4519895144 succeeded.
GitHub Actions run 4520470138 succeeded.
I was referring to all the filter migrations, but I don't think this'll ever be a concern.
Thanks for doing this already, and i think it's fine to skip the rest.
GitHub Actions run 4520652042 succeeded.
GitHub Actions run 4521323119 succeeded.
efca729 Bump markdown from 3.4.1 to 3.4.2 - dependabot[bot]
bce57fa Merge pull request #915 from python-discord/dep... - jchristgit
23b920e Bump flake8-bugbear from 23.3.12 to 23.3.23 - dependabot[bot]
c71769b Merge pull request #917 from python-discord/dep... - jchristgit
2088911 Bump markdown from 3.4.2 to 3.4.3 - dependabot[bot]
GitHub Actions run 4521557853 succeeded.
GitHub Actions run 4522085386 failed.
In programming, there are two types of operations: "out of place" operations create a new object, leaving the original object unchanged. "in place" operations modify the original object without creating a new one, and return `None` explicitly.
LGTM, tested and seems to work.
Two test warnings are raised due to this:
bot-hu2rt1Uv-py3.11\Lib\site-packages\feedparser\encodings.py:29: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
import cgi
The issue tracking that is https://github.com/kurtmckee/feedparser/issues/330, it seems it was already fixed (https://github.com/kurtmckee/feedparser/commit/ed8c762286aa1d8a248a6900190bd02c01ac2f8d) and is just waiting on a release.
bot-hu2rt...
For reference, this is currently stalled by #1223.
0f40b11 Rename additional_field to additional_settings - mbaruh
caf6bd4 Rename additional_field to additional_settings - mbaruh
GitHub Actions run 4529174185 succeeded.
GitHub Actions run 4529177819 succeeded.
GitHub Actions run 4529181359 failed.
I wish I could put it in the modal, but the lengths of everything are pretty limiting. The title and any labels are up to 45 chars, placeholder strings are up to 100. I can make the description the default value but then people will need to delete it every time they want to input a value, which seems bad. I'll see if I can come up with something decent.
So this is how it looks like when I only display overrides:

Like I mentioned, it feels like it makes editing more difficult, since you don't know at first glance what it is that needs to be overridden. To do that you will also need to pull up the filter list defaults embed, but then the whole process takes even more space.
This is what happens when I ignore all false-y v...
GitHub Actions run 4534479844 succeeded.
The Problem
The MAX_OUTPUT_BLOCK_LINES variable is set to a value of 10, which means under the current logic evals which output more than 10 lines, will be uploaded to the haste site (paste.pydis.com) and a message will be added to the eval output stating it was truncated.
However, since we currently updat...
GitHub Actions run 4536844447 succeeded.
GitHub Actions run 4536834288 succeeded.
GitHub Actions run 4536852872 succeeded.
GitHub Actions run 4536854043 succeeded.
GitHub Actions run 4537185976 succeeded.
GitHub Actions run 4537218785 succeeded.
GitHub Actions run 4537513765 failed.
Currently after a vote is completed an embed gets sent to the log channel #nomination-voting-archive.
We can add a jump link to the embed linking to the archived discussion thread in #nomination-voting.
Reason: jump links are good.
To be precise, it has to be a jump link. Channel mentions can be funky for closed/uncached threads.

Currently when an infraction edit is logged the jump URL field is not mentioned.
I think it would be helpful to have it mentioned even on edit logs. I frequently check #mod-log after appending or editing an infraction and find myself looking for the jump link.
Hmm, I don't think some settings being missing for the falsey example is too confusing, but lets leave this for now. We can always change things once we have more experience with it in use.
Played around with this some more and didn't notice anything urgent. Very good!!!
The changes since my last review look good, and the bot side works, so this seems good, thanks!
@HassanAbouelela did you mean that we shouldn't do anything at all, or that we shouldn't try and handle the case fully (e.g. making the channel if it doesn't exist)?
I agree it's a usage error and we shouldn't try handle the case fully. I think the specific error was because I didn't have a channel with the correct name, so here it would make sense to raise a warning like with other things, so it's clear that it's not working due to a user error rather than a script error.
I think it's of limited utility to try and handle/warn on this case, considering it mostly occurred due to migrating from a legacy server. Someone not following the guide at all and starting with a completely blank server would get a different error, and someone starting from the guide won't get an error, it's only this shrinking subset of migrating users that would experience the error.
We're best of exiting the program at this point anyway instead of warning and powering through since misc...
Ok, it seems I missed the mark. Is this about exposing the filters in this dictionary? https://github.com/python-discord/site/blob/main/pydis_site/apps/resources/views/resources.py#L68
Yeah I think that's the idea.
Currently if the !resources command is given an argument e.g. !resources web development, the link will filter the topic by web development (links to https://www.pythondiscord.com/resources/?topics=web-development). This would potentially allow fuzzy matching for topics...
There is quite a lot of code for the message relaying (in https://github.com/python-discord/bot/blob/main/bot/exts/moderation/watchchannels/_watchchannel.py), so there's some benefit in having it separate to avoid having one very large cog, maybe merging them could work though, having the QoL/util functions sounds like a good reason.
I think making it having an expiry was something that was brought up a while ago as a good idea, although it might be worth discussing it again so we're sure ...
GitHub Actions run 4548003425 failed.
Sorry, Im a little slow at seeing the reviews.
b835e07 Add a readme for the home app - jchristgit
This commit also moves the nested structures for models and views in the home app into a single module, as they were not split up as part of the subpackage, with the goal of making this a bit more overseeable.
Part of #674.
GitHub Actions run 4548415253 failed.
Thanks for entertaining all these changes! I know I've made a lot of comments ๐
Relevant Issues
Closes #1198.
Description
Replaced all instances of "with ctx.typing()" to "async with ctx.typing() to comply with discord.py's v2.0 changes.
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/contributing/contributing-gu...
GitHub Actions run 4549847341 succeeded.
While this works the result is no longer random for some inputs. Wouldn't something like this be better?
params["page"] = random.randint(1, min(total_pages, 500))
It seems like there's an APIError class that can be raised which is handled by the error handler. I think it would fit here.
GitHub Actions run 4550037078 failed.
Connected!
GitHub Actions run 4550740830 succeeded.
GitHub Actions run 4555989196 succeeded.
With https://github.com/python-discord/snekbox/pull/175 around the corner, and the recent config changes, I don't think updating this PR is worth the effort.
My problem is it moves the burden of knowing what binaries are available on the API from the project (which can reasonably control the matter) to the user (which can not directly affect it).
I don't necessarily see that as a problem. I've seen snekbox as primarily an internal service for which users build their own front ends. Thus, the users are in control of both, and they will be aware of what is available in the snekbox environment. It'd be a different story if the snekbox API was di...
GitHub Actions run 4556227754 succeeded.
Connected!
GitHub Actions run 4556333627 succeeded.
GitHub Actions run 4548415253 failed.
GitHub Actions run 4556574092 was cancelled.
GitHub Actions run 4556579946 succeeded.
Connected!
5a16319 Update base image to new repo org - ChrisLovering
GitHub Actions run 4556902119 succeeded.
Awesome! Thanks! King!
Connected!
GitHub Actions run 4557168097 succeeded.
GitHub Actions run 4557219427 succeeded.
Connected!
GitHub Actions run 4557851544 succeeded.
GitHub Actions run 4557912633 succeeded.
Connected!
GitHub Actions run 4558022385 succeeded.
Connected!
GitHub Actions run 4558043649 was cancelled.
65a28b1 Update base image to new repo org - ChrisLovering
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Did you:
- [ ] Join the Python Discord Community?
- [ ] Read all the comments in this template?
- [ ] Ensure there is an issue open, or link relevant discord discussions?
- [ ] Read and agree to the contributing guidelines?
Connected!
GitHub Actions run 4558054765 succeeded.
27265cc Update base image to new repo org (#1241) - ChrisLovering
Connected!
GitHub Actions run 4560864685 was cancelled.
GitHub Actions run 4560875102 succeeded.
9cb5fe9 Make new tag for #2360 - brodycritchlow
a0bfba5 Update in-place.md - brodycritchlow
27eb0f9 Update in-place.md - brodycritchlow
8b2573c Make explanation more concise, and informational - brodycritchlow
6bf8e98 Merge branch 'main' into inplace-tag - brodycritchlow
Connected!
The APIError exception (as per the docstring) is for when "an external API returns an error message". Since this isn't an error returned by the API, I didn't opt to use the exception.
If we do want to use it, what should the status_code argument be? 200? The error handling for it also seems pretty bare (doesn't actually use the .error_msg or .status_code).
GitHub Actions run 4562467075 succeeded.
35ec984 Allow .latex in python-help channel - matiaslagoevia
c8de15b whitelist a thread along with its parent - shtlrs
d81811e replace a thread with its parent if present - shtlrs
4b4b4bf Merge pull request #1231 from shtlrs/whitelist-... - shtlrs
b0a8bbd Merge branch 'main' into issue-1207 - shtlrs
GitHub Actions run 4562688885 succeeded.
Connected!
GitHub Actions run 4562690208 succeeded.
6ca77ac Add patreon role configuration - mathstrains21
a44e798 Create patreon.py and add setup - mathstrains21
526ce5f Merge branch 'python-discord:main' into patreon - mathstrains21
380dd5c Add patron message when someone gains a patron ... - mathstrains21
b38ec72 Merge branch 'patreon' of https://github.com/ma... - mathstrains21
It might be friendlier to catch key errors here with a message like "Couldn't find channel X, did you create the server with the provided template?"
After this line, all_channels should be updated to use the new channel ID, otherwise you get:

Also, why are you not passing the category ID here? you already wrote the function to take one.
GitHub Actions run 4563142014 succeeded.
Also I would personally put all of the client-dependent functions inside the client class, but it's more of an opinion.
guild_id: int | str,
rules_channel_id_: int | str,
announcements_channel_id_: int | str,
client: DiscordClient
) -> None:
channel_name_: str,
guild_id: str,
client: DiscordClient,
category_id_: int | None = None
GitHub Actions run 4563571937 succeeded.
The current wording makes it seem like "your own" refers to "responses" rather than "commands", which makes it difficult to read.
await interaction.response.send_message(
"You can only delete responses to your own command invocations!", ephemeral=True
)
Out of scope for this PR probably, but we do this check in various places in the codebase. I wonder if there should be a single function that does it to un-ugly-fy it.
We've discussed that in KeyError on webhooks when running botstrap #2488
.
That's mostly a usage error but I don't mind the idea of adding it.
GitHub Actions run 4564218294 failed.
It's been a while since this discussion was active but i really like the idea. I just tested everything but for me there seems to be a problem when snoozing a timer for the second time. I get the option to snooze again and when i click it I can also select for how long i want to snooze but then it says "This interaction failed". Did this happen to any of you as well?
EDIT: The problem seems to be that once the first reminder is finished and you click snooze the second reminder is aut...
ae3db03f95eb157db2c1c11787e7c1725d7883e6
GitHub Actions run 4564310301 failed.
Also I would personally put all of the client-dependent functions inside the client class, but it's more of an opinion.
Yeah it's better that way, it's just that the original design wasn't intended to have a client like this & drifted away (and my thoughts with it as well :P)
ae3db03f95eb157db2c1c11787e7c1725d7883e6
Also I would personally put all of the client-dependent functions inside the client class, but it's more of an opinion.
Yeah it's better that way, it's just that the original design wasn't intended to have a client like this & drifted away (and my thoughts with it as well :P)
ae3db03f95eb157db2c1c11787e7c1725d7883e6
The category wasn't created in the test server at first, and wasn't tracked.
Idk tbh, but here it is
e4903f80dc409d6ebee7170be8ee5e38c242d81d
01c2fc14631dff8f84a3695b788317ccb0d02030
a468aef Remove potential race condition - TizzySaurus
@henri-climber I did see a potential race-condition that could've caused it and have now fixed that, so maybe try again?
GitHub Actions run 4564348203 succeeded.
Adding this comment as a reminder to myself to fix this comment/timeout as is appropriate before this gets merged.
GitHub Actions run 4564367808 succeeded.
A few comments for consideration before this PR is merged.
The exact appropriate timeout for the drop-down menu is still up-for-debate.
Exact timeout for the Snooze Button is still up-for-debate. The comment will need to be adjusted accordingly (or simply removed).
This needs to be changed to correctly correspond to the Snooze Button and Snooze Selection timeouts.
We may want to change this approach since it does give the possibility of "missed" reminders (won't get sent until next cog load, potentially hours after it was supposed to be sent).
Exact snooze durations still up-for-debate.
SInce I added jump URL field to mod log embeds can I assign myself to this issue?
Would checking the error.code and ignoring when it's 90001 (reaction blocked) be an adequate solution to this? That way we prevent both the sentry alert and the message saying to contact staff (or can even send a custom message).
GitHub Actions run 4564652997 succeeded.
Can I please be assigned to this?
34f0dc1 Bump sentry-sdk from 1.17.0 to 1.18.0 (#2497) - dependabot[bot]
Connected!
GitHub Actions run 4565152522 failed.
It's definitely a usage error but we can still be nice :)
Also Hassan's comment was about this happening when migrating in old servers, which I didn't do: This issue is the result of trying to run it in a blank server.
It's definitely a usage error but we can still be nice :)
Sure, I like being nice :D
Running it in a blank server is also not how you're supposed to do it.
But again, it doesn't mind to add a small message saying that.
Ah, I was thinking of checking what category the channel is in and creating it there, but this works too. For some reason the template insists on placing the category at the bottom of the list, but it's probably ok.
How it originally looked (https://github.com/python-discord/bot/pull/2422):

How it looks now:

I assume the change happened in https://github.com/python-discord/bot/pull/2326. We should make it so the warning line has one space before and one after again.
Connected!
GitHub Actions run 4566920448 succeeded.
Yeah, possibly something that could go in bot-core. I'll leave it out of this PR though
I don't know why pycharm does this ...
I think this is a fine change, it improves clarity here. I don't think it's too big an issue either way.
Let's drop this scheme as well, and just move it directly into site_api.
How does b30475b1fbabbf970dfe1af4801152f70d917080 look ?
535c71f Add README for the redirects app - jchristgit
This is kept more minimal than the other apps, as it's mostly for backwards compatibility.
GitHub Actions run 4568979935 succeeded.
I think I would rather point to the contributing guide than to hardcode the template, but it's not a big deal.
If the server contains a forum channel it won't be in the template, so you can't assume this channel exists. The way it was before was fine IMO.
Euh, idk what happened here tbh.
Oui, i need to bring it back.
Good point, i will use that.
GitHub Actions run 4569249877 failed.
In general I would avoid renaming variables if not required because:
- It's not related to the PR (the name existed already), and slows down the PR if someone disagrees with the change.
- It causes merge conflicts with other PRs (I have one open I think).
- Variable names are personal preference, I prefer
site_apiwhich is why I used it when I wrote the code.
I don't think it improves clarity (site_api.get reads most fluently and clearly to me), so while I agree it's not a big issue...
GitHub Actions run 4569982365 succeeded.
It's not really a matter of personal opinion to me personally, more of a semantics thing.
But sure, it wasn't intentional to get here, it's just that refactoring the original site_api changed its value as well, which made me think that not having two same names for different things is worth changing.
I've reverted it here 153ca4a1b31024a170222a18e7f1c7772c6d258f
dace921097e56dc39d6643f384d1ca08befc9560
dace921097e56dc39d6643f384d1ca08befc9560
GitHub Actions run 4570071741 succeeded.
Sentry Issue: BOT-3F4
HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In name: Contains words not allowed for servers in Server Discovery.
File "bot/exts/fun/off_topic_names.py", line 66, in update_names
await channel_1.edit(name=OTN_FORMATTER.format(number=1, name=channel_1_name))
Unhandled exception in internal background task "update_names".
The blocked word was "swallow...
GitHub Actions run 4572038821 succeeded.
What do we actually want to happen when this occurs?
We can't prevent this from happening in the first place (the list of blocked words isn't public), so any action has to be reactive (i.e. try/except) as opposed to proactive (not allowing adding of the name to the pool).
I imagine a log.warn() stating that it attempted to rename but failed because the name "contains words not allowed for servers in Server Discovery", and then re-rolling would be sufficient?
All of that plus deactivating the blocked otn.
how we'd test the fix
We would artificially raise an exception (even with a temporary line inside the function)
There is previous discussion on this here: https://github.com/python-discord/bot/issues/2282
GitHub Actions run 4575696527 succeeded.
GitHub Actions run 4576171236 succeeded.
GitHub Actions run 4576708018 succeeded.
Connected!
Connected!
GitHub Actions run 4577152974 failed.
Looks good, one comment, but not required so feel free to merge ๐
I wonder if it would make sense to just have this as site or site_public (or similar) in BaseURLs with value https://pythondiscord.com, and then the endpoint can be specified in the place where it's used since that doesn't need to be configurable. With that we could use it for linking to the site for things other than logs in the future if we wanted.
GitHub Actions run 4579281490 succeeded.
Connected!
As discussed internally, this implements the self-assignment logic of the new helper role along with the applicant validation and the engagement assurance mechanic.
9cb5fe9 Make new tag for #2360 - brodycritchlow
a0bfba5 Update in-place.md - brodycritchlow
27eb0f9 Update in-place.md - brodycritchlow
8b2573c Make explanation more concise, and informational - brodycritchlow
6bf8e98 Merge branch 'main' into inplace-tag - brodycritchlow
GitHub Actions run 4580050698 succeeded.
LGTM, thanks Zig for this important streamlining of our processes.
I am truly excited for the new staff structure to be implemented. I greatly appreciate the incredible work you've done here, mbaruh. The code is immaculate. With the utmost certainty, I approve this pull request.
@Den4200 I am permanently offended that you did not acknowledge my contribution to this PR.
Connected!
4c55833 Make new helper role pingable for help request. - swfarnsworth
Previously, the message from the bot requesting that new helpers answer off-topic questions did not cause a ping. Solved by this commit.
9cb5fe9 Make new tag for #2360 - brodycritchlow
a0bfba5 Update in-place.md - brodycritchlow
27eb0f9 Update in-place.md - brodycritchlow
8b2573c Make explanation more concise, and informational - brodycritchlow
6bf8e98 Merge branch 'main' into inplace-tag - brodycritchlow
GitHub Actions run 4580324348 was cancelled.
GitHub Actions run 4580325456 failed.
GitHub Actions run 4580325456 failed.
GitHub Actions run 4580374646 failed.
0567cf9 Created new branch and script for Real Python s... - brad90four
11de6a3 Updated script to include ERR_EMBED - brad90four
617a64b Updated import statements for "from discord.ext... - brad90four
ea02a5f Updated line 30 to include "commands.cooldowns"... - brad90four
e528332 Updated JSON headers for "results" and "url" - brad90four
GitHub Actions run 4580386435 succeeded.
Finally! This will really help all those unanswered questions!!
Connected!
Relevant Issues
Update the color list to include the new helper yellow color.
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
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](https://pythondiscord.com...
GitHub Actions run 4580455499 succeeded.
0567cf9 Created new branch and script for Real Python s... - brad90four
11de6a3 Updated script to include ERR_EMBED - brad90four
617a64b Updated import statements for "from discord.ext... - brad90four
ea02a5f Updated line 30 to include "commands.cooldowns"... - brad90four
e528332 Updated JSON headers for "results" and "url" - brad90four
2f770ab Add lesser yellow to color list - brad90four
Relevant Issues
Add new helper role color to color list
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Did you:
- [ ] Join the Python Discord Community?
- [ ] Read all the comments in this template?
- [ ] Ensure there is an issue open, or link relevant discord discussions?
- [ ] Read and agree to the [contributing guidelines](https://pythondiscord.com/pages/contributing/con...
GitHub Actions run 4580492716 succeeded.
Please update to use more inclusive language.
All Helpers are created equal!!
Please update to use more inclusive language. All Helpers are created equal!!
This name was the most popular according to this [poll](#ot0-psvmโs-eternal-disapproval message)
Please update to use more inclusive language. All Helpers are created equal!!
This name was the most popular according to this [poll](#ot0-psvmโs-eternal-disapproval message)
I see.
I disagree, but I'll let this go through and then make a community issue about updating the language.
@shtlrs
For the indexes, would it be a good option to have 2
Did you mean that it doesn't make sense ? Since later on you state that keeping them separate is awkard.
In any case, this won't affect the main schema in the end, so we can start with the implementation once we agree on it then we can add necessary indexes for optimization.
Sorry, I quoted the wrong thing. I meant to quote the following:
I'm in favor of merging the active & void columns into a status one.
After some more conversation it might make more sense to go with option 3. It will give us more control over the information and make migrations saner.
I'm also in favour of option 3. I'm not totally against JSON, but it's something I'd have to give more thought to. Initial impression is that using JSON data can be an anti-pattern for relational database depending on how we need to use/query that data.
I'm assuming this new field will be a boolean field, e.g. is_permanent (if you ha...
The main use case of this (and really all that it would allow it to do) would be to allow a process to dynamically access/analyze information about itself.
Do you have any specific use cases in mind? How is a process being able to access information about itself useful?
the access could be limited to only certain parts of the /proc/[pid]/ directory if we want to be absolutely sure of safety/security
I'm more comfortable starting with this, and leaving the door open to expanding ...
One problem that is often mentioned with the Python Discord website is the slow
performance of endpoints, and the huge file structure that comes with cloning
the site causing problems on antiquated platforms such as Windows.
This pull request aims to fix it. The index page can now sustain up to 35731
requests per second on my machine. The confusing directory structure in
pydis_site is removed. As a bonus, virtual environments are no longer
required, as our new build tool manages dep...
GitHub Actions run 4582843591 failed.
Amazing work Johannes @jchristgit, approved !
I'm fine with the idea, it's just that we need to be picky about the names since they expand real quick to become confusing.
We had it at site before, and it got people & me [confused](#dev-better-config message) when it came to usage.
I agree with you on the fact that it makes sense to have a base url, and only that needs to be configurable, as I also didn't like having to configure that long url if i ever wanted to use s...
GitHub Actions run 4582913932 succeeded.
This is truly one of the pull requests of all time. I struggle to express the full extent of my feelings about this. No doubt, merging this will be a moment in history.
This code is very clear and well written, good job.
If we're moving towards making the site blazingly fast, we need to put in some safeguards.
# Ignore unwanted files
*.rs
Good idea putting production secrets in the source code, saves needing to mess with environment variables when deploying ๐ ๐ฏ
2dcfcc8 Update ping cooldown for helpers - brad90four
Change from a hardcoded 10 minutes, to a random interval between 10 and 30 minutes.
GitHub Actions run 4583464187 succeeded.
This is immaculate work.
Connected!
@mbaruh
All of that plus deactivating the blocked otn.
Do you mean deleting the blocked otn? It seems people were broadly against that in #2282, but not sure if that still applies.
We would artificially raise an exception (even with a temporary line inside the function)
Right, yeah. Idk why I didn't think of that ๐
GitHub Actions run 4584721641 succeeded.
Connected!
GitHub Actions run 4584840057 succeeded.
GitHub Actions run 4584855021 succeeded.
GitHub Actions run 4584878964 succeeded.
32b8f80 Ping help thread owner if thread closes without... - swfarnsworth
Add logic to see if anyone other than the OP (or bots) engaged in a help thread when it closes for inactivity. Currently only looks at the last 10 messages. If not, includes a ping to the OP before the embed in the closing message.
GitHub Actions run 4584904195 succeeded.
We might also have the message say "@OP it looks like your question wasn't answered. Try reading our guide on asking good questions."
6dda7a2 experiment - ruff changes needed to satisfy lik... - ChrisLovering
9cf1e01 experiment - ruff add flake8-return - ChrisLovering
1f93981 experiment - ruff add flake8-simplify - ChrisLovering
8731e34 experiment - ruff add pyupgrade - ChrisLovering
Thank you for the pull request!
Unfortunately, the core developer team currently does not have enough manpower on deck to review this in due time. We have therefore decided to close this. We hope you don't make 30 alt accounts and raid our server in these trying times.
@MarkKoz An alternative could be an expiry_edited field. It might be a bit redundant when the expiry is edited to a new date, but when the expiry is set to null, this field would then be true if the null means "permanent" or false if it was just not edited at all. But if we go with this direction it would probably be one of those three options, as awkward as they may be.
f077e35 Exclude help forum messages from the newlines f... - lxnn
Just a thought :P
The newlines filter is very noisy in the help forum. The frequent false-positives require a lot of moderator attention, and aren't a great experience for new users seeking help. Excluding messages in the help forum from the newline count might be a reasonable stopgap until the new filters arrive.
Relevant issue: #2009
GitHub Actions run 4586647563 failed.
GitHub Actions run 4586672773 succeeded.
e476876 Remove self-assignable helpers functionality - mbaruh
Didn't work out unfortunately.
GitHub Actions run 4586890068 succeeded.
Kudos to whoever came up with that idea
This really got me but last yearโs PEP was extremely well done!
Connected!
Minor optional suggestion: Parts about the env files that say "set
<name>to<val>" could be just "set<name>=<val>", which allows for easy copy pasting. Here's an example place: https://github.com/python-discord/site/pull/885/files#diff-16c8836a056b70e4f7b983c19a7bedb018065fe3d424539b2ce29fcaf55d4ebeR172
Like this? 0aea52cc5f1e480424d0056c7825f914f7baaa71
This code seems quite complex, given this is balancing quite a lot of different aims/constraints I think we'd benefit from having some tests for this.
I'm also not sure the complexity is really worth it, a simple solution that replaces the current logic and fixes the linked issue would be something like this:
def truncate(text, max_lines, max_chars):
# Make the truncation message
lines = text.split("\n")
reason = []
if len(text) > max_chars:
reason....
Deactivating a name sets a column in the database to indicate it as inactive, rather than fully removing it. Deactivated names can't be chosen as ot names. IIRC this feature was added to prevent a name being re-added if it was removed, and so it can still be looked at in the future if wanted (you can !otn list deactivated).
I'm not sure about a warning with log.warn, since it isn't something core devs can/should do anything about. I'd prefer a message in a mod channel somewhere (possib...
Would checking the
error.codeand ignoring when it's 90001 (reaction blocked) be an adequate solution to this? That way we prevent both the sentry alert and the message saying to contact staff (or can even send a custom message).If we're concerned about it suppressing other things we can always ensure we create a log message as part of the handling.
Were you thinking this would go in the global er...
Were you thinking this would go in the global error handler?
Yeah, that was the idea. If we're happy with this implementation then can I please be assigned?
Deactivating a name sets a column in the database to indicate it as inactive, rather than fully removing it.
Ah, I see. That sounds good then, yes.
I'm not sure about a warning with log.warn, since it isn't something core devs can/should do anything about. I'd prefer a message in a mod channel somewhere
Makes sense, I think a message to mod-meta for good visibility works in-place of a log.warn (given, as you said, the low frequency of occurrences it will have).
Can I please ...
fb93d55 Ensure FINAL output is within max_chars and tid... - TizzySaurus
@wookie184
- Never have more than max_chars characters in the final output
- Never have more than max_lines lines in the final output
- Have as many lines/chars as possible in the final output
For the record, none of these are fulfilled in the old code (that's currently in main). All three of these are fulfilled by my new code, so it does meet the necessary criteria.
This code seems quite complex
I've added some images showing before vs after for different scenarios to...
Looks & works great!
A couple of comments + small bugs were identified, will retest once addressed
Each filter has a set of settings that decide when it triggers (e.g. in which channels, which categories, etc.), and what happens if it does (e.g. delete the message).
Otherwise it'd give the impression that the channels are the only criteria
Are self.infraction_channel and ctx.channel mutually exclusive here ? If not, who should take precedence ?
Each filter has a set of settings that decide when it triggers (e.g. in which channels), and what happens if it does (e.g. delete the message, ping specific roles/users, etc.).
same here
description: ClassVar[dict[str, str]] = {
TXT_EMBED_DESCRIPTION doesn't have a placeholder for cmd_channel_mention
Connected!
GitHub Actions run 4596003748 succeeded.
GitHub Actions run 4596952605 succeeded.
Connected!
We might also have the message say "@op it looks like your question wasn't answered. Try reading our guide on asking good questions."
I think just pinging like you are now is fine, so long as the embed message is good. If we think the embed message can be improved/condensed then I'm for it.
message = closed_post.owner.mention
iadd isn't needed here since it's just the empty string anyway,
message.author.id async for message in closed_post.history(limit=100)
100 messages is the max that can be retrieved in 1 request. So we might as well do this to cover the case were the OP sent a lot of messages at the end of a session that does have other participants.
oldest_first=False is also the default if after isn't specified, so that can be removed.
I think the bot should still mute if a person sends multiple newline infractions in a row, this way people can't just spam in threads.
@mbaruh
but when the expiry is set to null, this field would then be true if the null means "permanent" or false if it was just not edited at all.
I'm not sure I follow what you mean by if the null means "permanent" here, isn't that what null always signifies for an expiry ?
How would this work when the expiry changes, but to a valide date time ? It would be confusing for it to be true since that's the value we'd use for permanent infraction changes as well if I understood y...
GitHub Actions run 4604468060 succeeded.
GitHub Actions run 4604472133 succeeded.
GitHub Actions run 4604480252 succeeded.
GitHub Actions run 4606946127 succeeded.
Connected!
GitHub Actions run 4609324396 succeeded.
a5fdbca experiment - ruff add flake8-datetimez - ChrisLovering
434c592 experiment - ruff re-enable UP017 - ChrisLovering
ctx.channel will be used for a special value in self.infraction_channel (0), which is described in !filter setting infraction_channel.
Because the class doesn't count as abstract unless it has at least one abstract method, even if it inherits from ABC.
I agree that we should up the limit to 100 if we can get all of that in one request, though I think that keeping oldest_first=False is worth it for self-documentation purposes.
GitHub Actions run 4613489931 succeeded.
9cb5fe9 Make new tag for #2360 - brodycritchlow
a0bfba5 Update in-place.md - brodycritchlow
27eb0f9 Update in-place.md - brodycritchlow
8b2573c Make explanation more concise, and informational - brodycritchlow
6bf8e98 Merge branch 'main' into inplace-tag - brodycritchlow
GitHub Actions run 4613540242 succeeded.
I added a clarifying comment in Code style and clarifications
I think I'll leave it for now. 99% of the time it will be the user having DMs off.
Do you have any specific use cases in mind? How is a process being able to access information about itself useful?
It's the most useful thing, in that almost everything you could do using it you could do via similar already allowed means, but there are some things like /proc/[pid]/fd/ and /proc/[pid]/fdinfo/ which are not only benign but provide information which is hard to find elsewhere.
I'm more comfortable starting with this, and leaving the door open to expanding it in the f...
GitHub Actions run 4615397591 succeeded.
Okay, sounds good to me.
GitHub Actions run 4617733219 succeeded.
One more for extra luck ๐
The !resources command accepts an optional argument to specify the resource topic in the URL. For example, !resources data science will result in the following link: https://www.pythondiscord.com/resources/?topics=data-science
However, there is no difference in the embed (other than the hyperlink itself) to indicate that a topic has been specified. I propose that when a topic is specified, it will be added to the title of the embed, like "Resources for: Data science".
(I would l...
The resources command currently does no validation for the given argument. There is this new issue https://github.com/python-discord/bot/issues/2510, which I think is very reasonable, but I would rather the bot didn't spit back arbitrary strings given by the user (both for the correctness of the provided URL and from a moderation perspective). I think that's already a solid use case for this feature.
Connected!
069ec37 Bump sentry-sdk from 1.18.0 to 1.19.0 (#930) - dependabot[bot]
4843cb8 Bump pre-commit from 3.2.1 to 3.2.2 (#2509) - dependabot[bot]
3db54ef Bump psycopg2-binary from 2.9.5 to 2.9.6 (#46) - dependabot[bot]
GitHub Actions run 4621967762 succeeded.
GitHub Actions run 4621967411 succeeded.
GitHub Actions run 4621967516 succeeded.
Connected!
GitHub Actions run 4621976213 succeeded.
3ccff86 Bump sentry-sdk from 1.18.0 to 1.19.1 (#2511) - dependabot[bot]
3f02156 Bump pre-commit from 3.2.1 to 3.2.2 (#929) - dependabot[bot]
Connected!
GitHub Actions run 4622023119 failed.
GitHub Actions run 4622021486 succeeded.
GitHub Actions run 4622026319 succeeded.
GitHub Actions run 4623281654 was cancelled.
GitHub Actions run 4625910849 succeeded.
b7c41a0 Include jump URL in mod log embed for infractio... - vivekashok1221
GitHub Actions run 4626799784 succeeded.
394b334 Bump sentry-sdk from 1.19.0 to 1.19.1 (#931) - dependabot[bot]
GitHub Actions run 4627035490 was cancelled.
2022f7b Bump rapidfuzz from 2.13.7 to 2.15.0 (#2507) - dependabot[bot]
b121553 Bump alembic from 1.9.4 to 1.10.2 (#45) - dependabot[bot]
GitHub Actions run 4627091301 succeeded.
GitHub Actions run 4627101810 succeeded.
GitHub Actions run 4627102042 succeeded.
Connected!
5d8b5d8 build(deps): bump pydantic from 1.10.5 to 1.10.... - dependabot[bot]
71af74d Bump pydis-core from 9.4.1 to 9.5.1 (#42) - dependabot[bot]
GitHub Actions run 4627769922 succeeded.
GitHub Actions run 4628754084 succeeded.
Hey @Ibrahim2750mi, I'm sorry this took a while.
Here's a couple of things I noticed
- It currently have duplicates for some command groups, like infractions


The second & third options point to the same command group.
- We don't have autocomplete for subcomman...
GitHub Actions run 4629149986 succeeded.
GitHub Actions run 4629220350 succeeded.
It's looking good, I just have one comment before I submit a formal review:
When I edit an infraction twice, first in a moderators, then in a ModMail channel, I lose context to the first edit.
Which raises 2 questions:
- Is that something that has happened before ? (Even if it didn't, it can still )
- Do we want to cover that ?
Very preliminary few notes
GitHub Actions run 4630994917 succeeded.
Connected!
c91bbcc Fix contents and descriptions being too long fo... - mbaruh
GitHub Actions run 4630994142 failed.
GitHub Actions run 4631094108 succeeded.



