#dev-log

1 messages ยท Page 9 of 1

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

A false positive here would be

!e raise ValueError("EOFError: EOF when reading a line")

I also realised this and commented it in the first review there wookie recommended to leave this as no user would do this.

Not sure this is worth handling though. If you tried to find input in the eval input you would also have a false positive in the form of someone shadowing the built-in, as beginners often do.

Just doing if "input" in code: is a grave mistake...

regal archBOT
#

Is there a reason we would rather implement a file ignore system than disable Python bytecode generation? Are there eval use cases that would rely on it being generated?

Does the current ignore system support ignoring directories? The fnmatch docs state that a forward slash is not treated specially, but I'm unsure of what that means in practice. In any case, it looks more limited than gitignore so documentation is better off avoiding making such comparison.

it stemmed from this follow...

regal archBOT
#
[python-discord/bot] branch deleted: trim\-help\-command\-error\-title
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

afb2ff6 Store time of last vote in redis to prevent vot... - wookie184
b065b24 Fix tests - wookie184
7c0c5f8 Merge branch 'main' into 2301-fix-voting-condit... - wookie184
5e21f97 Merge branch 'main' into 2301-fix-voting-condit... - wookie184
86c4511 Merge branch 'main' into 2301-fix-voting-condit... - wookie184

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

As per the comment above the dependency in the pyproject.toml, this shouldn't be done currently.

It doesn't seem like there's been any progress on the upstream issue (https://github.com/matthewwithanm/python-markdownify/issues/31), so we should probably go ahead with monkey-patching whitespace_re back to how it was before the change in this commit if we can confirm that works: https://github.com/matthewwithanm/python-markdownify/commit/97c78ef55b7a5be1d3782d393f3ccfbee1056671#diff-a790...

odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: handle\-shhh\-errors
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/branding] New branch created: pycon\-us
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: Python\-3\.11
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: Python\-3\.11
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
regal archBOT
#
[python-discord/infra] New branch created: GDWR/match\-notify\-names
regal archBOT
#
[python-discord/infra] branch deleted: GDWR/match\-notify\-names
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

I like the idea of having an enforceable tag group vs not. It lets us keep things a bit organized without sacrificing fast tag invoking, but if needed we can still de-conflict tag invocations. Will probably need a core dev weigh in as it changes the original scope/intent of the feature.

I think the slash command should match whatever the !tag does, just for consistency. It would feel weird to have the two ways to invoke a tag be different.

regal archBOT
#

I feel like it would be nicer to only display the overrides in the UI, seeing all the default values feels mostly unnecessary and a bit overwhelming.

An alternative is if it could also be more clever in only showing relevant values, so no empty lists/null values (unless they're overrides). E.g. the enabled_* and disabled_* lists could be hidden if they're empty, and infraction_reason, infraction_duration, infraction_channel could also be hidden if they're null.

regal archBOT
#

I'm a bit conflicted about this. It feels like seeing the full context is important to avoid unexpected behavior. For example having a category disabled by default, and then not figuring out why this isn't working. Or the filter deleting messages by default, and not remembering to switch it off because the value is not in front of you.

The alternative is possible.. I'll have to play with it to see if it makes sense.

regal archBOT
#
[python-discord/bot] New branch created: mbaruh/timeout
#
[python-discord/site] New branch created: mbaruh/timeout
#

Note to the core-devs, once this is ready please leave the merging to me.

Changes

  • Makes use of the native timeout instead of adding the Muted role.
  • Renames all references to the "mute" infraction to "timeout", except in command aliases for ease of transition.
  • Maintains support for the old functionality (pardoning users with the muted role, applying timeout to users who rejoin and are not yet timed out because they originally had the role). This can be removed (the relev...
odd spireBOT
regal archBOT
regal archBOT
#

Sounds fine to me, although the cog would need to go through some structural changes to support auto-complete. Technically it could produce a static mapping of all possible terms and their appropriate info (type, link etc.), since I don't see why it would change without the bot restarting in the process. It would have to be the last cog to be loaded though.

regal archBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: combine\-command\-error\-messages
regal archBOT
#

closes #126

Notes:

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\_stats
odd spireBOT
oak estuaryBOT
regal archBOT
#
[python-discord/bot] New branch created: mbaruh\-patch\-1
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
regal archBOT
#
[python-discord/branding] New branch created: events\_2023
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/branding] branch deleted: events\_2023
odd spireBOT
regal archBOT
#
[python-discord/branding] New branch created: holi\_duration
odd spireBOT
regal archBOT
#
[python-discord/branding] branch deleted: holi\_duration
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/king-arthur] New branch created: add\-pre\-commit\-hooks
odd spireBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: update\-deps
odd spireBOT
oak estuaryBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#

