#dev-log

1 messages ยท Page 11 of 1

regal archBOT
#
[python-discord/bot] branch deleted: fix\_filters
odd spireBOT
oak estuaryBOT
regal archBOT
#
[python-discord/bot] New branch created: disable\_name\_check
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: disable\_name\_check
oak estuaryBOT
regal archBOT
#
[python-discord/bot] New branch created: infr\_emoji
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#

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...

night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#
[python-discord/bot] New branch created: thread\_filter
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\_modlog
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\-2500
regal archBOT
#

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...

odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: fix\_modlog
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
#

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 ...

odd spireBOT
regal archBOT
#

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...

odd spireBOT
regal archBOT
oak estuaryBOT
regal archBOT
odd spireBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[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...

odd spireBOT
regal archBOT
#

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
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
oak estuaryBOT
#

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.

regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: 2302\-activity\-in\-reviews
oak estuaryBOT
regal archBOT
#
[python-discord/site] New branch created: add\-resources\-readme
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: vivek/mod\-edit\-log\-embed\-jump\-url
odd spireBOT
oak estuaryBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[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: supress\-notfound\-messages\-on\-delete
#
[python-discord/bot] branch deleted: vivek/infra\-log\-add\-jump\-url
regal archBOT
#
[python-discord/bot] New branch created: flake8\-to\-ruff
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\_alert\_message\_logging
odd spireBOT
regal archBOT
#

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...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: new\_infr\_embeds
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

Currently we only send new PEP updates to #mailing-lists if they were "created" on the same day that the bot is checking for them.

https://github.com/python-discord/bot/blob/ea0b227801f19d14338e7e582d745ea250773370/bot/exts/info/python_news.py#L116-L120

This does not work in most cases, as when PEPs are created is not the same as when they are published.
https://peps.python.org/pep-0001/#pep-header-preamble

The Created header records the date that the PEP was assigned a number

...

regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#

Yeah, each eval invokes a separate nsjail process which IIRC uses execve to replace itself with the Python process after it has set up the namespacing and whatnot. With PID namespacing enabled in nsjail, I'm not sure if mounting /proc would just mount the host system's /proc or if it would somehow be restricted by the namespacing.

Each process would see /proc/ as the following

How would we accomplish that? Would we have to know the PID of the process ahead of time? Mount options...

regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: cleanup
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] branch deleted: flake8\-to\-ruff
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

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...

odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: fix\_alert\_message\_logging
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
regal archBOT
#
[python-discord/bot] New branch created: pep\-news\-date\-fix
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: snekbox\-spacing\-fix
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: filtering\-class\-name\-fixes
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: nominations\-thread\-jump\-in\-archive
odd spireBOT
regal archBOT
#

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...

regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: new\_infr\_embeds
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: use\-paste\-service\-for\-long\-autoban\-filters
odd spireBOT
oak estuaryBOT
odd spireBOT
oak estuaryBOT
regal archBOT
#
[python-discord/bot] branch deleted: nominations\-thread\-jump\-in\-archive
odd spireBOT
oak estuaryBOT
regal archBOT
#
[python-discord/site] New branch created: Simplify\-the\-bot\-contributing\-guide
#
[python-discord/bot] New branch created: correct\-compose\-file
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
regal archBOT
regal archBOT
#

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...

regal archBOT
#
[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...

odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[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 ...

odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: faster\-tests
oak estuaryBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: staff\-app\-readme
odd spireBOT
regal archBOT
#
[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).

odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: swfarnsworth\-rule\-5
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: update\-rule\-5
odd spireBOT
regal archBOT
#

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 ...

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

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:

regal archBOT
#
[python-discord/bot] New branch created: swfarnsworth/help\_thread\_close\_command
odd spireBOT
regal archBOT
#

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.

regal archBOT
regal archBOT
#

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...

regal archBOT
#
[python-discord/bot] New branch created: filtering\-ignore\-bot\-edits\-fix
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: filtering\-ignore\-bot\-edits\-fix
oak estuaryBOT
regal archBOT
odd spireBOT
oak estuaryBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: dont\-collect\-coverage\-on\-test
odd spireBOT
oak estuaryBOT
regal archBOT
#

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

odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: staff\-app\-readme
odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: swfarnsworth/help\_thread\_close\_command
oak estuaryBOT
regal archBOT
#
[python-discord/site] New branch created: independent\-unit\-tests
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: hedyhli\-edit\-on\-github
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: update\-docker\-compose
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: rule\-crosscheck
regal archBOT
regal archBOT
#

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=...
regal archBOT
#
[python-discord/bot] branch deleted: update\-docker\-compose
oak estuaryBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: independent\-unit\-tests
#
[python-discord/site] branch deleted: Simplify\-the\-bot\-contributing\-guide
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: lesser\_yellow
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
odd spireBOT
regal archBOT
#

@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...

regal archBOT
#

Hi had a few question( In comparison with the page for google jam8)

  1. Unable to find the team member names for the winners, so should I remove that block.

  2. 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.

  3. 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.

regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

@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...

odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

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:/...
regal archBOT
#

If a user is temporarily banned, and a moderator attempts to permanently ban said user, the following code will never return anything but None.

https://github.com/python-discord/bot/blob/f94505ac975888b259ea2d07b4442d6d908352f8/bot/exts/moderation/infraction/infractions.py#L490

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 ...

odd spireBOT
regal archBOT
#

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 ...

odd spireBOT
regal archBOT
#

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.

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...

regal archBOT
regal archBOT
#

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.

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

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...

oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/king-arthur] New branch created: migrate\-to\-ruff
odd spireBOT
regal archBOT
#
[python-discord/king-arthur] branch deleted: migrate\-to\-ruff
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

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...

regal archBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

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.

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...

oak estuaryBOT
regal archBOT
#

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.

odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
oak estuaryBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[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.

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

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...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

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/...

odd spireBOT
regal archBOT
#

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...
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: filtering\-nickname\-check\-fix
odd spireBOT
oak estuaryBOT
regal archBOT
#

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.