[python-discord/bot] branch deleted: fix\_filters
#dev-log
1 messages ยท Page 11 of 1
GitHub Actions run 4631333290 succeeded.
Connected!
1ae485f Temporarily disable help post name check - mbaruh
[python-discord/bot] New branch created: disable\_name\_check
This doesn't work at the moment with the new filtering and a proper fix will be made later
GitHub Actions run 4631453619 succeeded.
Connected!
71a386f Change the infractions button emoji to a notepad - mbaruh
[python-discord/bot] New branch created: infr\_emoji
[python-discord/bot] Checks Successful on PR: #2516 Change the infractions button emoji to a notepad
GitHub Actions run 4633130956 succeeded.
One thing to know is that the bot relies on precisely **two** configuration files to work.
Unresolving since the comment is still relevant.
You have this part:
https://github.com/python-discord/site/blob/493ab3c7381ba89f640b7b53d2d0d96bf8944dbf/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md?plain=1#L69-L78
And then you have this part:
https://github.com/python-discord/site/blob/493ab3c7381ba89f640b7b53d2d0d96bf8944dbf/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md?plain=1#L194-L196
The second part is not up to date, t...
[python-discord/bot] branch deleted: infr\_emoji
Connected!
4eedb972d4712082b9a2e381ea728a4fd59ed445
GitHub Actions run 4633385515 succeeded.
1. Make sure you have [Python 3.11](https://www.python.org/downloads/) installed. It helps if it is your system's default Python version.
To configure the bot manually, you will **only** need to set inside the `.env.server` file the values for the channels, roles, categories, etc.
that are used by the component you are developing.
Easier to read
This is still relevant. The instruction about fakeredis can be moved under
https://github.com/python-discord/site/blob/4eedb972d4712082b9a2e381ea728a4fd59ed445/pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md?plain=1#L217
GitHub Actions run 4633729741 succeeded.
Connected!
By context you mean the jump URL, right?
Through this PR, jump URL to the edit context is displayed in the edit log embed- but it is not stored in the database. When you use the !infraction search, only the original context is displayed. The assumption is that the context is more likely to be present where the infraction was originally invoked (although if any offending messages are deleted then :shrug: ).
As of now, there is no indication in the !infraction search embed that the inf...
I'm not sure what issue is being solved by having the ... in different places. Is this solving something that has been an issue in reality? If you want to know what was truncated you can just look at the full output in the pastebin.
Requiring two lines (... and then (truncated ...)) takes up more space to indicate the same thing, and I think it's also a bit confusing not to have the truncation indicated in a consistent way.
Also, I think the truncated text should be included in th...
Connected!
[python-discord/bot] New branch created: thread\_filter
- Adds thread name filtering
- Fixes a bug in nickanme filter actioning
- Adds handling of post deletion in the filtering system.
GitHub Actions run 4635329389 succeeded.
GitHub Actions run 4635846442 succeeded.
GitHub Actions run 4638328904 succeeded.
This is a non-tested approval, but is continuing the filtering work underway.
GitHub Actions run 4639490732 succeeded.
Note that this PR also changes the opening embed to ping the OP with a warning about pip installing malware.

This image just shows what it looks like; the text now reads "Do not pip install anything that isn't related to your question, especially if asked to over DMs."
GitHub Actions run 4639618051 succeeded.
I feel like you should also mention how you can set your own custom bot prefix in .env.server.
edit: Assuming that's how you intend it to be set.
[python-discord/bot] New branch created: fix\_modlog
I'm not sure how this happened, but I didn't move the function correctly from the modlog cog.
GitHub Actions run 4639725025 succeeded.
LGTM. Thanks for this blazing ๐ฅ fast ๐ PR!
5609f4c Handle invalid off-topic channel names and the ... - TizzySaurus
[python-discord/bot] New branch created: fix\-2500
Related Issues
Closes #2282
Closes #2500
What
This PR adds re-roll logic for when attempting to rename an off-topic channel to a name that's not allowed for servers in Server Discovery (such as ot0-welcome-and-fuck-you).
It will attempt to reroll a maximum of MAX_RENAME_ATTEMPTS per off-topic channel, and will send a message detailing any failed renames for a given off-topic channel to the internal mod-meta channel.
The code also deactivates names that are invalid, t...
GitHub Actions run 4640041918 succeeded.
Connected!
GitHub Actions run 4640229043 failed.
While we're at it, /dev/fd/, /dev/stdout, /dev/stdin, /dev/stderr, /dev/null, /dev/full, and /dev/zero would be nice additions as well.
These all sound fine. And /dev/fd/ is really just /proc/self/fd/, right?
/proc/[pid]/fd/ and /proc/[pid]/fdinfo/
On second thought, wouldn't this allow one eval to access another eval's file descriptors? We do create a PID namespace with nsjail. I wonder if when we mount /proc, we can do it in a way such that it only gives access to the PID...
This works well for some tools, but not others. For example, with pyinstaller you have to run py -m PyInstaller with that exact capitalisation - something that I don't believe is clearly documented anywhere, the docs just say to use pyinstaller directly so it's confusing when that doesn't work. There are also other tools that don't have any -m alternative that i've been able to find, like https://csvkit.readthedocs.io/en/latest/.
The py installer is nice, but it requires a certain ...
Don't have a strong opinion on whether we should or shouldn't ping, or what the message content should be.
However, code wise this change is nice and simple.
557fc70 Fix bug where truncation message wasn't always ... - TizzySaurus
GitHub Actions run 4640453877 was cancelled.
I'm not sure what issue is being solved by having the ... in different places.
It just makes it clear what was truncated without having to leave Discord and go to the paste site. It didn't feel like much extra work, so I did it ๐คท.
Requiring two lines (... and then (truncated ...)) takes up more space to indicate the same thing
It doesn't "indicate the same thing" though. It's possible for the truncation reason to be "too long", and to still have lines removed (e.g. `for _ in ra...
Connected!
GitHub Actions run 4640639396 succeeded.
Connected!
GitHub Actions run 4640669813 succeeded.
GitHub Actions run 4641034816 succeeded.
bb5cf85 Refine the invite code before filtering it - mbaruh
[python-discord/bot] New branch created: refined\_invites
Refines the invite to what it is most likely to be. If the refining process changes the invite code, then that means it originally wasn't a valid invite code. So the refining can find that the invite is actually whitelisted, or maybe it is explictly denied and that there's a specific action that needs to be taken.
For exmaple, for discord.gg/python. it will ignore the dot at the end.
Forward slashes (after discord.gg/) are included in the invite code because it can confuse Discord, so...
GitHub Actions run 4641912356 succeeded.
Looks good! Also, thanks for fixing my bad doc strings ๐
32b8f80 Ping help thread owner if thread closes without... - swfarnsworth
e7b393b Add warning not to pip install unrelated packages. - swfarnsworth
2ebf6c8 Increase search history from 10 messages to 100. - swfarnsworth
243013e Merge branch 'main' into swfarnsworth/ping-on-t... - ChrisLovering
5e6e21d Merge pull request #2504 from python-discord/sw... - ChrisLovering
[python-discord/bot] branch deleted: swfarnsworth/ping\-on\-thread\-close
GitHub Actions run 4646654648 succeeded.
32b8f80 Ping help thread owner if thread closes without... - swfarnsworth
e7b393b Add warning not to pip install unrelated packages. - swfarnsworth
2ebf6c8 Increase search history from 10 messages to 100. - swfarnsworth
89356ca Correct log upload - mbaruh
6922903 Merge pull request #2519 from python-discord/fi... - wookie184
[python-discord/bot] branch deleted: thread\_filter
GitHub Actions run 4646664020 was cancelled.
Connected!
Doc item doc_item.symbol_id='disnake.ext.commands.Bot' present in loaded documentation inventories not found on site, inventories may need to be refreshed.
GitHub Actions run 4647228548 succeeded.
Connected!
ce705aa Add README to the resources app - jchristgit
[python-discord/site] New branch created: add\-resources\-readme
GitHub Actions run 4647362554 succeeded.
I had completely forgotten to get back to this.
Tested and approved! Thanks!
[python-discord/bot] branch deleted: vivek/mod\-edit\-log\-embed\-jump\-url
GitHub Actions run 4651643372 succeeded.
Connected!
Everything detailed in the OP is now possible except for the last one, which shouldn't be difficult to implement. What this really needs though is a moderation team discussion.
@ChrisLovering can you resolve the merge conflict? it'll be moving the changes to the equivalent function in the new filtering.py
https://github.com/python-discord/bot/blob/ea0b227801f19d14338e7e582d745ea250773370/bot/exts/filtering/filtering.py#L1396
[bot] Branch use\-paste\-service\-for\-long\-autoban\-filters was force-pushed to `2a3cb7f`
@ChrisLovering can you resolve the merge conflict? it'll be moving the changes to the equivalent function in the new filtering.py
Rebased, I've also simplified it quite a lot, it was far more complicated than it needed to be.
GitHub Actions run 4651909855 succeeded.
[python-discord/bot] branch deleted: flaskapi\-archive
[python-discord/bot] branch deleted: decorator\-factory\-add\-generators\-tag
[python-discord/bot] branch deleted: decorator\-factory\-add\-tag\-generators
[python-discord/bot] branch deleted: feat/backend/784/aggregate\-syncer\-errors
[python-discord/bot] branch deleted: filtering\-revamp
[python-discord/bot] branch deleted: mbaruh/mute
[python-discord/bot] branch deleted: supress\-notfound\-messages\-on\-delete
[python-discord/bot] branch deleted: zen\-args\-fix
[python-discord/bot] branch deleted: vivek/infra\-log\-add\-jump\-url
[python-discord/bot] New branch created: flake8\-to\-ruff
To see these code changes commit-by-commit see this diff.
This migrates our linting toolchain from flake8, and related plug-ins, to ruff. from testing, ruff is considerably faster, as well as having more auto-fix support for many of the rules.
There are also more rules than what we have enabled in this PR, which we may look into adding in the future.
See the select li...
GitHub Actions run 4652356636 failed.
GitHub Actions run 4652464913 succeeded.
This is undesirable here since the variable name helps keep track of the code
ce53437 Fix deleted message logging in mod alert - mbaruh
[python-discord/bot] New branch created: fix\_alert\_message\_logging
The alerting only uploaded the related messages, so if they didn't come included with the context message, it wasn't uploaded.
GitHub Actions run 4653439957 succeeded.
These all sound fine. And
/dev/fd/is really just/proc/self/fd/, right?
That is correct. It's just a convenient shortcut that we might as well include if we're going to include /proc/self/fd/.
On second thought, wouldn't this allow one eval to access another eval's file descriptors?
As long as each eval is a separate process, (and as I understand it, that's true), that wouldn't be an issue. Suppose we have process A with a PID of 5 and process B with a PID of 6. Pr...
GitHub Actions run 4654947391 succeeded.
GitHub Actions run 4656812377 succeeded.
Do you think it would be worth a noqa just for this? The rule is to standardise symbols to ascii, so replacing the en dash with a hyphen
This is part of the pyupgrade rule, specifically UP007. Personally I think having one consistent way here is better, so choosing the less verbose one, that doesn't require an import is the way I'd go too.
Will squash all fixup commits before merging, so marking as do not merge so I can do that once approved.
GitHub Actions run 4656829054 succeeded.
Sure, but did you read the comment above :D
We can do a noqa, but so far all the rule has done is make us as noqas
GitHub Actions run 4657657323 succeeded.
[python-discord/bot] New branch created: new\_infr\_embeds
Redesigns the infractions embed to be more concise and compact.
Before:

After:

The new embeds has a row of symbols that are explained in the help embeds of the appropriate commands:
?Union across the project.
Some ignored rules here don't appear in the ruff config. I assume this is intentional but just want to check
Didn't you want to leave a comment about this one?
Uuuuh this entire file should be gone... must have survived a merge conflict.
GitHub Actions run 4664386718 succeeded.
[python-discord/bot] New branch created: cleanup
- Removes the Free constants from two help system ago.
- Removes the mentions rule from the previous filtering system which probably survived a merge conflict.
- Removes the events extension which is now in https://github.com/python-discord/sir-robin.
GitHub Actions run 4665884196 was cancelled.
GitHub Actions run 4665896111 succeeded.
Ignore this, handled in #2528
GitHub Actions run 4666755988 succeeded.
Connected!
GitHub Actions run 4667888403 succeeded.
Connected!
GitHub Actions run 4667879892 succeeded.
Is there a reason we decided not to use a local hook? Having it managed in two places seems like it will make it harder to keep the version consistent.
Yea, this is intentional, they're rules that are served by other plugins/no longer appropriate.
MAX_PASTE_LENGTH is the maximum length that can be sent to the pastebin which isn't what we want here. Not sure if we have a constant anywhere for message length.
Yea, I had a comment in my investigation branch, but didn't cherry pick it into this one for some reason.
https://github.com/python-discord/bot/pull/2523/commits/e74e2e50469be60664afd564eab3a6d50961c0f4
[bot] Branch use\-paste\-service\-for\-long\-autoban\-filters was force-pushed to `1ff9c71`
GitHub Actions run 4668551473 failed.
[bot] Branch use\-paste\-service\-for\-long\-autoban\-filters was force-pushed to `5659734`
GitHub Actions run 4668633953 succeeded.
[bot] Branch use\-paste\-service\-for\-long\-autoban\-filters was force-pushed to `2605264`
GitHub Actions run 4668706220 succeeded.
cf5111f Bump pytest from 7.2.2 to 7.3.0 (#2525) - dependabot[bot]
[python-discord/bot] branch deleted: cleanup
GitHub Actions run 4668743864 was cancelled.
GitHub Actions run 4668756283 was cancelled.
GitHub Actions run 4668765837 succeeded.
Connected!
GitHub Actions run 4668755201 was cancelled.
Looking at how ruff-pre-commit does it (https://github.com/charliermarsh/ruff-pre-commit/blob/f6346ef27faac608d493bf3926528b308d175d9e/.pre-commit-hooks.yaml) I believe precommit automatically passes the files to run on (only changed ones) so we don't need to specify to run on all files. Ruff is fast enough that it doesn't seem to make much of a difference anyway though :P
Connected!
GitHub Actions run 4669287931 succeeded.
GitHub Actions run 4669341891 succeeded.
Should be superseded not superceded, although I think overridden sounds better anyway.
By default, the values defined in the classes are used, these can be overridden by an env var with the same name.
GitHub Actions run 4669456415 succeeded.
GitHub Actions run 4669514795 succeeded.
FWIW I opened two issues on the ruff repo regarding the typing things it didn't pick up: https://github.com/charliermarsh/ruff/issues/3937 and https://github.com/charliermarsh/ruff/issues/3936.
[python-discord/bot] branch deleted: flake8\-to\-ruff
3154012 Replace local flake8 linting config with ruff - ChrisLovering
2f5ea70 Replace CI flake8 config with ruff - ChrisLovering
8dca428 Migrate code style to ruff - ChrisLovering
9185abf Add a git-blame-ignore-revs file - ChrisLovering
2a3ed04 Use commands.Converter subclass for d.py conver... - ChrisLovering
Connected!
I'm somewhat struggling with the overall logic of that function. If we're keeping track of what PEPs are already shown in the channel, why do we need any date validation?
It's really just a random combination of letters and numbers.
Yeah I think it would be nice to move them out of the footer so we can use localized timestamps.
I'm somewhat struggling with the overall logic of that function. If we're keeping track of what PEPs are already shown in the channel, why do we need any date validation?
It shouldn't make a big difference in production, although in dev it prevents you being sent loads of posts when you first start up the bot. The feed only contains the past 10 PEPs so it would be fine without the validation, although a generous time check would also be fine imo.
It also doesn't seem like there's an...
If you timeout and then untimeout a user, it is unclear that the timeout is no longer active in the infraction listing.
I know for active timeouts it specifically says they are active, but seeing this:

still makes me think that it is active, due to the expiry.
689ffb5 Bump rapidfuzz from 2.15.0 to 2.15.1 - dependabot[bot]
0fa3cc4 Merge pull request #2530 from python-discord/de... - wookie184
cf5111f Bump pytest from 7.2.2 to 7.3.0 (#2525) - dependabot[bot]
e94a53c Remove dead or unused code (#2528) - mbaruh
11a4003 Bump httpx from 0.23.3 to 0.24.0 (#2529) - dependabot[bot]
[python-discord/bot] branch deleted: fix\_alert\_message\_logging
GitHub Actions run 4679439302 was cancelled.
@discord.ui.button(label="Help", style=ButtonStyle.primary)
e3b3e09 Use double quotes instead of single - wookie184
Connected!
249d9db Fix sending of PEPs by PythonNews cog - wookie184
[python-discord/bot] New branch created: pep\-news\-date\-fix
Closes #2527
Value of 6 weeks is based on the longest difference I could see being ~1 month, and 6 weeks being a bit more than that.
GitHub Actions run 4679842674 succeeded.
[python-discord/bot] New review comment on pull request #2533: Fix sending of PEPs by PythonNews cog
Is ["published"] still the correct key to use here?
[python-discord/bot] New review comment on pull request #2533: Fix sending of PEPs by PythonNews cog
I think "published" it's just what it's called by RSS, but it's actually set to the "creation date" (when the number was assigned) of the PEP (https://github.com/python/peps/blob/af6009befdeab08d067641c167754ba75d7493e8/generate_rss.py#L175).
AFAIK there's no good way of getting the actual date the PEP became available in the RSS feed/on the website.
[python-discord/bot] New branch created: snekbox\-spacing\-fix
Closes #2499
How it looks now:

GitHub Actions run 4680603196 succeeded.
b5d0954 Use correct names for antispam rules - wookie184
[python-discord/bot] New branch created: filtering\-class\-name\-fixes
CC @mbaruh, noticed these didn't seem right.
GitHub Actions run 4680725116 succeeded.
99ba589 Include thread jump url in nomination archive m... - wookie184
[python-discord/bot] New branch created: nominations\-thread\-jump\-in\-archive
GitHub Actions run 4680955226 succeeded.
You technically don't need to care about getting the thread or failing to do so. The thread URL is just the message URL without the message ID. I think it will be more consistent that way, because otherwise the thread might not be cached and then you have to do await guild.fetch_channel. This is unlikely to come up in testing since you're probably archiving recently created threads.
Alternatively, going further down the function there's a definition for nomination_thread, which you can...
GitHub Actions run 4681637625 succeeded.
a30ac61 Fix sending of PEPs by PythonNews cog (#2533) - wookie184
[python-discord/bot] branch deleted: pep\-news\-date\-fix
[python-discord/bot] branch deleted: snekbox\-spacing\-fix
GitHub Actions run 4682210610 was cancelled.
baa21fb Use correct names for antispam rules (#2535) - wookie184
[python-discord/bot] branch deleted: filtering\-class\-name\-fixes
3499ea3 Bump pip-licenses from 4.1.0 to 4.2.0 (#2531) - dependabot[bot]
GitHub Actions run 4682218703 was cancelled.
Connected!
Having ellipses in multiple places seems confusing to me and I'm not sure if we have to find a way to address this. In the end the information we had before is that this isn't the full output and that you should open the paste link for the full output, which I think is sufficient.
Doesn't this suppress any other reasons for HTTP exceptions? you'll end up not having a report and then logging that it was sent successfully.
This can raise exceptions that should be handled.
What is the concern behind removing markdown before uploading it?
GitHub Actions run 4688439080 succeeded.
Connected!
GitHub Actions run 4688793968 succeeded.
Connected!
[bot] Branch use\-paste\-service\-for\-long\-autoban\-filters was force-pushed to `e75a94a`
True, I've made is so that these still get raised.
No concern, it just makes it a pain to read in the text embed/pastebin site if all the markdown chars are there
GitHub Actions run 4689805550 succeeded.
a30ac61 Fix sending of PEPs by PythonNews cog (#2533) - wookie184
a10ab7e Fix spacing in eval message (#2534) - wookie184
baa21fb Use correct names for antispam rules (#2535) - wookie184
3499ea3 Bump pip-licenses from 4.1.0 to 4.2.0 (#2531) - dependabot[bot]
9c7bd42 Merge branch 'main' into new_infr_embeds - mbaruh
[python-discord/bot] branch deleted: new\_infr\_embeds
GitHub Actions run 4690431249 succeeded.
Connected!
GitHub Actions run 4692043735 succeeded.
GitHub Actions run 4692116139 succeeded.
[python-discord/bot] branch deleted: use\-paste\-service\-for\-long\-autoban\-filters
GitHub Actions run 4694205351 succeeded.
Connected!
[python-discord/site] branch deleted: add\-resources\-readme
8785139 Fix readme badges for CI status - wookie184
[python-discord/bot] New branch created: update\-readme\-badges
Old badges were not representing current CI.
GitHub Actions run 4699931097 succeeded.
Connected!
a30ac61 Fix sending of PEPs by PythonNews cog (#2533) - wookie184
a10ab7e Fix spacing in eval message (#2534) - wookie184
baa21fb Use correct names for antispam rules (#2535) - wookie184
3499ea3 Bump pip-licenses from 4.1.0 to 4.2.0 (#2531) - dependabot[bot]
e75a94a Upload weekly autoban report to pastebin - ChrisLovering
ade95c4 Include thread jump url in nomination archive m... - wookie184
[python-discord/bot] branch deleted: nominations\-thread\-jump\-in\-archive
GitHub Actions run 4700214731 succeeded.
Connected!
[python-discord/site] New branch created: Simplify\-the\-bot\-contributing\-guide
3b874d3 Seperate manual configuration out of the main b... - ChrisLovering
This splits out the manual configuration setup from the main guide, along with updating the guide to be far simpler, and less words to read for our contributors to get setup.
c104593 Add the required ports to snekbox urls in docke... - ChrisLovering
[python-discord/bot] New branch created: correct\-compose\-file
GitHub Actions run 4703815569 succeeded.
[site] Branch Simplify\-the\-bot\-contributing\-guide was force-pushed to `cdcea61`
GitHub Actions run 4703938501 succeeded.
[site] Branch Simplify\-the\-bot\-contributing\-guide was force-pushed to `e2d24d4`
[site] Branch Simplify\-the\-bot\-contributing\-guide was force-pushed to `4ab3059`
GitHub Actions run 4703958528 was cancelled.
GitHub Actions run 4703961474 succeeded.
[site] Branch Simplify\-the\-bot\-contributing\-guide was force-pushed to `3fa33da`
GitHub Actions run 4703977761 succeeded.
8dafaa8 Add the required ports to snekbox urls in docke... - ChrisLovering
[python-discord/bot] branch deleted: correct\-compose\-file
Connected!
[site] Branch Simplify\-the\-bot\-contributing\-guide was force-pushed to `adb81c4`
Heya.
I wrote a message for the bot for !in
I read through the !contribute bit but not too sure how to submit. If thereโs a different way to do this, please let me know.
Feed back is of course welcome and highly appreciated.
I have another message regarding the use of a condition in if. Let me know if I can post that here as well or should do something else with it.
========= start of message ====
in
used to see if a is part of b.
a in b
return a boolean True/False.
Wher...
cbf6810 Add Tag Issue Template - HassanAbouelela
[python-discord/bot] New branch created: tag\-suggestion\-template
People (contribs, staff, and core-devs alike) have often been confused by where to create issues for adding new tags. Creating issues on this repository makes the most sense - issue follows implementation - but it's rarely the correct option. Tag suggestions issues are never about implementation details, but specific tag details such as: do we want this? what form do we want it in? etc.
These questions can not be discussed adequately on this repository as it's difficult to gain traction an...
9dd12a8 Update tag-suggestion.yml - HassanAbouelela
GitHub Actions run 4706280221 was cancelled.
GitHub Actions run 4706282448 succeeded.
Great idea, just one tiny comment.
I would suggest making it clearer, as this currently sounds like an "inside joke". (The fact that people never read the instructions, so we made this)
For example
title: TAG ISSUES GO TO THE META REPO, PLEASE READ THE FOLLOWING INSTRUCTIONS
I think it would be neater to use contact_links here given that's what they're intended for. For examples, see https://github.com/PyCQA/flake8/issues/new/choose and https://github.com/facebook/react/issues/new/choose
Also, looking at https://github.com/facebook/react/issues/new/choose it seems the option to create a blank issue is pretty hidden away. If we want to add a template for this I think we'd have to add ones for normal usage too.
I think it would be neater to use
contact_linkshere given that's what they're intended for. For examples, see https://github.com/PyCQA/flake8/issues/new/choose and https://github.com/facebook/react/issues/new/choose
Nice ! I didn't know these existed.
In that case, I agree with wookie on the fact that it would look neater if we use contact_links for that.
186e223 Improve test speed using some cached_property d... - wookie184
[python-discord/bot] New branch created: faster\-tests
There are definitely more improvements to be made, and this probably isn't really addressing the root cause, but it is a quick win that should have no effect on behaviour/effectiveness of tests.
Previously on my laptop tests took 50-60 seconds to run, with this change they only take ~20 seconds.
The source of slowdown was discovered using pytest-profiling. create_autospec is apparently very slow. The changes to the roles on MockGuild have a smaller improvement but still seem to ...
GitHub Actions run 4708555177 succeeded.
Connected!
Feel free to assign me when this is ready for review.
Adds Python Graph Gallery as a new resource. The discussion for this change can be found in the issue that this PR closes.
Closes python-discord/meta#210
GitHub Actions run 4709957035 succeeded.
762763c Add a README to the staff app - jchristgit
[python-discord/site] New branch created: staff\-app\-readme
Plus minor refactorings
GitHub Actions run 4710196813 succeeded.
5789e3e Don't collect coverage info by default when run... - wookie184
[python-discord/bot] New branch created: dont\-collect\-coverage\-on\-test
I'm pretty sure in 99% of cases when people are running tests they wont be checking coverage, since we don't take coverage too seriously.
Instead of having poetry run task test-nocov the option to not collect coverage info, this makes that default and adds a poetry run task test-cov option if coverage info is wanted.
For me this doubles the speed of poetry run task test (from ~20 seconds to ~10 seconds).
GitHub Actions run 4714222098 succeeded.
[python-discord/site] New branch created: swfarnsworth\-rule\-5
"may break laws, breach terms of services, or are malicious or inappropriate." -> "may violate terms of service, or that may be deemed inappropriate, malicious, or illegal."
GitHub Actions run 4715027919 succeeded.
[python-discord/site] New branch created: update\-rule\-5
A followup for #942 that updates the rules fetched by the bot.
GitHub Actions run 4715432135 succeeded.
Currently, the same rules are persisted in 2 different places
pydis_site/apps/api/views.py and pydis_site/apps/content/resources/rules.md
Over the past month or so, we've had two rule updates in one of the files only, leaving the other forgotten.
It would be nice to put the rules in one place only in order to avoid missing out on one over the other.
Note
I'm not even sure this is something we'd want to do, so just putting it out there (@jchristgit you're the site master, so ...
GitHub Actions run 4720372430 succeeded.
[site] Branch Simplify\-the\-bot\-contributing\-guide was force-pushed to `7064ab7`
[site] Branch Simplify\-the\-bot\-contributing\-guide was force-pushed to `5c0e04f`
GitHub Actions run 4720483411 was cancelled.
GitHub Actions run 4720488265 succeeded.
[python-discord/bot] branch deleted: refined\_invites
85bafc3 Refine the invite code before filtering it (#2522) - mbaruh
Connected!
@dependabot ignore this dependency
[python-discord/bot] Issue opened: #2545 Add a link to Nedbat's talk on mutability in mutability\.md
Nedbat's video is linked so often; I think it would be nice to just include it in the response to !mutability
GitHub Actions run 4723743259 failed.
Wait until the Issue is actually approved before working on it
There shouldn't be a space between the ] and (
I don't think that this file should be included?
fixed. I (wrongly) assumed that swp files were in .gitignore
GitHub Actions run 4723954266 succeeded.
[python-discord/bot] New comment on pull request #2546: updated mutability\.md to link Nedbat's talk
Wait until the Issue is actually approved before working on it
yeah - this was pointed out to me in pydis. But the change was so small that I just did it. if it gets rejected, then it really only took 30 seconds to write.
It looks like this file is causing an error as you can see in the lint-test continuous integration step Details, but even if it weren't causing any issues, it still shouldn't be included since it is specific to the editor you're using.
When contributing to any open source project in general, whenever possible, try to test your changes locally before opening PRs
That isn't quite how discord link parsing works.
https://github.com/python-discord/bot/pull/2522 opens some regressions in the invite filter which allow users to send invites in the server that go to other servers. This is due to how discord fetches invites, and how the invite parser now works.
This was originally fixed by https://github.com/python-discord/bot/pull/2173 and is a new regression.
A simple example is as follows:
- if not already, whitelist the guild with invite
disnake - send https://discord.gg/disnake./pGatU9MSX...
5e25236 Remove !close command from helpers. - swfarnsworth
[python-discord/bot] New branch created: swfarnsworth/help\_thread\_close\_command
Previously, helpers could use the !close command to put inactive help channels back into circulation. This is no longer necessary now that we use threads.
I confirmed that each of these cases work correctly on my test server:
- Close the thread as the OP with no role
- Not be able to close someone else's thread as a helper
- Close someone else's thread as admin
GitHub Actions run 4727358992 succeeded.
The simplest solution to this is probably to limit the trimming only if to non-word characters at the end of the string, meaning https://github.com/python-discord/bot/blob/85bafc39cc420d6c6d07dd84f1cebb0482f2a1e1/bot/exts/filtering/_filter_lists/invite.py#L24 can be changed to [^a-zA-Z0-9/]* (untested).
We can do this specifically to the for the whitelist and keep the blacklist trimming as-is, but this is probably an unnecessary resolution.
[python-discord/bot] New review comment on pull request #2548: Remove \!close command from helpers\.
cmd_whitelist = Guild.moderation_roles
We should use this instead, or better yet, remove this constant entirely and just use Guild.moderation_roles in the cog.
So I can create files that will be referenced in a python script like this using HTTP:
{
"args": ["main.py"],
"files": [
{
"path": "main.py",
"content": "d2l0aCBvcGVuKCJ...="
},
{
"path": "source.txt",
"content": "c3VwZXIgYWR2YW...="
}
]
}
this works great, but the files I need to process are in tens of gigabytes. Is there any way for me to mount them directly into the contain...
I believe the following check in the on_message listener needs to also be included in the on_message_edit listener:
8b553d5 Update filtering.py to ignore edits by bots - lxnn
[python-discord/bot] New branch created: filtering\-ignore\-bot\-edits\-fix
GitHub Actions run 4737408896 failed.
17df646 Update filtering.py to remove trailing whitespace - lxnn
GitHub Actions run 4737439145 succeeded.
GitHub Actions run 4740063198 succeeded.
GitHub Actions run 4743572571 succeeded.
[python-discord/bot] New comment on pull request #2550: Update filtering\.py to ignore edits by bots
@wookie184 Zig said he will be unavailable for the next couple of weeks. Should I add another reviewer?
GitHub Actions run 4753485592 failed.
GitHub Actions run 4754561158 succeeded.
[python-discord/bot] New comment on pull request #2550: Update filtering\.py to ignore edits by bots
@wookie184 Thanks for the review! Zig said he will be unavailable for the next couple of weeks. Should I add another reviewer?
Seems there'll be no need, thanks @vivekashok1221!
8b553d5 Update filtering.py to ignore edits by bots - lxnn
17df646 Update filtering.py to remove trailing whitespace - lxnn
604805b Merge pull request #2550 from python-discord/fi... - wookie184
[python-discord/bot] branch deleted: filtering\-ignore\-bot\-edits\-fix
Connected!
GitHub Actions run 4757478390 succeeded.
Connected!
GitHub Actions run 4757507693 succeeded.
Connected!
Connected!
GitHub Actions run 4757591740 succeeded.
One comment, this is nice.
writing, is only an endpoint to view logs uploaded by the Python bot.
Connected!
GitHub Actions run 4757801536 succeeded.
We sure like our tests sped up !
85bafc3 Refine the invite code before filtering it (#2522) - mbaruh
8b553d5 Update filtering.py to ignore edits by bots - lxnn
17df646 Update filtering.py to remove trailing whitespace - lxnn
604805b Merge pull request #2550 from python-discord/fi... - wookie184
60d9028 Bump rapidfuzz from 2.15.1 to 3.0.0 - dependabot[bot]
[python-discord/bot] branch deleted: dont\-collect\-coverage\-on\-test
GitHub Actions run 4758670490 succeeded.
Connected!
closes #2226
The idea is to fetch active nominations that are more than 2 weeks old, and create admin issues for them in Github so that staff will do the follow up.
As soon as a vote is tracked, we add a "๐ซ" reaction (which can change) to it to make sure we don't create duplicate issues for it, instead of keeping track in another way
GitHub Actions run 4759086119 failed.
GitHub Actions run 4759444908 succeeded.
GitHub Actions run 4759455505 succeeded.
96272ca Add Python Graph Gallery to the Resources - etrotta
600c512 Merge branch 'main' into main - wookie184
1c76107 Merge pull request #940 from etrotta/main - wookie184
9143fc3 Bump sentry-sdk from 1.19.1 to 1.20.0 - dependabot[bot]
9841d7c Merge pull request #946 from python-discord/dep... - jchristgit
GitHub Actions run 4760608081 succeeded.
GitHub Actions run 4760618065 succeeded.
Connected!
GitHub Actions run 4760641628 succeeded.
GitHub Actions run 4763403462 succeeded.
98a2ffb Change Role constant for !close
- swfarnsworth
5789e3e Don't collect coverage info by default when run... - wookie184
8b553d5 Update filtering.py to ignore edits by bots - lxnn
17df646 Update filtering.py to remove trailing whitespace - lxnn
604805b Merge pull request #2550 from python-discord/fi... - wookie184
60d9028 Bump rapidfuzz from 2.15.1 to 3.0.0 - dependabot[bot]
GitHub Actions run 4767358778 succeeded.
7c8b8e1 Remove !close command from helpers. (#2548) - swfarnsworth
[python-discord/bot] branch deleted: swfarnsworth/help\_thread\_close\_command
Connected!
3496f6c Make unittests independent of GitHub - jchristgit
[python-discord/site] New branch created: independent\-unit\-tests
This fixes a problem where running the unit tests successively a lot would result in 403 ratelimit exceeded errors being thrown due to the GitHub API being called by the app.
Fixes #918
GitHub Actions run 4768112234 failed.
GitHub Actions run 4768124431 failed.
2a9be05 feat: Edit on GitHub button for content articles - hedyhli
2da5458 Merge branch 'main' into feat/edit-gh - hedyhli
7a8ad55 Merge branch 'main' into feat/edit-gh - hedyhli
4feb9a0 Merge branch 'main' into feat/edit-gh - hedyhli
9b9bfdb Merge branch 'feat/edit-gh' of github.com:hedyh... - hedyhli
[python-discord/site] New branch created: hedyhli\-edit\-on\-github
GitHub Actions run 4768149820 succeeded.
Pulled from https://github.com/python-discord/site/pull/626 to allow maintainer edits
I have opened a PR at https://github.com/python-discord/site/pull/626 that has your commits to allow maintainer edits to get the final changes in to merge it.
GitHub Actions run 4768164445 succeeded.
GitHub Actions run 4768191512 failed.
GitHub Actions run 4768263932 succeeded.
I have taken the existing work on the PR and added finishing touches on top of it here: https://github.com/python-discord/site/pull/949
I will close this for now as there hasn't been activity for a while. If you're interested in working on it again, please let us know in #494
I do think we should definitely find a way to keep these in sync.
As an initial workaround for this, I will add a simple unit test that will compare the rules returned by the API with the rules in the file.
e917f54 Crosscheck rules between API and static rules - jchristgit
[python-discord/site] New branch created: rule\-crosscheck
GitHub Actions run 4768544466 failed.
GitHub Actions run 4768573491 succeeded.
This is amazing. Absolutely stunning. Thank you so much. And please, don't make the coffee too hot, okay? I burnt myself the last time.
Oh, and no milk at all. I like it as pure as my editor. No milk at all. My coffee like my editor.
Seriously, man. As soon as I turn into president, the world will see these small QoL changes everywhere.
Lemon will be elected Head Of Technology. Or Head Of Public Relations. Maybe he can automate it.
e24366b Use documented spec extensions in docker compose - ChrisLovering
[python-discord/bot] New branch created: update\-docker\-compose
The previous method of '<<' no longer works with the latest version of docker compose. This method is what is documented in the compose spec
[python-discord/bot] Checks Successful on PR: #2554 Use documented spec extensions in docker compose
GitHub Actions run 4768984664 succeeded.
[python-discord/bot] Checks Successful on PR: #2554 Use documented spec extensions in docker compose
GitHub Actions run 4769086078 succeeded.
GitHub Actions run 4769322625 succeeded.
Sad I didnโt get time to work on this, but thanks a lot for continuing on my progress!
[python-discord/bot] Checks Successful on PR: #2554 Use documented spec extensions in docker compose
GitHub Actions run 4772064161 succeeded.
Thanks for laying the foundation with your work! I am looking forward to having this on the live site.
GitHub Actions run 4772139379 succeeded.
[python-discord/site] branch deleted: rule\-crosscheck
Looking great, 2 small comments.
I think this should be a note, so that it jumps to the eye easily
This currently renders like this

@shtlrs do you think #950 was a satisfactory fix or do we want more solutions here?
I think that does it good sir.
A unit test adds no extra maintenance cost for whatever solution we would have opted for.
I'll close this now.
Thank you master!
Can i pick this one, i have experience with Django but not that much with front end but I think should be possible.
Traceback:
AttributeError: 'NoneType' object has no attribute 'jump_url'
File "bot/exts/filtering/_settings.py", line 199, in action
await entry.action(ctx)
File "bot/exts/filtering/_settings_types/actions/remove_context.py", line 53, in action
await self._handle_nickname(ctx)
File "bot/exts/filtering/_settings_types/actions/remove_context.py", line 109, in _handle_nickname
await command(FakeContext(ctx.message, alerts_channel, command), ctx.author, None, reason=...
It seems like there is a version of the previous syntax that works, but this way seems just as good so lgtm. https://github.com/docker/compose/issues/10411#issuecomment-1488019350
[python-discord/bot] branch deleted: update\-docker\-compose
Connected!
cbc6770 Crosscheck rules between API and static rules - jchristgit
5ee07a5 Bump sqlparse from 0.4.3 to 0.4.4 - dependabot[bot]
f0f0e97 Merge pull request #951 from python-discord/dep... - Xithrius
0df4c3f Merge branch 'main' into rule-crosscheck - shtlrs
12b28f9 Merge pull request #950 from python-discord/rul... - shtlrs
GitHub Actions run 4772761885 failed.
[site] Branch Simplify\-the\-bot\-contributing\-guide was force-pushed to `a5b7c50`
[site] Branch Simplify\-the\-bot\-contributing\-guide was force-pushed to `facb030`
GitHub Actions run 4772817496 was cancelled.
GitHub Actions run 4772818265 succeeded.
Comparing https://deploy-preview-949--pydis-static.netlify.app/pages/guides/pydis-guides/contributing/sir-lancebot/ to https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/sir-lancebot/ it seems like this causes the rest of the page to drop down a bit.
Before:

After:
 - jchristgit
[python-discord/site] branch deleted: independent\-unit\-tests
[python-discord/site] branch deleted: Simplify\-the\-bot\-contributing\-guide
GitHub Actions run 4772889632 succeeded.
Closes #2555
on_voice_state_update events do not have message attributes in their context.
Which is why we'll ignore setting the jump_url for these events.
We might want to account for null channels that we ignore here.
In that case, I'm not sure what value to return ๐ค
78e341e Bump rapidfuzz from 2.13.7 to 2.15.0 (#1246) - dependabot[bot]
e8c1856 Bump pillow from 9.4.0 to 9.5.0 (#1247) - dependabot[bot]
7e2d2dc Bump pre-commit from 3.2.1 to 3.2.2 (#1248) - dependabot[bot]
1bb262f Bump sentry-sdk from 1.18.0 to 1.19.0 (#1249) - dependabot[bot]
767daac Bump beautifulsoup4 from 4.12.0 to 4.12.1 - dependabot[bot]
GitHub Actions run 4773230286 succeeded.
ebc9286 Add lesser yellow to color list (#1245) - brad90four
[python-discord/sir-lancebot] branch deleted: lesser\_yellow
GitHub Actions run 4773235441 was cancelled.
Connected!
This allows us to access site and other services directly from the host machine.
Which is useful for viewing pg data, or viewing content on site, etc.
I guess we can just let it throw, and handle those case by case if they will ever occur.
@wookie184 yes I have seen that, but I have no idea what causes it. Inspecting the layout in Firefox I concluded that it's no margin or padding from the element itself. I also concluded that it's probably not noticeable by anybody and was hoping I could sweep it under the rug. Unfortunately, you have crossed through my plan to do it.
Any other idea where we can check what's causing the surplus whitespace apart from the layout box in devtools? I also tried to use a span instead of div t...
Hi had a few question( In comparison with the page for google jam8)
-
Unable to find the team member names for the winners, so should I remove that block.
-
Demo video is unavailable for all the winners, so the option is only present for one, so should I remove it for consistency across or let it be.
-
Code Jam 8 had an submissions page as well but we don't have it for code jam 9 ( if we want to add it if yes then where I can find the data.
This allows us to access site and other services directly from the host machine.
This behaviour is already possible with the current configuration. Holding this PR until we actually know what the problem is.
Wouldn't it make more sense to check if ctx.message is not None?
Yes it would, and that's the first obvious solution.
I just got lost in a tunnel vision of figuring out where it started from and following through.
I'll change is to that, as it's a much much simpler fix.
@mbaruh Having ellipses in multiple places seems confusing to me
I really don't understand where this confusion comes from. ... has long been used in the world of UI/UX to indicate that the displayed text has been shortened (and we already had this in the eval output before this PR).
What I've changed is that if the line is shortened, the ... shows after the shortened line, showing it was simply shortened, and if the line is completely removed then the ... shows in-place o...
The only thing which is missing from the previous code jam.
https://github.com/python-discord/site/issues/911#issuecomment-1518695879
Closes #911
GitHub Actions run 4778200712 succeeded.
@MrHemlock is this a feature that's still wanted? If so, I'd be happy to work on it (assuming @JacobMonck no longer wants to).
I think we should consider (probably not in this PR) changing the type hints for any functions that can take a FakeContext, since just Context is misleading and makes it easy to introduce bugs like this.
Hi, thanks for working on this! Here's the information on team members and submissions, I think a submissions page would be good if you're happy to add it.
Team members:
- Cerebral Centaurs: Palmirka, Tuยฎtle, collerek, Rortox
- Kingly Kelpies: Kingu, Falkan, Bamboodja, Redriel, Vinyzu
- Logical Leprechauns: Fyx, Aboo Minister, A5rocks, Bautista, ~tylerr
Submissions (there was one more, from the "Sensational Sirens" but I removed it because the link 404d):
- Artful Angels https:/...
If a user is temporarily banned, and a moderator attempts to permanently ban said user, the following code will never return anything but None.
This is because the site api does not return a duration_or_expiry field, it's named expires_at. This prevents us from re-banning a temporary banned user to permanent without unbanning them first.
#2234 ...
GitHub Actions run 4784418011 succeeded.
Hey would love to pick this up,
Never worked on discord but I think I can do it. Is this still pending?
Hey would love to pick this up, Never worked on discord but I think I can do it. Is this still pending?
Hey ๐
Thank your for the interest in picking this up.
However, I have tried to work on this in the past, and there's currently an issue with how we deal with our infractions in general due to the design.
So I'm afraid it is currently blocked by this issue
We're still discussing what the schema will look like, etc.
I'll ...
GitHub Actions run 4785087976 succeeded.
I think we should consider (probably not in this PR) changing the type hints for any functions that can take a
FakeContext, since justContextis misleading and makes it easy to introduce bugs like this.
I think the issue now is that we have 3 context classes: Context, FakeContext and FilterContext that are being used for conversion, and post_infraction takes either Context or FakeContext.
In this particular case, I think it's an instance of FilterContext that's bein...
I'm open to a solution that gets rid of FakeContext, but as far as I could see it's a necessity since Context is created from either a message or an interaction.
Hey, I believe snekbox can support your use case. You can mount your files as a Docker volume using Docker's CLI options when starting a container. You'll need a custom NsJail configuration to mount your volume into the jailed process. Using a custom NsJail configuration also requires a mount with Docker (or you can build your own image); you will need to mount it to /snekbox/config/snekbox.cfg within the container.
GitHub Actions run 4796672930 succeeded.
Looks good to me! Thanks for this.
Would be nice to remove the strike through on this text too, now that the CJ is over.

Doesn't need to be done in this PR if you don't want to though, as it's not directly related.
Looks good to me! Thanks for this.
Would be nice to remove the strike through on this text too, now that the CJ is over.
Doesn't need to be done in this PR if you don't want to though, as it's not directly related.
will add it it is a simple and think can go in the pr only
GitHub Actions run 4800563588 succeeded.
GitHub Actions run 4805384048 succeeded.
GitHub Actions run 4807871414 succeeded.
Connected!
GitHub Actions run 4808961482 succeeded.
GitHub Actions run 4814504075 succeeded.
This means that you change the ctor of SendBookmark to assign an empty list to self.clicked upon instantiation
I'm not sure I'm understanding what you mean by this, sorry
GitHub Actions run 4814624808 succeeded.
A view is unique per interaction, and will live until it times out/bot dies.
What I'm saying is, the view is now instantiated with a list click that contains the id of the first person who invoked it.
You can't guarantee that the user is allowing DMs, so when that's not the case, the clicked list will contain that user's id whereas we couldn't really send the bookmark.
What I'm proposing to fix this is that you instantiate clicked to be an empty list, and you only append to it in...
Connected!
Sentry Issue: BOT-3FW
ClientException: Parent channel not found
(1 additional frame(s) were not displayed)
...
File "bot/exts/moderation/clean.py", line 645, in purge
await self._clean_messages(ctx, channels="*", users=users, first_limit=age)
File "bot/exts/moderation/clean.py", line 404, in _clean_messages
deletion_channels = self._channels_set(channels, ctx, first_limit, second_limit)
File ...
Relevant discussion/testing #mod-spam message
GitHub Actions run 4820048329 succeeded.
GitHub Actions run 4824581749 succeeded.
GitHub Actions run 4824590936 succeeded.
Includes the tag for the message content intent, describing use case and importance.
GitHub Actions run 4825988633 succeeded.
@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 updates.
The current documentation (for Cogs and Extensions) and the [examples in the d.py repo](https://githu...
I think the explanation of how the gateway intents bitfield is implemented is necessarily important here - we want to explain how to do something rather than how something works, if that makes sense. So something like
The discord gateway only dispatches events you subscribe to, which you can configure by using "intents"
Superfluous after previous line
The message content intent is what determines if an app will receive the actual content of newly created messages
GitHub Actions run 4826176236 succeeded.
Last few changes. I think the codeblock example is probably the most important, since it actually shows how users can enable message content intent themselves rather than knowing how it works conceptually
```py
intents = discord.Intents.default() # create a default Intents instance
intents.message_content = True # enable message content intents
bot = commands.Bot(command_prefix="!", intents=intents) # actually pass it into the constructor
This line is superflous
GitHub Actions run 4826263115 was cancelled.
GitHub Actions run 4826264543 succeeded.
I'd just like for this to tie back to the main issue of command handlers not running
The message content intent is what determines if an app will receive the actual content of newly created messages. Without this intent, discord.py wouldn't know which command handler to trigger so none of your commands will work.
GitHub Actions run 4826305860 succeeded.
The Discord gateway only dispatches events you subscribe to, which you can configure by using Gateway Intents.
GitHub Actions run 4826513266 failed.
I think this should also specify that message content is a privileged intent so it has to be enabled in the dev portal too
GitHub Actions run 4826544661 succeeded.
GitHub Actions run 4827661676 succeeded.
GitHub Actions run 4830848005 succeeded.
Instead, use [`@bot.listen`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.listen) to add a listener. Listeners get added alongside the default `on_message` event, preventing an override of on_message, and allowing prefix commands to still be invoked.
When registering the `on_message` event, prefix commands may stop working as it overrides the default behaviour of the `on_message` event.
GitHub Actions run 4831692467 was cancelled.
GitHub Actions run 4831694038 succeeded.
GitHub Actions run 4831908541 succeeded.
Hello @fgme9, is there something missing from this issue, or can we close it?
@jchristgit See @hedyhli's message here for some solutions
#dev-contrib message
I saw these but I don't really have the CSS-fu to drive it to the finish line with the vertical stacking :(
Hey there, so I've played around with the HTML a little and it seems this patch works:
https://paste.pythondiscord.com/raw/fexodipane
Basically comparing the elements from before this PR and after, the container appears to gained a height, and the breadcrumb <section> also changed because of the added flex div element. So I decided to take it out of the container, then modify the CSS classes a little.
Hopefully this diff isn't a 'hacky' fix though (otherwise it might pose problems in...
Connected!
GitHub Actions run 4839075529 succeeded.
Connected!
GitHub Actions run 4839078852 was cancelled.
GitHub Actions run 4839085130 succeeded.
Connected!
GitHub Actions run 4839086319 was cancelled.
GitHub Actions run 4839091505 succeeded.
Connected!
Connected!
Connected!
title: "The discord.py `on_message` event"
IMO we don't need spaces before/after codeblocks
Instead, use [`@bot.listen`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.listen) to add a listener. Listeners get added alongside the default `on_message` event, rather than overriding it, so prefix commands can still be invoked as usual:
```python
Is there any point giving an example if it's not a recommended way of doing things? Makes the embed a bit shorter and more direct without. We can still leave the text above.
Could you rename the file to message-content-intent.md to make it clearer. You can add an alias so the tag can be invoked with the shorter version (see for example https://github.com/python-discord/bot/blob/main/bot/resources/tags/underscore.md)
title: "Discord Bot Message Content Intent"
24e3b5a Do not account for jump urls for voice channels... - shtlrs
GitHub Actions run 4839196644 succeeded.
I think we should consider (probably not in this PR) changing the type hints for any functions that can take a
FakeContext, since justContextis misleading and makes it easy to introduce bugs like this.
I think the issue now is that we have 3 context classes: Context, FakeContext and FilterContext that are being used for conversion, and post_infraction takes either Context or FakeContext.
In this particular case, I think it's an instance of `FilterContex...
Connected!
Places like this function https://github.com/shtlrs/bot/blob/6025015b471675de9f7eab9197899dd3eafcb4b0/bot/exts/moderation/infraction/_utils.py#L79 are currently type hinted as getting a Context, but they may instead get a FakeContext, which does not implement the full functionality of Context.
We should either update the type hints, or try and neaten stuff up another way that will help avoid bugs like https://github.com/python-discord/bot/issues/2555.
GitHub Actions run 4839327904 was cancelled.
GitHub Actions run 4839328384 succeeded.
For an in-depth guide on mutability see [Ned Batchelder's video on names and values](https://youtu.be/_AEJHKGk9ns/).
That's what I thought too, I was debating on whether I should delete that entire section but just deleting the example seems like a good choice
GitHub Actions run 4839343763 succeeded.
GitHub Actions run 4839361389 succeeded.
GitHub Actions run 4839366021 succeeded.
GitHub Actions run 4840902372 succeeded.
GitHub Actions run 4840911320 succeeded.
GitHub Actions run 4840919627 succeeded.
Could you rename the file to
message-content-intent.mdto make it clearer. You can add an alias so the tag can be invoked with the shorter version (see for example https://github.com/python-discord/bot/blob/main/bot/resources/tags/underscore.md)
GitHub Actions run 4848889742 succeeded.
GitHub Actions run 4848893813 succeeded.
GitHub Actions run 4848891774 succeeded.
GitHub Actions run 4850597704 succeeded.
GitHub Actions run 4851340671 succeeded.
Connected!
To align better with the recent change that bot has witnessed, we've decided to also migrate the rest of the bot to use the same schema/package.
GitHub Actions run 4851797676 failed.
GitHub Actions run 4853010189 succeeded.
affd417 Update filtering.py to reduce nickname alert spam - lxnn
[python-discord/bot] New branch created: filtering\-nickname\-check\-fix
This updates the on_voice_state_update listener of the filtering cog.
Currently, it calls self._check_bad_name where it should call self._check_bad_display_name. The difference is that the latter method rate-limits how often a filtering alert is sent for a specific user's display name. Using the former method results in spammy alerts when a user with a bad display name is in a voice channel.
GitHub Actions run 4855622867 succeeded.
Bumping this PR, #2390 has been merged.
@algmyr Greetings, will you be continuing this PR?
Thanks!
...I can even implement this as part of my solution to https://github.com/python-discord/bot/issues/2492.
In hindsight, I think it'll be better to keep them isolated, so I'll be doing a separate PR for this issue.
@Ibrahim2750mi Greetings. Please fix the conflicts contained within this PR.
Thanks!
Although I did not test this, the code itself looks good to me.
cc5a152 Bump sentry-sdk from 1.21.0 to 1.21.1 (#1259) - dependabot[bot]
Connected!
GitHub Actions run 4857107282 succeeded.
Actually, thinking further on this, I suppose this is also an issue in sir-lancebot, right?
I've checked locally and, as an example, the easter/halloween/etc. reactions to keywords have the same issue, so we'd presumably need handling there, which makes me think maybe this should be somewhere in bot-core to prevent duplication across the two bot repos? Although I don't think bot-core currently has a global error handling system (if that's even possible).
Tl;Dr; should this be PRd to bot...
GitHub Actions run 4857122437 succeeded.
GitHub Actions run 4857116968 was cancelled.
There doesn't seem to be a pattern available to emit a yes/no response from the interaction. Only a success/timeout.
Unless we want to wrap the entire infraction step in a method, structure it as a callback, and hand it to the buttons for this interaction; I'm not seeing a way around toting the boolean flag value around. To complicate that hand-off, it looks like the result of the infraction call needs to be returned again from [the calling method here](https://github.com/python-discord/...
Aliases need to be in the same format as Python lists, see here for an example.
aliases: ["mcintent", "message_content", "message_content_intent"]
GitHub Actions run 4857215121 succeeded.
I'd also like to include the fact that you can have more than one listener per event, unlike the event decorator
Instead, use [`@bot.listen`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.listen) to add a listener. Listeners get added alongside the default `on_message` event, rather than overriding it, so prefix commands can still be invoked as usual and you can have more than one handler for each event type (unlike events). Here's a...
Perhaps we can recommend the traditional usage of @bot.listen() where the function name is used as the event:
@bot.listen()
async def on_message(message):
This seems a bit redundant at the end talking about having more than one handler for each event. The beginning of the sentence states listeners are added alongside. Though it isn't a big difference, and the information could be helpful.
I would provide examples of both implementation methods.
# Method 1
@bot.listen('on_message')
async def message_listener(message):
... # do stuff here
# Method 2
@bot.listen()
async def on_message(message):
GitHub Actions run 4857383528 succeeded.
Maybe we could combine the first and last part?
"Listeners get added alongside the default on_message which means you can have multiple handlers for the same event. This means prefix commands can still be invoked as usual. Here's an example:"
GitHub Actions run 4857415868 succeeded.
GitHub Actions run 4858074625 succeeded.
Chiming in for devoops. Aside from the tokens, all the other constants should be given defaults within the app itself.
Chiming in for devoops. Aside from the tokens, all the other constants should be given defaults within the app itself.
Which constants are lacking defaults here ? Aside from the tokens, the Reddit, Redis, Logging are the ones that have attributes without defaults, and they're all secrets, except for the Logging one.
Iโm going off the content of the PR message. If those already have constants added, this PR doesnโt need to do anything further.
Iโm going off the content of the PR message. If those already have constants added, this PR doesnโt need to do anything further.
Ah, those need to be updated in our pods/cluster. (I want to assist when it's going to be done)
GitHub Actions run 4860417961 succeeded.
Connected!
I think that is a good way of phrasing it.
GitHub Actions run 4862438301 succeeded.
Connected!
Connected!
0969e49 Bump pre-commit from 3.2.2 to 3.3.0 - dependabot[bot]
ca2ae77 Merge pull request #2575 from python-discord/de... - shtlrs
c838246 Bump ruff from 0.0.263 to 0.0.264 - dependabot[bot]
a8c9f07 Merge pull request #2574 from python-discord/de... - shtlrs
6facdfb Merge branch 'main' into filtering-nickname-che... - wookie184
affd417 Update filtering.py to reduce nickname alert spam - lxnn
6facdfb Merge branch 'main' into filtering-nickname-che... - wookie184
5f1c7b1 Merge pull request #2573 from python-discord/fi... - wookie184
[python-discord/bot] branch deleted: filtering\-nickname\-check\-fix
GitHub Actions run 4864102773 succeeded.
Connected!
The entire error handler could be migrated over to botcore, which would be the best way of doing that. I was planning on doing that at some point after #2439 and #2436 are merged.
If it's added to bot now it'll be copied across in the migration, which would be fine. We could wait for it to be in botcore to add to lancebot since this is a low priority issue. I don't really mind.
5b49b18 Bump pre-commit from 3.2.2 to 3.3.0 (#957) - dependabot[bot]