GitHub Actions run 4321302364 succeeded.
#dev-log
1 messages ยท Page 9 of 1
Connected!
GitHub Actions run 4321310475 succeeded.
GitHub Actions run 4322430761 succeeded.
This PR sets the stage for #2425 where we will be bubdling workflows into a main one, which will later handle the dispatching.
The reason we added this is that the workflows use the workflow_run trigger use the version in the main branch, so Status Embed won't be triggered by #2425
GitHub Actions run 4322632802 succeeded.
A false positive here would be
!e raise ValueError("EOFError: EOF when reading a line")
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.
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
inputin 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...
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...
updated to upload user files if last modified time changes.
in https://github.com/python-discord/snekbox/commit/36814de6f7a231c86b356ec27b649da5ffc85c44,
is now a dictionary of Path and original last modified time floats in https://github.com/python-discord/snekbox/commit/36814de6f7a231c86b356ec27b649da5ffc85c44
Great additions, and some great style improvements as well.
Maybe it should be slightly longer than 30 days?
Not strictly related to this PR, but maybe there should be a end_nomination QoL function?
I think it's worth specifying the duration of inactivity so that people don't need to look into the code for it.
Woah, since when was this a root alias. Maybe I would've used it more if I knew. Worth keeping?
The implementation of get_or_fetch_channel makes me generally uncomfortable since there's no error handling. You'll be bombarded with errors if say something happens to the channel.
3686f60 add the roles channel to the config - shtlrs
5795140 add the AllSelfAssignableRolesView and its corr... - shtlrs
6ab9f9c add the logic for attaching the persistent view - shtlrs
b25ad80 add assignable_roles as a property to the Claim... - shtlrs
1d60403 add implementation of the button's callback tha... - shtlrs
[python-discord/bot] branch deleted: trim\-help\-command\-error\-title
GitHub Actions run 4323567071 succeeded.
Connected!
GitHub Actions run 4323608096 succeeded.
7500eee Trim query in command not found error to avoid ... - wookie184
679cb77 Migrated !tags command to slash command /tag - Ibrahim2750mi
1cff5bf Update tests for /tag as of migration to slas... - Ibrahim2750mi
861f5b2 Merge branch 'main' into migration/tag - Ibrahim2750mi
1bd0310 Merge branch 'main' into migration/tag - Ibrahim2750mi
GitHub Actions run 4323657552 succeeded.
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
e2cfba8 Add CI to the list of trigger workflow runs (#2... - shtlrs
GitHub Actions run 4323681561 succeeded.
GitHub Actions run 4323706470 was cancelled.
Connected!
GitHub Actions run 4323724591 succeeded.
Given https://github.com/python-discord/bot/pull/2390, implementation of the new filtering list won't be addressed in this PR (relevant code needs to be removed) and will wait until after the mentioned PR is merged. This PR will focus on the unfurling mechanic itself, and is up for grabs.
GitHub Actions run 4324025150 was cancelled.
Because otherwise they'll have the same concurrency group & will cancel each other out
What will have the same group?
GitHub Actions run 4324030702 succeeded.
main.yaml & this one ( and lint-test too), since they'll all be part of the same pipeline
oh wait, this is the sentry_release, which is a work_flow call. we can remove these concurrency rules entirely, since this will always run under that flow.
Same as the concurrency rules in lint-test
yeeted here 6e9dcb7441cb19475e1c0625be6122ee754ec476
GitHub Actions run 4324069875 succeeded.
GitHub Actions run 4324124912 succeeded.
GitHub Actions run 4324133730 succeeded.
GitHub Actions run 4324138557 succeeded.
This updates the python version that the bot runs on to 3.11
Actually, we might need to preserve the dev input we provide, I'll confim in a bit
GitHub Actions run 4324180808 failed.
[python-discord/bot] New branch created: fix\-ci
[python-discord/bot] branch deleted: fix\-ci
GitHub Actions run 4324201322 succeeded.
Connected!
I wanted to merge it as-is considering the source branch doesn't exist anymore, but it still contains bugs. This will need to be properly re-implemented.
GitHub Actions run 4324815264 succeeded.
So, what's the planned behavior for redirected output? Since those can't reply to the original message.
Perhaps a link button in the original !eval that links to the message in #bot-commands, and a link button in the result message sent in #bot-commands, that links back to the original !eval command?
Oh, and also, @e1pupper had noticed us that they will not be able to work on this. I'd be willing to take this up.
Sort of along the same lines as #2255 , how feasible would it be to add a modal with a TextInput that will be fed into input()?
GitHub Actions run 4325030082 succeeded.
Connected!
GitHub Actions run 4325063830 succeeded.
Sort of along the same lines as #2255 , how feasible would it be to add a modal with a
TextInputthat will be fed intoinput()?
I don't get whats the use of adding any input, eval command is not there to build an user interface. Any use of user input can be replaced be hard coded.
This PR is not ready, but the source branch no longer exists. Will need to be re-implemented in a different PR.
e5fbddb Add warning message when using input - Ibrahim2750mi
f0119fa Wookie's review - Ibrahim2750mi
f3c1038 Edit comment to match wookie's review - Ibrahim2750mi
f2e009d Merge branch 'main' into snekbox/handling-input... - wookie184
6d3d1cc Merge pull request #2422 from Ibrahim2750mi/sne... - wookie184
Connected!
when I try to start the bot it says it can't find the main.py file
Are you following this guide?
If yes then, you have to start the bot like this.
$ docker-compose up web -d
$ poetry run task start
If not then you should try following the guide from the start.
Hi @topogamer ๐
Thanks for opening up the issue.
Runtime errors like these and issues that might come up when you're setting up the bot can happen, and we'de rather discuss them in a channel called dev-contrib on our Discord server ( Join Us if you haven't already :p)
We usually open issues for bugs, new feature proposals, enhacements etc.
I'll close this for now, but please
- Mak...
Seems like allowed_users is a require argument, so I don't think any harm can come of it by just leave it
Fine by me, although I don't think it needs to be too long. What were you thinking? maybe 40 or 50?
!tp list is still one less character ;) I can add it back if you want it but i'd prefer keeping it removed.
FWIW I removed all and watched because I feel like it's harder to learn the cog commands if see them used with different invocations.
Given the names of the kwargs it wouldn't make sense to pass both as True.
I can't think of a better way of naming the options without adding e.g. an enum for criteria and order or splitting it into multiple functions, which feels a bit overkill given this works for the current case.
There is one on the cog, although it does it by user ID so would make an unnecessary API call to refetch the nomination in this case. Given it's a single line I think it's probably fine as is.
I think we'd want to know if the message wasn't being sent for some reason, so I wouldn't want to just ignore if the channel isn't found. An error feels like the best thing here IMO.
It would only be raised when a nominated member is banned, which should be pretty rare.
GitHub Actions run 4325984603 succeeded.
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...
e5fbddb Add warning message when using input - Ibrahim2750mi
f0119fa Wookie's review - Ibrahim2750mi
f3c1038 Edit comment to match wookie's review - Ibrahim2750mi
f2e009d Merge branch 'main' into snekbox/handling-input... - wookie184
6d3d1cc Merge pull request #2422 from Ibrahim2750mi/sne... - wookie184
oops didn't mean to update myself
Connected!
GitHub Actions run 4326256596 succeeded.
Connected!
a124464 Centralise error handling for commands invoked ... - wookie184
[python-discord/bot] New branch created: handle\-shhh\-errors
Closes #1620
The error that prompted the original issue can be reproduced my spamming !shhh very quickly. This PR is a more general improvement that fixes this issue, ensuring all errors raised by commands run from the error handler are redirected to the error handler.
GitHub Actions run 4326419070 succeeded.
Something like that yeah, 45 would work.
Hmm, I don't see the issue. You can order by priority, just in reverse.
Not a big deal though, since this doesn't affect any planned feature. Your call.
The days value isn't the same though
Ah right
Do you think we'd need an indication for those without recent activity
A ๐ค could work, though that has the issue you mentioned above of using implicit meanings. I guess it will be fine if it's documented in the help embed.
How about we also mention the last time someone was active here ?
I think it's fine to leave as is for now, we also count on waiting for @mbaruh's filters PR to get done so that we could merge.
I would then prune all the filter constants, and try to group the rest by context as well.
I see your point.
I guess it's fine to not over engineer this for this particular case. We can always bring it back up if we think it has an impact
@wookie184 I'll resolve my above comment that addresses the same point, and leave the discussion here
(my PR isn't blocking, by all means keep the constants there and I'll just resolve the conflict by deleting them)
I'd be willing to take this up.
Sounds good, i've assigned you
410e844 Update docs parsing code for new markdownify ve... - wookie184
GitHub Actions run 4328072749 succeeded.
Hmm, I don't see the issue. You can order by priority, just in reverse.
Yeah, although the current kwarg name is oldest_first, not in_reverse, and if I renamed it to in_reverse it would be less clear that it was sorting by age by default. Pretty minor, I know, but given it's not something we're using at the moment it seems easier to leave as-is.
Given #2422 I think it's fine to mark this as complete. This can be re-opened/a new issue opened if there's a concrete suggestion that would intuitively allow using input, but now there's a note in the output indicating what the error means.
Given the ๐ค idea below, you could use :userleave: from the bot's emojis in this case. Just a thought.
[python-discord/branding] New branch created: pycon\-us
Adds the following assets for PyCon US 2023.
Note: The Banner requires the user to have the Rubik Mono One Regular and Kulim Park fonts installed to render properly.
Banner

Server Icon

GitHub Actions run 4328301864 failed.
The 22nd of April is Earth Day, so we have a collision on that day. Do we want to eradicate Earth Day this year and let this event last until the 23rd, or do we simply let this event last until the 21st? Either is fine by me.
Also, @swfarnsworth, looking for a review of the event description in meta.md.
GitHub Actions run 4329026400 failed.
Thank you, these look amazing!
I don't think the text in the SVG version of the banner is supposed to look like this?

Sorry, I forgot to address the collision with Earth Day. I think PyCon definitely takes precedence, so unless we're fine with having Earth Day branding only on days that aren't Earth Day, we should simply not have Earth Day branding this year.
Celebrating the 20th Anniversary of PyCon US, a Python conference that hosts tutorials, talks, a job fair, and sprints! To learn more about it, go to [us.pycon.com](https://us.pycon.org/2023/).
GitHub Actions run 4329065843 failed.
Celebrating the 20th Anniversary of PyCon US, a Python conference that hosts tutorials, talks, a job fair, and sprints! To learn more about it, go to [us.pycon.org](https://us.pycon.org/2023/).
Nevermind, didn't realise this wasn't a bot lib subclass.
there should be a comment before these. Right now at first glance it looks as if they're self assignable
[python-discord/sir-lancebot] New branch created: Python\-3\.11
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Did you:
- [ ] Join the Python Discord Community?
- [ ] Read all the comments in this template?
- [ ] Ensure there is an issue open, or link relevant discord discussions?
- [ ] Read and agree to the contributing guidelines?
GitHub Actions run 4330282546 failed.
GitHub Actions run 4330290594 succeeded.
9a48fd5 Update CI to reusable actions - ChrisLovering
70de8ba Add dependabot CI config - ChrisLovering
Maybe add a delete_after to this ctx.send, so that we don't have messages with views that are no longer being listened to if the bot restarts.
why do we need to pass this around when the function is in the parent scope?
If we create this view before try/except we can add view.clicked = [] in the except block, to remove the issue Bella mentioned above.
embed = self.build_error_embed("You don't have permission to view this channel.")
Handle the case where this fails due to the person having their DMs closed, and only add to self.clicked if it works.
GitHub Actions run 4330533712 succeeded.
A tiiiny nitpick:
update the build.yaml to build-deploy.yaml just so that it reflects what it does right off the bat
Other than that, this looks goud.
tried locally and through docker and seems to work fine ๐
[python-discord/sir-lancebot] branch deleted: Python\-3\.11
GitHub Actions run 4330773985 succeeded.
Connected!
Connected!
This works and the code looks good, although I have two possible suggestions:
- When the interaction times out the buttons should be removed, to avoid the "this interaction failed" message.
- There should be an acknowledgement that the ban was cancelled when clicking "cancel", e.g. editing the message or sending a followup message, to make it clear what happened.
[python-discord/infra] New branch created: GDWR/match\-notify\-names
Ansible is case-sensitive when specifying a handler
this output
pydis:leroy.jenkins.crt
pydis:leroy.jenkins.key
when the file names are
leroy.jenkins.crt
leroy.jenkins.key
Migrate to the Discord-native timeouts instead of the current role-based mute.
mute will be kept as an alias, but otherwise all references to the functionality will use the word timeout. This will include making a migration of the name on the site.
GitHub Actions run 4331580763 succeeded.
I've left it as is for now so it's sort of symetrical with the ({member.name}#{member.discriminator}) that other's have, although i'm happy to change it.
I made it three groups, "being reviewed", "recent nominations", and "others by autoreview priority", thoughts?
https://github.com/python-discord/bot/pull/2418/commits/e9aa8f1621f9fcff0ace8e6cbe37c98449641773
cb87060 Make show_* arguments to list_nominations keywo... - wookie184
GitHub Actions run 4331650392 succeeded.
1310025 Add tests for markdown changes & remove note fr... - wookie184
Cases mentioned in https://github.com/python-discord/bot/pull/2156 were both fixed. I tried a couple of other commands and didn't notice any other issues.
GitHub Actions run 4331775436 succeeded.
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.
I think we are on the same page now.
Sounds great. I'll implement that.
Started playing around with it, this is super cool!!
This command doesn't seem to detect discord invites (that aren't whitelisted or blacklisted, but still trigger a notification).
if (descriptions_num := len(new_ctx.action_descriptions)) > 20:
In [1]: if x := 5 > 3:
...: print(x)
...:
True
When spamming a bunch I noticed I can get a response like this, would it make sense to remove duplicates? (ignore location of comment, not sure where this would be done).

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.
In this case, would something like deleted all, muted, deleted X 9 be ok?
Yes, the goal is to find filters. In a previous iteration I just made it spit out the same messages that would appear in the mod alert, but this seemed more useful. Should it be reverted?
Only noticed because I was wondering why it was "ยฑ19" when I got this output lol

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.
Hmm, it probably does make more sense as-is actually, maybe the help text could be clarified though.
f270420 Migrate from role-based mutes to native timeouts - mbaruh
[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...
Renames all instances of mute to timeout. This is to support https://github.com/python-discord/bot/pull/2438 and this PR must be merged together with it.
[python-discord/bot] Checks Successful on PR: #2438 Migrate from role-based mutes to native timeouts
GitHub Actions run 4332538131 succeeded.
GitHub Actions run 4332540826 succeeded.
One option for merging the embeds now is something like this with buttons, where the "Help" button could send an ephemeral message with the contents of the help command.

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.
Looks good. Let's just go for it.
When the interaction times out the buttons should be removed, to avoid the "this interaction failed" message.
I just realised that i'm not actually sure how this would be implemented, so it's probably fine to leave as is unless you have a simple idea.
When the interaction times out the buttons should be removed, to avoid the "this interaction failed" message.
I just realised that i'm not actually sure how this would be implemented, so it's probably fine to leave as is unless you have a simple idea.
You can use this view from bot-core
view = pydis_core.utils.interactions.ViewWithUser...
c29a1a4 Make help showable through button on command er... - wookie184
[python-discord/bot] New branch created: combine\-command\-error\-messages
[bot] Branch combine\-command\-error\-messages was force-pushed to `b337d18`
closes #126
Notes:
- Help button can be used by anyone
- Delete button can be used by author and moderators
- I would have used https://bot-core.pythondiscord.com/main/output/pydis_core.utils.interactions.html#pydis_core.utils.interactions.ViewWithUserAndRoleCheck, but it seems like that can only lock all buttons. I couldn't see a way of overriding the check method to change that behaviour.
- Using the method from the custom help command is a bit ugly, but I wanted to keep this chang...
Can I be assigned this?
GitHub Actions run 4336951218 succeeded.
[python-discord/bot] Checks Successful on PR: #2438 Migrate from role-based mutes to native timeouts
GitHub Actions run 4338142069 succeeded.
[python-discord/bot] New branch created: fix\_stats
Previously each thread created its own statistic, since 'message.channel' can be a thread.
Also makes make the stat name slightly more robust to small name changes.
GitHub Actions run 4338391559 succeeded.
8cdcffb Group thread stats under parent channel (#2440) - mbaruh
[python-discord/bot] branch deleted: fix\_stats
Connected!
[python-discord/bot] New branch created: mbaruh\-patch\-1
This shouldn't happen, but the type hint says it can so but just in case.
GitHub Actions run 4338445710 succeeded.
Connected!
GitHub Actions run 4340416059 succeeded.
This bundles several workflows that we have into a main one, in order to have a better "overview" of our CI pipelines
Changelog
- Merge build & deploy workflows
- Create a
main.yamlworkflow that calls all the rest - Trigger Status Embed workflow from main.
- Trigger Static preview from main
GitHub Actions run 4343174611 failed.
This needs to be removed so that publish-static-preview can use it
I think we only want to run this
if: github.ref != 'refs/heads/main'
Doing this also means we can remove the checks inside static-preview.yaml that do this same check.
uses: ./.github/workflows/build-deploy.yaml
True true, since we have the 'github.ref' != '..main' case
99ca1f946a9bb88ecd54f04b8ddfae96fa0a2fdc
GitHub Actions run 4343640736 failed.
I need to work on my typing issues 493a9486f917fc0efb6badc7caf4c803696764d3
GitHub Actions run 4343657641 failed.
GitHub Actions run 4343665976 succeeded.
GitHub Actions run 4343676700 succeeded.
GitHub Actions run 4343690817 succeeded.
GitHub Actions run 4343703469 succeeded.
GitHub Actions run 4343808519 succeeded.
Closes #2022
Previously the error prompted because isinstance was returning False when an TagIdentifier object was compared to itself. Instead of checking that, we check if the source object issubclass of commands.Cog and pass the TagIdentifier to else.
This parameter doesn't suits in the UI well, please suggest a new name.
a85401f Bump pre-commit from 3.0.4 to 3.1.0 (#1215) - dependabot[bot]
52fc242 Add default unicode emoji for trashcan (#1217) - Ibrahim2750mi
6218c56 Bump pydis-core to 9.5.0 (#1222) - shtlrs
423e30e Bump python-dotenv from 0.21.1 to 1.0.0 (#1216) - dependabot[bot]
807deba Bump sentry-sdk from 1.15.0 to 1.16.0 (#1220) - dependabot[bot]
GitHub Actions run 4349114711 succeeded.
GitHub Actions run 4351634226 succeeded.
GitHub Actions run 4351814943 succeeded.
Connected!
GitHub Actions run 4353869571 failed.
GitHub Actions run 4354036905 succeeded.
GitHub Actions run 4354075798 succeeded.
01ec9b5 Update Holi duration and timing description - brad90four
[python-discord/branding] New branch created: holi\_duration
Updating duration from "usually lasts 5 days" to "2 days", as well as a longer explanation on the timing of the event.
GitHub Actions run 4354536857 succeeded.
at: https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/creating-bot-account/
steps 6 and 7:
In the General Information tab, grab the Client ID.
Replace in the following URL and visit it in the browser to invite your bot to your new test server.
Discord appears to have updated Client ID to read "APPLICATION ID" instead

[python-discord/branding] branch deleted: holi\_duration
db541ed Update Holi duration and timing description (#197) - brad90four
GitHub Actions run 4354702663 succeeded.
Looks great, just a couple of nitpicks
Is this still of relevance because of the potentially existing mutes ?
We could still rename it to "Timed out" to reflect that someone is timed out in discord, because i think it's quite handy to have that indicated in the user's roles
If you approve my suggestion from above to keep the role, then we'd better rename this
Would capping it to MAXIMUM_TIMEOUT_DAYS be a good idea here ? (-1 minute since it's exclusive like you said)
Are you getting this from kwarg to avoid altering the signature ?
It's just that I think that if it's something that's cohesive with the command, it's worth changing the signature along with it
GitHub Actions run 4355158665 failed.
GitHub Actions run 4355161177 failed.
GitHub Actions run 4355174748 failed.
GitHub Actions run 4355188500 succeeded.
[python-discord/king-arthur] New branch created: add\-pre\-commit\-hooks
This adds pre-commit hooks and updates CI to call them too.
GitHub Actions run 4355262484 succeeded.
Connected!
Yeah it's just for the existing mutes. As a moderator it will be easy to see that they're timed out (for example you will be able to remove their timeout in the context menu). Their messages will appear grayed out in chat with a red indicator.
I think the idea was to make the apply_x functions all have the same signature. It's not necessarily the best, but I'm not sure I want to start messing with it.
Hummm, I guess we could leave it then, I don't think apply_timeout would be used somewhere else so that's probs fine
Looks good to me, tested locally and all looks good.
GitHub Actions run 4358457660 succeeded.
8cdcffb Group thread stats under parent channel (#2440) - mbaruh
2f813a7 Make sure channel parent isn't None (#2441) - mbaruh
bc2b4c6 Bump actions/upload-artifact from 2 to 3 - dependabot[bot]
d248d89 Merge pull request #2447 from python-discord/de... - wookie184
e770530 Bump SebastiaanZ/github-status-embed-for-discor... - dependabot[bot]
bf8f8f4 Bump markdownify from 0.6.1 to 0.11.6 (#2429) - dependabot[bot]
8cfd1b2 Reduce long timeout to 28d instead of denying it - mbaruh
GitHub Actions run 4358491411 succeeded.
e9850d3 Update all dependencies to latest - ChrisLovering
[python-discord/bot] New branch created: update\-deps
This also removes some explicit deps that are now deps in bot-core
Updates the trigger of the status_embed workflow to run when CI has completed the run
Connected!
GitHub Actions run 4358530233 succeeded.
GitHub Actions run 4358553535 succeeded.
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.
This removes the cluttered lint-build-deploy workflow file & dumps them into 3 different ones
One for linting, one for building & deploying and one that calls both of them
The status_embed workflow now trigger when the "CI" one has completed
This also updates some basic actions versions
It's been a while since we discussed it on Discord, but as a potentional solution, we could probably wait like an hour after puzzle release, and incrementing this as we proceed in AoC? This way we don't have to send requests to check the leaderboard. (Avoiding unnecessary requests to AoC servers when the traffic is rather high)
Connected!
Can't we use interaction_check on bot.tree ?
I'll test & confirm this
That might work yeah. It would be great if we could keep all of these checks in one place. I wouldn't mind dismantling the Security cog if adding the new check there doesn't work.
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.
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 nominationsandothers by autoreview prioritydoesn'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...
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
Connected!
GitHub Actions run 4362479372 succeeded.
GitHub Actions run 4363927354 succeeded.
GitHub Actions run 4363929371 succeeded.
GitHub Actions run 4363985653 succeeded.
Threads (& forum posts) can now be locked without the need to close them. This behaviour is exactly what we want for silencing a thread, and mods can still type in the threads without causing them to be unlocked.
We should update the Silence cog to allow for threads to be both silenced and unsilenced.
GitHub Actions run 4365527064 succeeded.
We could inherit the CommandTree and overwrite its interaction_check method
and pass it for the keyword tree_cls in https://github.com/python-discord/bot/blob/main/bot/__main__.py#L56
GitHub Actions run 4368894290 succeeded.
Closes #2450
This disables the tag slash command in the DMs.
This allows us to have flexibility when it comes to selecting which command to enable in DMs or not instead of having a check that get clunky depending on special conditions.
GitHub Actions run 4368985919 succeeded.
Looks good overall, just small things that need fixing overall.
This currently doesn't suggest the tag command itself when I do /source tag
Instead, it only returns the cog
This currently doesn't work for Tags because it returns the wrong path
Maybe staying consistent with capitalization is better here
3fb90e9 Remove file ignore filter to use -B flag instead - ionite34
Does using
python -Bfix it? docs.python.org/3/using/cmdline.html#cmdoption-B
Seems to, yes. I removed the file ignore filter and added the -B flag.
Thanks, glad that fixed it
This is being merged now, handling any issues.
12fe15b Merge #2408: Scaffold server config via a boots... - shtlrs
Connected!
Some rule values were lost while migrating them to the classes in constants.py
This PR fixes that by puttin them back
95aa40c minor correction to config for chars filterin... - lxnn
[python-discord/bot] New branch created: rule\-config\-fix
GitHub Actions run 4372002285 succeeded.
GitHub Actions run 4372018210 succeeded.
Connected!
Connected!
Are you on latest because this doesn't happen for me the link is alright, also the slashes also seem to be alright?

GitHub Actions run 4372817839 succeeded.
GitHub Actions run 4372824300 succeeded.
Connected!
GitHub Actions run 4373064215 succeeded.
GitHub Actions run 4373320982 was cancelled.
GitHub Actions run 4373325954 succeeded.
When pressing snooze for the first time it deletes the Reminder after 30s.
That certainly shouldn't be happening. I thought I'd tested re-snoozing, but I can certainly look into this when I get some free time.
GitHub Actions run 4373866713 succeeded.
Why would we exclude command groups or context menu commands ?
We might not have them now, but we could have them in the future, we'll see what others think about this
If you want, we can change this to
title = f"Text command: {source_object.qualified_name}"
Raise CommandInvokeError instead.
Alright, I will add the app_commands.Group, not so sure about ContextMenu, but if you say so I will add it.
Thanks for noticing for that, I didn't notice it.
We currently don't have any Context menu commands for bot, and I'm not sure how that would work out since they get tricky when instantiated inside Cogs due to a limitation with the lib.
Should be fine to leave it as is, and we can always see what others have to say about it
GitHub Actions run 4374530311 succeeded.
Nested attributes are separated by _ in the .env.server, and that's how they're picked up by Pydantic.
The separator for webhooks was still a "." due to a last minute change in the separator.
This PR fixes that
GitHub Actions run 4375724837 succeeded.
* In your `.env.server` file, set `urls_site_api` to `"localhost:8000/api"`. If you wish to keep using `web:8000`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set.
According to discord-dev website they are called Prefix-based commands, shall I change it to that or this?
Connected!
GitHub Actions run 4375898557 failed.
[python-discord/sir-lancebot] New branch created: fix\-1121
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...
Adds a dependency group for the boostrapping script and a task to launch it
For some reason, these were lost during the merge.
Just move the dependency into the main dev group. It doesnโt need to be on its own for basically all devs, and it would save us effort trying to guide people to install it.
GitHub Actions run 4376508292 succeeded.
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
```...
Connected!
GitHub Actions run 4376634477 succeeded.
GitHub Actions run 4376707593 succeeded.
GitHub Actions run 4376723166 succeeded.
GitHub Actions run 4377367002 succeeded.
Connected!
I could help with this issue. I'd just need clarification on the finalized approach:
- Allow in all channels except X,Y,Z.
- Add X,Y,Z to the
LATEX_ALLOWED_CHANNELS.
I could help with this issue. I'd just need clarification on the finalized approach:
- Allow in all channels except X,Y,Z.
- Add X,Y,Z to the
LATEX_ALLOWED_CHANNELS.
Its the reverse, you add the the channels which are allowed in LATEX_ALLOWED_CHANNELS. So if channel XYZ isn't allowed you don't add it to the LATEX_ALLOWED_CHANNELS. Only allowed channels are to be added to that vairable.
@matiaslagoevia I can assign you if you want.
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
@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...
I just think that once you don't say what it means for a nomination to be recent, it's unclear why it should be in a separate section. It will probably be at the bottom of the priority list anyway.
Either way, it's not a blocker. You could ask the mods what they think a useful output would be.
3686f60 add the roles channel to the config - shtlrs
5795140 add the AllSelfAssignableRolesView and its corr... - shtlrs
6ab9f9c add the logic for attaching the persistent view - shtlrs
b25ad80 add assignable_roles as a property to the Claim... - shtlrs
1d60403 add implementation of the button's callback tha... - shtlrs
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
7500eee Trim query in command not found error to avoid ... - wookie184
GitHub Actions run 4379451912 succeeded.
Refactored #2422 to be compatible and fixed merge conflicts with #2408
GitHub Actions run 4379732741 succeeded.
This sounds a bit like "if you plant a flower, a flower will be planted" ๐
**Note**: Skip this step if you would like to configure the bot manually, but that will require more work.
You now have both the bot's code and a server to run it on. It's time for you to connect the two by changing the bot's configurations.
This one's on me, but we might as well fix it here :)
without having to spend much time copying IDs from your newly created server into your configuration file.
I also have an issue with "newly created", since this should still work for existing servers.
To make setup much easier, the script in `botstrap.py` bootstraps the configuration for you and helps you get started immediately,
To do this, you'll simply need to run the `configure` poetry task:
If you delete the huge card above, then:
If you wish to set all values in your `env.server` for your testing server, you need to set **all** the ones prefixed with:
The channels there are mostly the ones that are needed by the bot.
[python-discord/snekbox] branch deleted: bytes\-output
[python-discord/bot] branch deleted: snekbox\-files
Connected!
[python-discord/snekbox] New branch created: files\-exclude\-hidden
efc899d Add files output exclude for hidden paths - ionite34
9b31db9 Add unit test for hidden paths exclusion - ionite34
Do we still ignore files starting with an underscore? Don't remember if it was implemented.
Do we still ignore files starting with an underscore? Don't remember if it was implemented.
Yes, via the default nsjail / config files_pattern: str = "**/[!_]*"
I think at indicates that it will be exactly in that position, whereas in will infer that it is contained within the root directory ( and its subfolders) and not necessarily at the top level position
No, not necessarily.
It's just that if people have existing servers where channel names are not necessarily the same, it won't work as expected.
However, using the template guarantees that
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...
@swfarnsworth and I discussed this before, I also had doubts about putting it here, but I also thought of people not being able to understand what's going on, especially new contribs.
If you have a strong opinion about removing it, I wouldn't mind doing it at all.
You do need a guild id in your env, since there's the Guild class that needs to pick it up.
Also, if you we go with the above suggestion about where we should place .env & .env.server, i'll mention it there
GitHub Actions run 4383102988 failed.
It's actually urls_site in the previous config scheme & that's because we defined a variable called
site which takes that value, and then we use it to automatically compose the site_api & a bunche of other stuff
But yes, it's not the case anymore & should change
GitHub Actions run 4383190137 failed.
GitHub Actions run 4383317059 succeeded.
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.
It should go into the LATEX_ALLOWED_CHANNNELS, since we're talking about allowing the latex command, that'll automatically include it in the override later on.
The help channel isn't in the Channels class, so you would need to add it as well.
@shtlrs If this gets approved can I please implement it?
This will need to be mentioned in the local run section as well
I meant as an addition to what was already there, should've been clearer.
Can slash commands suggest arbitrary text based on an integer and actually show the rule details in-line?
Also since the rules command is frequently used conversationally (with other messages appended afterwards) I'm not sure if this might hurt usability.
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 ...
Got it, I have enough context to tackle the issue now. Thank you!
Can slash commands suggest arbitrary text based on an integer and actually show the rule details in-line?
Yeah the autocompleter can do something like that.
* In your `.env.server` file, set `urls_site` to `"localhost:8000"` and `urls_site_api` to `"localhost:8000/api"`. If you wish to keep using `web:8000` and `web:8000/api`, then [COMPOSE_PROJECT_NAME](../docker/#compose-project-names) has to be set.
Also since the rules command is frequently used conversationally (with other messages appended afterwards) I'm not sure if this might hurt usability.
Why would it hurt usability ?
Also since the rules command is frequently used conversationally (with other messages appended afterwards) I'm not sure if this might hurt usability.
Why would it hurt usability ?


most use cases of rules either ...
Right, I just don't want people to think the script requires a new server every time. Since you added the note about existing servers I think the words "newly created" here and in my other comment can be removed anyway.
Wouldn't it make sense to explain what the files are before we tell people to create them?
Also regarding the wording for ,env.server I think the wording in the lines I marked still work.
GitHub Actions run 4384380070 succeeded.
I agree with you here.
However, I wasn't talking about setting the entire env.server manually, but mostly about how would you go on about setting some variable if you ever need it.
To us it is very obvious because we discussed, planned, implemented and tested it, but idk how it would look like from the perspective of someone who has no clue about it.
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. ...
No no, like I said I'm in favor of keeping it. I'm talking about the massive collapsible card.
Aaah ok. I said we should move that part to the beginning, and you said everything before it should be moved below. I guess the result is the same ๐
Ah ok, I understood something else completely.
I'll also add small explanation of nested objects in that case, which will cover the antispam & rules cases
[python-discord/snekbox] branch deleted: files\-exclude\-hidden
You mean the parts I'm deleting in my PR? :P
Ahahahaha, might not be worth adding after all :p
Relevant Issues
Closes #1207.
Description
Adds the #python-help channel to the list of channels where .latex command is allowed.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and agree to the contributing guidelines?
GitHub Actions run 4385330606 succeeded.
GitHub Actions run 4385597656 was cancelled.
[python-discord/bot] Checks Successful on PR: #2438 Migrate from role-based mutes to native timeouts
GitHub Actions run 4385609505 succeeded.
Shouldn't this be a big integer field - because we're dealing with snowflakes?
Shouldn't this be a big integer field - because we're dealing with snowflakes?
This looks super good. Thank you for your hard work.
I have some smaller comments: they are mostly related to code style - quotation style mainly. Apart from that, this looks good to merge to me.
Here the same questions as to BigIntegerField applies as with the model above.
Same snowflake comment applies here and to the following three fields.
I believe these should be single quotes.
@lemonsaurus did you find a good place to change it to?
Can we consider this project to be complete, or do we want to include the additional topics section as part of the project as well?
Let's keep it open until we have those two PRs merged. I think we should have that done soon ๐
Can I make a page on using cogs/extensions?
@n0Oo0Oo0b Personally I'm not opposed to it but I believe it would be better to discuss in a new issue, as this one is mainly related to migrating existing content. Could you open one?
Hi @mudkipdev, can we help you out with your dev environment?
96f3ed6 fix: use new domain for bot tutorial resource - vcokltfre
4ecef08 fix: change other references of vcokltfre.dev t... - vcokltfre
852ea41 Merge pull request #876 from vcokltfre/patch-1 - mbaruh
187770a Bump flake8-bugbear from 23.1.20 to 23.2.13 - dependabot[bot]
a487a7c Merge pull request #877 from python-discord/dep... - Xithrius
GitHub Actions run 4385908596 succeeded.
Currently, we can't execute commands in threads if they're not whitelisted.
The problem is, we can't have a thread id in advance.
This adds the possibility to do that when the parent of the thread is whitelisted (Just like the case of help forum channels)
Context:
This is needed in order of achieving #1230
GitHub Actions run 4385972788 succeeded.
Rather than adding the thread to the whitelisted channels, it makes more sense to check the parent channel instead of ctx.channel in this case. This also keeps the in channels check in one place.
fwiw I usually do a hasattr check whenever I have to do something like this, and save the extra import, but that's more a matter of style.
I just wanted to avoid multiple ifs within each other, but i can do that if you want
GitHub Actions run 4386282812 succeeded.
GitHub Actions run 4386322528 succeeded.
Connected!
Connected!
Have we considered a URL button for the embed? Or would that be too big?
Personally, I don't think it's necessary. I'm open to opinions though.
That would make two buttons at most in the same message when listing infractions. Then we lose context of which infraction does that button refer to, no? Which might become confusing.
When sending text from stdout (correctly detected):

When sending text from a file (not detected):

This is also an issue for the file names.
0cc7fa3 Display "N/A" for infractions in ModMail - vivekashok1221
ed35776 Replace CharField with URLField and set default... - vivekashok1221
How does e207147d0d58af2ef6f75586f837ee3c96b8b7a4 look ?
Currently need an override workaround to exclude files starting with ., and the underscore _ exclusion does not apply to files within subdirectories.
You haven't addressed the full suggestion, you mention web:8000/api twice.
This file will contain sensitive information such as your `BOT_TOKEN` and your `REDIS_PASSWORD`.
It will also contain configurations related to external services the bot might use such as `USE_METRICITY`, which are unrelated your server, with the only exception being `GUILD_ID`.
Generally good, left a comment below ๐
Backticks can removed from filenames. As for file contents, if detected I think it should just post a link to the pastebin.
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
...
Clumsy me is a classic, sorry for that ...
Should be fixed now :D
GitHub Actions run 4391450269 succeeded.
Everything looks good, IMO you should mention about the trashcan emoji.
Mention here about configuring the trashcan emoji as most commands won't work without it.
I don't know if this is the most suitable place, if you find a better place add it there only.
LGTM! Also thanks for fixing test_dont_call_suggestion_if_user_mod using ctx.invoke.
I don't think most people would know them under that name, so a text command is better.
Let's see what others have to say about it though
GitHub Actions run 4393130417 failed.
It will also contain configurations related to external services the bot might use such as `USE_METRICITY`, which are unrelated to your server, with the only exception being `GUILD_ID`.
This one's on me.
That's no longer true right? should this section still exist?
0e11643 Update appeals2 to appeals_2 to reflect config ... - vivekashok1221
GitHub Actions run 4393606189 succeeded.
This part is unrelated to the configuration method, since it's not set automatically by botstrap. We could set it automatically to true if there's no existing config, or move this part to an area common to both methods.
I've now replaced CharField with URLField with null=True in https://github.com/python-discord/site/pull/824/commits/ed3577652d620057cc87bbc74775548066cfdc8f.
Hmm we could set it automatically to ๐๏ธ, although that's outside the scope of this guide.
I feel like you should also mention how you can set your own custom bot prefix in .env.server.
Currently, if we override some values manually for classes that are not being generated by botstrap, they will get lost.
And that's because botstrap only tracks specific values in classes then overrides the content with each run.
This can get annoying if people add config that'll eventually get lost.
The default values of https for urls_site_schema and HTTP for urls_site_api_schema are set properly for dev configurations.
Are you sure it doesn't need to be HTTP? it's information from the existing guide (which I didn't edit in the rewrite). If they don't need to be changed, then we can remove mentions of them from the guide altogether, and only move the mention of fakeredis.
It only needs to be HTTP if you're using a local site for urls_site, which I didn't realize this article was suggesting as well. I think it's more useful for most users to use the prod domain, since the site URL is only used for log viewing and paste. Log viewing is only sent in mod-log, while the pastebin is used in a few locations.
After some [internal](#dev-better-config message) discussion, we've decided that autogenerated values should always go to .env.server and should not be tampered with.
If for some case, some special overriding is needed, then the overriden values should go to the .env file.
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
GitHub Actions run 4394253277 succeeded.
yes yes, forgot about that one, deleted
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.
How about just adding it to env list appendix ?
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...
Summary
Sending this code -
# #bot-commands message
for x in range(100):
open(f"test.{'a' * x}", "w").close()```
Caused this error -
# #bot-commands message
HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In content: Must be 4000 or fewer in length.
It was triggered in https://github.com/python-discord/bot/blob/e21cd3ece...
Related to Cpython#102613. We should probably switch to glob instead of pathlib for now.
9952110 Ensure mp Pool is not reused to avoid broken pi... - ionite34
99d6b96 Provide files_timeout to MemFS.files_list call - ionite34
6601b36 Add unit test for deeply nested path file parsing - ionite34
[python-discord/bot] New branch created: fix\-eval\-message\-limit
[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
GitHub Actions run 4396631457 succeeded.
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
Connected!
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.
GitHub Actions run 4396992320 succeeded.
Connected!
GitHub Actions run 4397009388 succeeded.
Connected!
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...
GitHub Actions run 4398449509 succeeded.
Connected!
GitHub Actions run 4398563550 succeeded.
GitHub Actions run 4398640218 succeeded.
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
Connected!
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:
- 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...
These don't appear as bulleted points, I think you need another newline before them
Strange, it rendered just fine for me on Pycharm, that's why

Also related to https://github.com/python/cpython/pull/100282, could remove check after fix upstream
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.
Closes #2466
This now checks if the server is a community & updates it when it's not.
It also provides the announcements & rules channels upon patching the guild since they are needed.
Upgrading a channel from Text to Forum isn't possible, so this basically deletes the text channel if it finds it & makes a new one as a replacement.
GitHub Actions run 4399593562 failed.
GitHub Actions run 4399610022 failed.
GitHub Actions run 4399616858 succeeded.
I haven't tested yet but looks fine upon review (except for the one comment I added).
I will try to test the code today.
This docstring doesn't match the function. What is the purpose of this function? It's not used anywhere in this PR.
GitHub Actions run 4401656012 succeeded.
[python-discord/snekbox] New branch created: sd/sentry
acb1f89 actually bump sentry mvp version in pyproject.toml - shenanigansd
Comment in pyproject.toml for the falcon constraint can be removed now.
Also this can and should be removed https://github.com/python-discord/snekbox/blob/main/snekbox/utils/logging.py#L27-L28 I looked at the sentry PR and confirmed this warning will no longer be shown since it will try to import the new name first and only import the deprecated one as a fall back.
Mind adding a comment explaining that we want this for Falcon 3.0 support and linking to https://github.com/getsentry/sentry-python/pull/1733 ?
Oh... No it's an old version that just escaped my eyes.
It needs to go away indeed
00330956f6140476d9e9f633b045921b214b3d37
GitHub Actions run 4402251052 succeeded.
Haha, I thought so. I'll approve after i get a chance to test the code.
GitHub Actions run 4404116881 succeeded.
There's a bug that needs to be fixed, otherwise no one is ready for review :p
We've previously talked about moving this to the constants.py under their own class.
However, what 'scares' me now it that this module will become too crowded, which makes me wonder if it's worth doing.
Nitpick: don't we mostly use f-strings now for string formatting ? It also keeps it consistent with how you're formatting other strings in your changes
This should be nomination.user_id :P
I was testing but the predicate was always returning False and I'm like: "wat, but this should fit" ahahah
GitHub Actions run 4404452824 succeeded.
fixed in 2ce0b6936e93271e1de7f772686fb5adff7bb770
a7a5ff8f7fc919727acffe084622f98036c2abf6
GitHub Actions run 4404874188 succeeded.
Thanks for taking care of this!
[python-discord/snekbox] branch deleted: sd/sentry
7ca3917 Add SIGALRM based time limit - ionite34
0ef2552 Remove unused timed function - ionite34
Looks great, just one tiiiny suggestion
Suggestion:
This can be further improved by adding more context through mentioning which user was being infracted
GitHub Actions run 4410101563 succeeded.
@wookie184 Currently, a watch infaction isn't pardoned like a mute. Invoking the unwatch command posts another infraction to the api, and marks the previous one as inactive.
I'm in for changing that so that it abides to the same "laws" the pardonable infractions do, and then we give it a default duration (which we can decide upon in the PR, or here)
GitHub Actions run 4416306765 succeeded.
2188de1 Fix pydantic model that prevented channel black... - TizzySaurus
[python-discord/bot] New branch created: fix\-channel\-blacklist
A tiny PR that fixes the typehint of the channel blacklist (list[str] -> list[int]).
More Detail:
Since the typehint is list[str], and it's inside a pydantic model, the list is converted to be a list of strings. This means that in the code, when we check whether the channel id (which is an int) is in the list, it will always say it's not.
I am saddened that I will no longer be able to duck my favorite announcements
GitHub Actions run 4418008773 succeeded.
Oops.
Thanks for fixing this
[python-discord/bot] branch deleted: fix\-channel\-blacklist
Connected!
GitHub Actions run 4419018025 succeeded.
Unfortunately, this won't work out currently due to how contexts are passed from forks.
I'll be closing this for now until we find a more suitable solution.
Looks good & works well.
The timeout comment is the one I think should be addressed the most.
I think this will never timeout since you didn't provice the timeout value in the super.__init__ call
I don't think it'll ever be an instance of User since the Security cog ensures they only run in guild.
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
[python-discord/snekbox] New branch created: multi\-version
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...
Does this decouple the interpreter the web app uses and what eval/nsjail uses?
Using GET on /eval to get this info seems unintuitive. I think this is better suited to be a dedicated "info" route. Related: #138
Maybe we should follow a naming convention more like pyenv, which distinguishes between cpython, pypy, etc.
Alternative proposal: pass a path to an executable instead of a version. This would leave the door open for supporting arbitrary executables in the future. So far nothing in the API is actually specific to Python or even a compiler/interpreter. The downside is that it's less user-friendly to know the full path to an executable than it is to specify a Python version.
Use log.exception so we get the traceback in logs, which I feel is important for a catch-all.
Do we have a test that asserts this time outs?
Clever. I don't know enough about signals to say whether this is an appropriate use, but I think it's low risk to try.
I don't think implementation details should generally be included in the summary. If you think it's useful to point this out, then I think the notes section in the docstring is more appropriate of a place.
Decorator to call a function with a time limit.
timeout: The maximum time for the file parsing.
The omitted part should instead be in a Raises: section.
Elegant use of a generator expression here!
What's the thought behind renaming this to added? The previous name, count, was clearer to me. Nothing is being "added" (at least not as far as this function is concerned).
That sounds smart, should be fairly easy to modify in the json file.
It is sort of decoupled in the sense they are not enforced to be the same version as the one in the pyproject. The server will use one of the versions in versions.json, particularly the one labeled main.
I think the version the application uses should always match what we target with pip-compile. The frozen dependencies may not be compatible across Python versions, but this is not something I have looked into.
I don't know if there is any way for us to actually enforce this. I suppose we can mostly rely on CI to tell us whether the dependencies are compatible.
So instead of discovering which versions are available, users could discover which binaries are available and what their paths are. We don't need to list everything that's mounted; can continue to use the same approach of configuring that in a JSON file.
The main challenge is figuring that version out during the dockerfile creation step, and verifying the version string against whatever is configured in the file. It might be doable, do we want that enforcement?
No, I don't think we need to do anything for that. I think the tests + image build than run in CI gives us confidence in the dependencies being compatible. It's not worth adding complexity to our image. If there was a straightforward way, then sure.
This is an interesting idea, I'll into implementing it. I'd probably keep the display names in the JSON files so end-users (bot) can still display human-readable names.
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.
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.
Yeah I think I'll change this back to count, previously I added then removed a scanned variable to stop at some determined depth hence leading to the name change.
fb01ba2 Update snekbox/utils/timed.py - ionite34
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
The branch is a bit out of date, can you rebase onto main/merge this please ?
GitHub Actions run 4432596452 succeeded.
GitHub Actions run 4433658798 failed.
@dawnofmidnight are there still changes you would like me to do, I think I have resolved all of them.
GitHub Actions run 4433666363 failed.
1af5bf0 Add unit tests for time_limit - ionite34
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...
I feel like the None is still useful on performance grounds since we currently bypass the time.monotic call and comparison when timeout is None.
de1327d Update type hint for files_timeout to be `int... - ionite34
It seems to work pretty accurately for interrupting time.sleep and built-in C functions in these tests 1af5bf0, so it seems okay for our usecase, and avoids the potential broken pipes issue with multiprocessing.
Connected!
Completes task in python-discord/site#695
Add a short tag explaining disadvantages of free hosting, and linking to resource on our site and #discord-bot-hosting thread.
GitHub Actions run 4446789590 succeeded.
Done in 8375787. I didn't implement the rest of the suggestions from that issue, but I'd think they'd be easy to implement in a future PR.
f564fd7 Add More Information To Version Display Names - HassanAbouelela
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).
How would I reverse it?
I honestly don't remember.
Roles can be specified as names as well.
Pings can be specified as role names as well.
Channels and categories can be specified by their names as well.
Same as the other guild_pings
I think it was just created by different people. I don't mind aligning all of them to one style or another.
What makes you prefer single quotes over double quotes here?
Names can change. What about a filter on one of the off-topic channels?
Is a ping a user mention? Those can definitely change. Or what are we referencing in here?
I use single quotes for "data" like dictionary keys, and double quotes for longer user-facing strings like log messages. But it's really personal preference: doesn't matter much
Nearly done, just need to wrap up some dependency work. I've tested the new CI on my fork.
It's either an ID or a role name. The meaning is resolved by the bot.
Then for those you can use the channel ID. Name support was added to match the current filters which don't trigger in categories called "CODE JAM". I expect that we will mostly use IDS, but it might come in handy in additional scenarios in the future.
GitHub Actions run 4458676753 succeeded.
Would you mind elaborating on what you mean? I'm not sure I'm following. Thanks!
GitHub Actions run 4458779475 succeeded.
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.
"""The button that sends a bookmark to other users."""
This shouldn't happen here. You should append only in the else block, once we've made sure that user has received the bookmark
Raises `discord.Forbidden` if the user's DMs are closed.
Sends the `target_message` as a bookmark to the `target_user` DMs, with `title` as the embed title.
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.How about just adding it to env list appendix ? 2ce0b69
Although I'd prefer it in the main section somewhere, I think this will do. Is it also worth mentioning that .env.server will be wiped on rerun botstrap script?
I can make an optional section for it.
And it should go in.env, not .env.server
cc4e8ef Update docs for upstream documentation change - jchristgit
[python-discord/site] New branch created: client\-id\-is\-now\-application\-id
You will need to mark this job as needing the generate-sha-tag job to access needs here
uses: ./.github/workflows/sentry_release.yaml
Not needed for merging this, but we should consistently use either yml or yaml to avoid gotchas in the future.
(You'll need to update the file name too)
This is indented 1 level too much
GitHub Actions run 4460620344 succeeded.
[python-discord/bot] Checks Successful on PR: #2438 Migrate from role-based mutes to native timeouts
GitHub Actions run 4460962702 succeeded.
Looks good, just a couple of comments
Maybe I'm missing something, but you're using the channel name to access the... channel name? seems circular.
Just a nitpick, but here and in other places you're adding an underscore after "id". It's only necessary for variables named id_ since id is a built-in.
e00be4b Update events/pycon_us/meta.md - swfarnsworth
GitHub Actions run 4461176862 failed.
Actually that was just because they're shadowing variables from the module's namespace and were just bugging me in Pycharm.
Maybe I chose poor names, do you want me to change them?
You're not missing anything.
It's because I had imagined something different when I was starting up.
But they actually map the same value, so it's pointless.
I'll fix it
GitHub Actions run 4461712919 succeeded.
It's fine either way, I was just puzzled.
43e83dcfd02ae129939fc4a14b2de0d5fe2f75d6
d4e2325d822fc21d0fc7548d01596364792597d9
GitHub Actions run 4461809327 succeeded.
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...
You can do this without an extra endpoint. Take a look at https://github.com/Ukraine-Relief-Efforts
In the README I have:
[](https://discord.gg/4bQvrgXbxW)
Which renders as

That only fetches the online count though, not the total number of members, does it ?
Can we do anything about the failing Netlify deploys - is it because of the changes here?
GitHub Actions run 4467414994 succeeded.
8a95402 Add jump_url field to infraction model - vivekashok1221
19afe0d Remove typo - vivekashok1221
7e1a997 Bump django-environ from 0.9.0 to 0.10.0 - dependabot[bot]
646b346 Merge pull request #896 from python-discord/dep... - Xithrius
19e426c Merge branch 'main' into vivek/add-jump-url-field - vivekashok1221
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] Checks Successful on PR: #2438 Migrate from role-based mutes to native timeouts
GitHub Actions run 4467967508 succeeded.
GitHub Actions run 4467991005 failed.
[python-discord/bot] Checks Successful on PR: #2438 Migrate from role-based mutes to native timeouts
GitHub Actions run 4467991951 succeeded.
GitHub Actions run 4468060996 succeeded.
[python-discord/site] branch deleted: mbaruh/timeout
[python-discord/bot] branch deleted: mbaruh/timeout
GitHub Actions run 4468104069 succeeded.
Connected!