So far we've had https://github.com/python-discord/bot/blob/bf8f8f4c1f9522a942c88ca69a2d48427d2bbc28/bot/exts/backend/security.py#L21
Which makes sure that prefix commands are run in the server and not in DMs.

This doesn't seem to work for slash commands so we're getting bugs for various features which don't work in DMs.

We should either have a check which handles slash commands, or find some other way to deal with it.

thin oysterBOT
#
Sir Robin

Connected!

regal archBOT
regal archBOT
#

If that's the case then we no longer need the (reviewed) part. Also recent nominations and others by autoreview priority doesn't tell me what it means for the nomination to be recent (which I think what you were trying to accomplish with the (ready for review)). That's why I suggested Nominations Ready for Auto-Review, because it implies that recent nominations won't be auto-reviewed.

regal archBOT
#

If that's the case then we no longer need the (reviewed) part.

I made it so it only appears for the newest/oldest subcommands which don't do any grouping.

Also recent nominations and others by autoreview priority doesn't tell me what it means for the nomination to be recent (which I think what you were trying to accomplish with the (ready for review)).

It's explained in the command help, although the actual conditions are quite complicated so it's hard to get all informatio...

regal archBOT
#

I suggest to do this differently & move the issue to bot_core

This could be as simple as:

    async def _sync_app_commands(self) -> None:
        """Sync global & guild specific application commands after extensions are loaded."""
        await self._extension_loading_task
        await self.tree.sync()
        await self.tree.sync(guild=discord.Object(self.guild_id))
+      for command in self.tree.walk_commands():
+           command.guild_only = True
regal archBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
oak estuaryBOT
regal archBOT
#
[python-discord/bot] New branch created: rule\-config\-fix
odd spireBOT
odd spireBOT
oak estuaryBOT
oak estuaryBOT
regal archBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: fix\-1121
odd spireBOT
regal archBOT
#

Relevant Issues

<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #1121

Description

Changed code so that it handles when the two .get() calls return None, sending an error to the command invoke and also logging a warning.

Did you:

  • [x] Join the Python Discord Community?
  • [x] Read all the comments in this template?
  • [x] Ensure there is an issue open, or link relevant discord d...
odd spireBOT
odd spireBOT
regal archBOT
#

This fixed the way pydantic tries to pickup nested values when the attributes have underscores in them.

Without this, a case like the following with a delimiter of _

class Webhook(BaseModel):
    id: int
    channel: Optional[int]


class _Webhooks(EnvConfig):
    EnvConfig.Config.env_prefix = "webhooks_"

    big_brother: Webhook = Webhook(id=123456789, channel=Channels.big_brother)

and an .env.server like this

webhooks_big_brother_id=987654321
```...
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
regal archBOT
regal archBOT
#

@matiaslagoevia I can assign you if you want to work on this.

The change should be as simple as adding the python help-channel id to the list of allowed channels, just like in the snippet attached to the issue

Thanks! I wasn't sure since the OP mentioned two different approaches in the description.

I'd be inclined to add it here, instead of [here](https://github.com/python-discord/sir-lanc...

regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/snekbox] branch deleted: bytes\-output
#
[python-discord/bot] branch deleted: snekbox\-files
oak estuaryBOT
regal archBOT
regal archBOT
#
[python-discord/snekbox] New branch created: files\-exclude\-hidden
regal archBOT
regal archBOT
#

How about:

### Configure the Bot
The bot needs two configuration files to work: 
#### .env.server
Contains all server related configuration such as: channel IDs, role IDs, emojis, etc. But also things that define rules in the server like help channel timeout, number of messages a user needs to voice-verify, etc.
#### .env
Contains configuration related mostly to external services, like whether the bot should use metricity or not, redis password, etc.

When this is done, w...

odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#

We have recently added keyword support for the rules command which enables people to invoke it more easily without having to remember what each number refers to.

This can be further simplified thanks to the autocomplete feature that comes with slash commands, and would then help people find the rule they intend in a more easier fashion.

regal archBOT
odd spireBOT
regal archBOT
#

Yes I'm in favor of still explaining how the .env.server is structured and how to modify specific constants, I just don't think the huge card is needed anymore.

I tried used the script yesterday, and it's very simple. In the planning stages I talked about needing a transition script from the old yaml config to the new one, but honestly it's much simpler to just run the script, even if it means starting a new server. I don't even want to suggest setting the entire .env.server file manually ...

odd spireBOT
regal archBOT
#

It does make sense & that's what I'm suggesting as well. Sorry if that wasn't very clear.
To make this explicit, what I had in mind is explain that we will always need two config files for bot to work. We will state their names & their functions. (just like in the wording you highlighted). Then, in the manual & auto section, we will mention what needs to happen with one of them. Meaning that for the auto section, .env.server will be created automatically, and .env needs to have X, Y and Z. ...

#
[python-discord/snekbox] branch deleted: files\-exclude\-hidden
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

night lilyBOT
#
Sir Lancebot

Connected!

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

I will fix the tests as soon as I get some time but I'm not sure why the tests didn't fail during my earlier pushes. Might be random and may even disappear on re-running the tests- nevertheless, will try fixing.

Passes locally btw

poetry run task test
=============================== test session starts ================================
platform linux -- Python 3.10.9, pytest-7.2.0, pluggy-1.0.0
rootdir: /home/vivek/Programs/python/contrib/pydis/bot, configfile: pyproject.toml
...
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

Closes #2462

This switches the order of the env files that Pydantic looks into.

It will always look in .env.server first, and if there are values that need to be overriden for some reason, then they'll need to go inside .env`, which is where Pydantic will look for them last

This also has the easter egg of adding the default ๐Ÿ—‘๏ธ emoji to the .env.server upon botstrapping

odd spireBOT
regal archBOT
regal archBOT
#

Summary

Sending this code:

# #bot-commands message
import os

x = ""
for _ in range(1000):
    x += "a/"
    os.mkdir(x)

open(f"{x}hello.txt", "w").write("test")

Got this error:

# #bot-commands message
ClientResponseError: 500, message='Internal Server Error', url=URL('http://snekbox.default.svc.cluster.local/eval')

Which, according to [gr...

regal archBOT
#
[python-discord/snekbox] New branch created: file\-scan\-recursion\-fix
regal archBOT
#
[python-discord/bot] New branch created: fix\-eval\-message\-limit
regal archBOT
#
[python-discord/site] branch deleted: vivek/add\-jump\-url\-field
#

8a95402 Add jump_url field to infraction model - vivekashok1221
19afe0d Remove typo - vivekashok1221
19e426c Merge branch 'main' into vivek/add-jump-url-field - vivekashok1221
ed35776 Replace CharField with URLField and set default... - vivekashok1221
306855f Merge pull request #824 from python-discord/viv... - shtlrs

odd spireBOT
regal archBOT
#

46a7b97 Display message link in infraction log - vivekashok1221
c6af8bf Include message link in mod-log embeds - vivekashok1221
ed59a9f Format jump url bot-side - vivekashok1221
0cc7fa3 Display "N/A" for infractions in ModMail - vivekashok1221
4759c1f Merge branch 'main' into vivek/jump-url-infr-log - vivekashok1221

#
[python-discord/bot] branch deleted: vivek/jump\-url\-infr\-log
oak estuaryBOT
regal archBOT
#

Humm, i'll have a look at the replying feature & see if there's a way to support that.
As for the message after the rule, i personally have never used it like that, and when I do see it being used in that fashion, i tend to jump directly at the rule embed.

But you're right, it's a different scenario, and might not be what we want.

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

We have had the feedback that when interacting with the new roles view, users will get an error from the bot saying that this view wasn't invoked by them.

This is due to the way discord.py routes requests when views have preset custom_ids, which result in a "uniqueness" of that view whenver it's invoked. So whenever a view is instantiated with a custom id, all requests will always be routed to that one instead of having one view per invoker.

The interaction_check is also kept since we...

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

e084a7e switch order of env files to be parsed - shtlrs
1a7a8a2 write emoji_trashcan to .env.server upon botstrap - shtlrs
b4bb64f change mode to "wb" - shtlrs
c887171 Merge branch 'main' into preserve-personal-config - HassanAbouelela
912bcff Merge pull request #2463 from shtlrs/preserve-p... - shtlrs

oak estuaryBOT
regal archBOT
#

Discord templates do not include support for community-server based features, such as forum channels, announcement channels, etc...

This makes it not possible to have an out of the box solution to map the help system forum to the .env.server file.

The way I propose to do this is, upon launching botstrap.py:

  1. Check if the server is a community server -> If not: make it one (should be a simple HTTP call that adds the [COMMUNITY FEATURE](https://discord.com/developers/docs/resourc...
regal archBOT
regal archBOT
#

Staff consensus in today's meeting is that we don't want to go forward with it, largely for the same reasons we removed the old !ask tag. The link doesn't clarify what exactly is wrong with the question asked, which is very context specific, and has a high chance of being used passive-aggressively by being dumped at people (sometimes several times) with no further explanation, as we have seen with the old tag.

regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/snekbox] New branch created: sd/sentry
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\-channel\-blacklist
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: fix\-channel\-blacklist
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

I'm curious, will we ever fall into this case where self.message is None ?
The timer will start when the view is sent, and it cannot timeout in the meantime (I tried putting timeout to 1 second and an asyncio.sleep(5) before sending it :P just to verify), so view.message will always be present since that's not something that can fail.

If what I'm saying is true, then the if self.message check can be removed

regal archBOT
#

Closes #168
Adds support for evaluating code in different python versions via the version argument.

This PR is a PoC to discuss the approach, and find issues with the idea. There's a versions.json
file which specifies the supported python versions, and a make target for re-generating the
relevant configuration files and dockerfile to enable the new versions. Packages are isolated
based on python version.

The current approach was chosen for being relatively easy, quick, and lightweight wh...

regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

Another approach would be to base it off nsjail config files. Each binary (including different Python versions) would have its own config file, and we would scan a directory for config files. The API would accept a config name. This would offer more flexibility in supporting multiple binaries, as different binaries may require different mounts, environment variables, etc. I don't think this approach is mutually exclusive with my previous proposal, so we can revisit this in the future as well.

regal archBOT
#

I wonder how much of the config will be repeated. I imagine a lot of the python (for the cpython implementations) configs will be very repetitive, but even other interpreters would presumably need similar cgroup configuration, mounts, etc. We might be able to get around the duplication problem by providing overrides to be applied in python (or if nsjail supports combining configs?) instead of multiple config files. Either way, it's a problem for another day.

regal archBOT
regal archBOT
#

I'd rather we'd give the timer example.
decorators are not an easy topic for beginners, and if we're explaining how interpreters translate the syntax & how it executes them, we might as well keep the same example for consistency and also to avoid confusing beginners.

So you would demo the equivalent syntaxes, then you would give the execute example of both of them to demonstrate it even further

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

There is a test parsing symlink files for timeout, but that doesn't determine if the timeout occured due to the time.monotic() comparison timeout or by the signal. The signal timeout would be if a very large single file was parsed, or pathlib ends up in some loop.

But also added 2 new tests for time_limit successfully interrupting time.sleep and a long-running built-in C function (math.factorial) in [1af5bf0](https://github.com/python-discord/snekbox/pull/173/commits/1af5bf0a92a5a65...

regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

I'm reviewing this again - what's the benefit to passing binary paths instead of version names. Persumably we're not going to take in arbitrary paths, but one from a list of pre-defined ones such as the ones in version.json. That allows us to continue giving them human-readable names. At that point the path is an implementation detail with end users only caring about the name (CPython x.y.z vs pypy x.y.z for example).

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

I think what Chris means is that we suppose a user has their DMs open, so you instantiate the SendBookmark view before you dm that user. Now the instances has self.clicked assigned with that user's id.
If dm_bookmark throws, you'll empty that list (view.clicked = []) since the user did click, but didn't receive the bookmark.
This allows them to enable their DMs & click again, which will allow them to receive the bookmark now.

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

Currently, we only state that we're a large community, but the real scale isn't properly inferred there.

I'd like to back that up with a number (because it's cooler), and that number being how many members we have.

This is possible by making an endpoint in our site project that'll query the number of members we have based on our server's invite link.
Including the with_counts query parameter will do that as defined [here](https://discord.com/developers/docs/resources/invite#get-in...

regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: mbaruh/timeout
#
[python-discord/bot] branch deleted: mbaruh/timeout
#

fdece3c Migrate from role-based mutes to native timeouts - mbaruh
8cfd1b2 Reduce long timeout to 28d instead of denying it - mbaruh
a05ab5b Merge branch 'main' into mbaruh/timeout - mbaruh
46e9a1b Mention target user in cap message - mbaruh
ea0afec Add role hierarchy guards for timeouts - mbaruh

odd spireBOT
oak estuaryBOT