106df17 Defer callback response for AoC selects - ChrisLovering
15c3978 Fix wrong prefix in aoc join message - rmenai
a8cbf21 Merge pull request #70 from rmenai-lab/main - janine9vn
8f4d729 Merge branch 'main' into fix-daystar-command - janine9vn
4f103a8 Merge pull request #68 from python-discord/fix-... - janine9vn
#dev-log
1 messages ยท Page 6 of 1
ccbc893 Update org readme to reference new help forum - ChrisLovering
[python-discord/.github] New branch created: ChrisLovering\-patch\-1
I can write something up for this, and we can discuss the content in the PR itself.
Rename vps_services.md to vps-services.md (notice the dash) to not have to update old messages linking here
[Link to discussion](#organisation message)
I also think hyphens are just nicer than underscores when it comes to URLs, but that's just me.
GitHub Actions run 3605809446 succeeded.
708012c Rename vps_services.md to vps-services.md (#808) - Robin5605
Please go for it, would love to see a draft PR so we can preview via the netlify deploy.
GitHub Actions run 3605829235 succeeded.
Once upon a time, an admin who shall not be named deleted a reminder which was not her own. Apparently admins can do this!
Let's put in a button confirmation prompt when messing with reminders that don't belong to the command invoker, so that future admins can be prevented from making such heinous mistakes!
Forgot all about this, thought it'd be merged by now.
Please allow me to give this a once-over.
- `build: .` is a path to search for Dockerfile, just like `docker build` command's dot
IMO, we should encourage the use of docker compose over docker-compose.
3. Give it a name like `TOKEN` and paste the token.
- we can build and run the container with just one command
Do you mean "instruction" rather than construction? Never heard of it referred to that way.
You could also call it "key" or "attribute".
Looks pretty good! this is purely a code review, will test later.
This is a static view, in the sense that it's always going to have this one button, and the button is only getting used for this view. In this case I think it's better to use the button decorator https://discordpy.readthedocs.io/en/stable/interactions/api.html#discord.ui.button inside the View subclass, since it makes the relationship clearer.
Why defer if you're going to respond to the interaction with a message? since prepare_self_assignable_roles_view is synchronous and pretty simple, there's no issue with it blocking the response for a few milliseconds.
This isn't a mistake or anything, but personally not a fan of name mangling. I think a single underscore is enough to indicate that this shouldn't be used from outside, and if someone really wants to they can still call this function. We also don't use double underscores anywhere else in the codebase.
Also fetch_or_create or something along those lines is probably more accurate than search.
There are no other roles channels, so you can maybe call this section # Information
Understood, I just didn't feel like "exposing" it.
Fixed in 0a60b5d4200219233ad5164da3ae73c5f43955e7
Understood, I just didn't feel like "exposing" it.
Fixed in 0a60b5d4200219233ad5164da3ae73c5f43955e7
GitHub Actions run 3610538417 succeeded.
Fixed in 28dac62fb325e0f09404945645589a89af19bfdd
Fair enough, renamed here 72b2f803a6bb915c4bb07d3a0cd3f4d141d46431
GitHub Actions run 3610543941 was cancelled.
GitHub Actions run 3610548001 succeeded.
I don't know to be honest, I only see that its still open here.
[python-discord/sir-robin] New branch created: aoc\-join\-slash
The docstring should use the imperative mood: "returns" -> "return"
Wondering why mkdir/rmtree is used over the tempfile module. Not sure if there is much difference. Maybe tempfile has better guarantees on cleanup?
Please don't manually insert newlines. Manually inserted newlines will have to also be managed manually whenever text needs to be edited. For example, adding a new sentence in the middle of the paragraph will require all lines below to be re-adjusted as well.
The rest of the file does not do this. The intent is for the text/code editor to wrap the text.
"""An in-memory temporary file system."""
Does the output directory have to be created beforehand or is that already being done somewhere?
Would it be possible to make the output directory part of the files_pattern? Would there be a problem with ambiguity in whether the directory should be created by NsJail or by the user?
Does the
outputdirectory have to be created beforehand or is that already being done somewhere?
It's done here
https://github.com/python-discord/snekbox/blob/bytes-output/snekbox/memfs.py#L54
Well currently we have the glob start at the output folder, otherwise we'd have the output folder in the glob result and have to strip it for sending.
If we allow the output to be in the glob, the folder will still be created by NSJail so an end user will still need to change the code to have a different output folder name for example.
Yeah I think I need to rephrase this. Updated in 6ec4dd2
d33a55d Add usage of ExitStack, remove warning suppress - ionite34
This was due to the multithread test relying on implicit cleanup. I've since changed it to use contextlib.ExitStack instead to call __exit__, so this is not necessary and removed in d33a55d
Updated regex to
^(?!/)(?!.*\\0).*$
This should disallow anything beginning with / or \0 contained anywhere.
62954cd Refactor test_filesystem to use tempfile - ionite34
Actually speaking of tempfile, that's probably a better case, I've refactored this to use tempfile.TemporaryDirectory instead of manually doing this 62954cd
I don't understand your answer, but I think it's because my question was unclear.
Currently, the output directory is hard-coded to output. I'm wondering if it'd be possible to make that configurable by allowing a user to specify the directory name in this files_pattern glob. However, I think this could result in ambiguity regarding what should be the path snekbox creates, and what should the end-user have to manually create.
In any case, we can revisit it later. Not a blocker for t...
Cool solution! I've heard of ExitStack but first time seeing it used anywhere in practice.
Absolute case seems to be covered in tests but we do need to test the null byte as well.
This is a comma splice. Use a semicolon or a full stop to create a separate sentence.
On each execution, the host will mount an instance-specific `tmpfs` drive, this is used as a limited read-write folder for the sandboxed code. There is no access to other files or directories on the host container beyond the other read-only mounted system folders. Instance file systems are isolated; it is not possible for sandboxed code to access another instance's writeable directory.
c3a43ac Add configurable home and output paths - ionite34
Ah I see what you mean. I think implicitly creating paths in the glob might be a bit complex (it also would allow some arbitrary traversal and other situations) I've made the name of home and output configurable now in c3a43ac
So to not use output, memfs_output="" can be set to set the output glob root to home, or any other path.
Added additional tests in 55a9223 and checks to make sure separate \ and 0 are allowed.
As mentioned in the Title,
Writing Good Commit Messages page is showing 404 error page not found.This url is accessed from the Contributing Guidelines page.
To Reproduce the error
- Go to Python Discord Contributing Guidelines Page (mentioned above) and click on Writing Go...
Interesting, is there not a link check workflow that checks that all links are valid?
Added Resources and References for !under command as suggested in Issue #2331
GitHub Actions run 3612620757 failed.
GitHub Actions run 3612771432 succeeded.
To exclude the uncertainty, I will edit it to "allow running several services at once". Although I think you are right.
GitHub Actions run 3612774227 succeeded.
GitHub Actions run 3612781666 succeeded.
GitHub Actions run 3612788556 succeeded.
GitHub Actions run 3612789721 succeeded.
I did that here c630e1b9c2ca624dd272d634cd24704c11bea953, let me know what you think
All the requested things were fixed I think, thanks for your review @vivekashok1221
GitHub Actions run 3612828755 succeeded.
Good eye !
This has been done here 37b43a6c04af0498d96bd28ec544973d2e653941
Quick Fix:
Inside Contributing Guidelines Markdown File
change the writing good commit message url to ./contributing-guidelines/commit-messages.md
I think it will work because commit-message.md is inside the contributing-guidelines folder.
Maybe we can add the tag of good first issue.
Indeed, done here 6c6b2bc358228404978c855d18c788e85fb4433a
If you think the naming I used needs to be improved, please feel free to suggest ideas
GitHub Actions run 3613231070 succeeded.
Main reason was my bad understanding of the interaction API, editing that view was failing since it was referencing the wrong message. And I thought I needed to workaround this by keeping a ref to the original message.
Seems like using interaction.response.edit_message works well
Fixed in both 7118c51b9b62b2a5ce0e745e4832b17f52901235 and 7976bc2af0fe49ddaebc63242b581b9eecb66132
Sentry Issue: BOT-3BW
HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embeds.0.fields.0.value: This field is required
(1 additional frame(s) were not displayed)
...
File "bot/exts/help_channels/_cog.py", line 149, in new_post_listener
await _channel.help_post_opened(thread)
File "bot/exts/help_channels/_channel.py", line 127, in help_post_opened
await send...
5708021 Fix help channels with no content not opening p... - ChrisLovering
[python-discord/bot] New branch created: fix\-help\-channel\-open\-with\-no\-content
Chanels that just contained one or more images as an exampole would have the message.content equal to the empty string which != None, so the current check never got hit.
Closes #2355 Closes BOT-3BW
GitHub Actions run 3613598716 succeeded.
GitHub Actions run 3613768629 succeeded.
[python-discord/bot] branch deleted: fix\-help\-channel\-open\-with\-no\-content
Connected!
GitHub Actions run 3614257525 succeeded.
I know I'm late but what about a button that shows an ephemeral view which takes into consideration what roles the user already has, so they can select all of the roles they want in one single go?
But that's similar to what we already have, isn't it? or did I understand that wrong?
The ones they have are highlighted in red, and the message states that just fine, e.g. Whether the role will be added or removed.
But that's similar to what we already have, isn't it? or did I understand that wrong?
The ones they have are highlighted in red, and the message states that just fine, e.g. Whether the role will be added or removed.
And how would they select them all in one go?
This is what I have for roles in my guilds.
This implementation uses a slash command to show the select menu, but it could be anything: like a button in the #roles chan...
Hummm, i guess this could be discussed in another issue.
If it is going to be implemented, I think it should be done in another separate PR.
The current goal is to keep the same behavior for the subscribe command and add more visibility by '' pinning '' it in the roles channel.
I like the idea, and if approved, i will be more than happy to do it.
Let's keep this PR focused on generating the permanent view. We can discuss the changing the subscription UI in a separate issue if you want to open one @onerandomusername
[python-discord/site] New branch created: issue\-809
Thank you for the pull request :fire: Into master we go :tada: Good work team :partying_face:
GitHub Actions run 3634031462 succeeded.
GitHub Actions run 3634091944 succeeded.
GitHub Actions run 3635050780 succeeded.
GitHub Actions run 3635067573 succeeded.
GitHub Actions run 3637808430 succeeded.
[python-discord/bot] New branch created: update\-modlog\-for\-threads
With some discussion with mods, it was agreed that logging thread creation wasn't needed, for the same reasons we do not log message creations.
Thread edits & deletes are still wanted, but mod-log doesn't seem like the right place for it. Since it serves a similar purpose to our message logs, we decided to place it there instead.
GitHub Actions run 3640000547 succeeded.
I didn't get around to making the PR for this. I did look into it, but I couldn't actually figure out what was causing thread deletions not to be logged. I think my assumption about replacing on_thread_delete with on_raw_thread_delete was wrong. This probably need someone who understands discord.py and the bot better to look at it.
Small comment, but I won't block because of it since it's ultra minor
We should add a description parameter here to give a better description for end users. Something like: "Get the join code for our community Advent of Code leaderboard"
847beae Add description to the aoc join slash command. - D0rs4n
Currently the daystar command only shows the fastest completions for a day and star and not where your personal stats are compared to them. It would be nice to see your personal stats, similar to the way it shows in the leaderboard command.
[python-discord/sir-robin] New comment on issue #72: AoC: Show personal position for daystar command
Agreed, this seem like a useful enhancement. Were you interested in looking to implement this yourself, or shall I mark it as up for grabs for other contributors?
GitHub Actions run 3651368331 succeeded.
new warning isn't enabled by default
Connected!
GitHub Actions run 3651403409 succeeded.
Yeah, if a user isn't on the server then they can't send any messages of course, so it should have a similar effect.
For things like the github issue / active vote I think it's better for it to be handled manually if a user leaves so it doesn't just "disappear". We could send a message or something to let people know, although I don't think it's worth the added complexity for something so rare.
I'll close this, although thanks for thinking about this and making the issue!
May I fix this issue? I think only this need to be updated!!
Sounds good, i've assigned you ๐
I checked the source code for both api endpoint and nsjail wrapper, but i haven't seen a way to actually measure how long the code took to run. Would this be hard to implement?
A fairly common problem asked in the help channels involves in-place operations like list.sort() which return None. A simple tag could be used to explain the difference in behaviour between in-place and out-of-place functions (with examples such as sorted() vs list.sort()) and how common issues involving them can be fixed.
GitHub Actions run 3654908500 failed.
Relevant Issues
The Pull request resolve the Issue #1007
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
The relevent file has been updates as discussed in the Issue's comment
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 [c...
GitHub Actions run 3655205451 succeeded.
I was about to edit the code (through AST or directly) adding import time and START_TIME = time.perf_counter() at the beginning (obviously would use a different variable name), and print("\n", time.perf_counter() - START_TIME, flush=True) at the end then reading the last line of stdout, but this is just ugly and would not work if there was an error above in the code.
However I never used timeit from command line, I'll try to use it and let you know how it goes
Thanks, closing this for...
GitHub Actions run 3655400355 succeeded.
GitHub Actions run 3655835742 succeeded.
Connected!
GitHub Actions run 3656446121 succeeded.
Connected!
GitHub Actions run 3656472386 succeeded.
GitHub Actions run 3656477035 succeeded.
GitHub Actions run 3656485210 succeeded.
GitHub Actions run 3658929657 succeeded.
Connected!
GitHub Actions run 3659401464 succeeded.
GitHub Actions run 3659412884 succeeded.
Connected!
GitHub Actions run 3659435027 succeeded.
GitHub Actions run 3659710252 succeeded.
GitHub Actions run 3659730038 succeeded.
GitHub Actions run 3659749762 succeeded.
GitHub Actions run 3660510741 succeeded.
GitHub Actions run 3660538628 failed.
GitHub Actions run 3660538594 succeeded.
GitHub Actions run 3660538550 succeeded.
GitHub Actions run 3660545479 succeeded.
GitHub Actions run 3660538778 succeeded.
GitHub Actions run 3660628940 succeeded.
GitHub Actions run 3660629412 succeeded.
GitHub Actions run 3660629136 succeeded.
GitHub Actions run 3660635574 succeeded.
GitHub Actions run 3660664602 succeeded.
GitHub Actions run 3660668072 succeeded.
GitHub Actions run 3660670930 succeeded.
GitHub Actions run 3661008580 succeeded.
GitHub Actions run 3661004415 succeeded.
GitHub Actions run 3661031332 succeeded.
Awesome pull request!!!
Connected!
GitHub Actions run 3661263141 succeeded.
I think we should start migrating to slash commands.
It will especially be useful for commands like !d and !rule, other than those, there are many cool commands which the server's users may not even know of, for example: !listcomp or ;) !or and so on. I think if we migrated to slash commands and added autofill for some commands, it would really help people who are helping others to pull up examples faster.
Many times, I had the issue of not knowing the exact command, for `!list-c...
GitHub Actions run 3663030730 succeeded.
Well this would be cool, I believe with the commands !rule and !d it would be too cluttered (especially on mobile) and it would be easier to leave it as is.
there are many cool commands which the server's users may not even know of, for example: !listcomp or ;) !or
Thats why there is a !tags command, although I do agree they are still hidden.
Would love to continue this discussion, if you have any more ideas.
Haven't looked into this fully but one potential issue could be that we use is_channel_ignored
https://github.com/python-discord/bot/blob/23f4592710853f8cb814fce2bba2f1871a508d68/bot/exts/moderation/modlog.py#L832-L837
which will ignore the post if the post isn't in the cache (get_channel would return None)
https://github.com/python-discord/bot/blob/23f4592710853f8cb814fce2bba2f1871a508d68/bot/exts/moderation/modlog.py#L546-L550
This wouldn't really explain why normal thread del...
Hello! Thank you for contributing to this tag. Below is a bunch of changes, but they're all very small, such as adding a space/newline or removing example- (I didn't think it's necessary).
Here is what the current tag looks like. I'll post another screenshot once changes are made.
- **Dunders**: Double Underscore (Dunder) methods are special methods defined in a class that are invoked implicitly. For example, `__name__`,`__init__`,`__repr__`, and `__str__`.
Keep the spacing consistent.
>>> 1 + 1
This doesn't work in Discord embeds. It'll show up as the following:
<img width="251" alt="image" src="https://user-images.githubusercontent.com/15021300/206897545-1beb67e8-aa9c-48a3-9998-0c504350bfa3.png">
**UseCases of Underscore in Python**
- **Improve Readability**: they can also be used with numeric literals to improve readability of long numbers.
I don't think it's necessary to say that we're using an underscore, since that is what this tag is about.
- **Store Expression Value**: Store the value of last expression in an interpreter and can be used as a variable.
36ee872 Don't count bot messages as an answer in a thread - wookie184
186fd1e Merge branch 'main' into maybe-fix-help-stats-bug - wookie184
dce8be1 Merge pull request #2351 from python-discord/ma... - wookie184
533695d Bump certifi from 2022.9.24 to 2022.12.7 - dependabot[bot]
c5340bc Merge pull request #2361 from python-discord/de... - wookie184
[python-discord/bot] branch deleted: update\-modlog\-for\-threads
GitHub Actions run 3668529026 succeeded.
Connected!
GitHub Actions run 3668545756 succeeded.
Extra approval for good luck
GitHub Actions run 3668588761 succeeded.
LGTM, just as tiiiiiiiny comment.
Suggestion: I think you there could be a small nuance for some people between setting the status for the first time (upon instantiating the client) and any other time using change_presence.
So maybe detailing that by saying that if, in a further stage, you want to change the status when the bot is running, e.g. at runtime, you can do this with change_presence
I know it's presence in dpy, but that's just my opinion
Better stay consistent with "status" IMO
GitHub Actions run 3669079868 was cancelled.
GitHub Actions run 3669080756 succeeded.
GitHub Actions run 3669143029 failed.
GitHub Actions run 3669149894 failed.
Currently, the help guide on our site still uses the old help system, which makes no sense to keep it since it was disposed.
This PR updates the guide to clarify the usage of the new forum system.
GitHub Actions run 3669464836 succeeded.
GitHub Actions run 3669473096 succeeded.
GitHub Actions run 3669508154 succeeded.
GitHub Actions run 3669527494 succeeded.
GitHub Actions run 3669636874 succeeded.
GitHub Actions run 3669714862 succeeded.
GitHub Actions run 3669716697 succeeded.
GitHub Actions run 3669761244 succeeded.
GitHub Actions run 3669795370 succeeded.
GitHub Actions run 3669796856 succeeded.
GitHub Actions run 3669801036 succeeded.
GitHub Actions run 3669811248 succeeded.
GitHub Actions run 3669816852 succeeded.
A couple of things I plan on adding:
- Highlight the tags that can be selected (show how they look like when they're [un]selected)
- Mention what happens once a new post is created, e.g. the creation of the new thread, and the lovely reminder from our magnificent bot on how to ask a question
I am going to be honest, I've been on the server for quite a long time now and I've never seen the !tags command, only now, once you've told me it exists, did I check it out. That command is very useful indeed to remember all the tags and give people formatted, clean, pretty descriptions to poythonic or general computer topics.
Though I still think the community would gain more from slash commands than suffer from the clutter on mobiles. Without a doubt the discord slash command view is te...
[python-discord/site] New branch created: improve\-page\-contribution\-guide
This PR mostly adds stuff about how to do certain things with markdown in our guides that is not obvious or might cause confusion.
GitHub Actions run 3669979798 succeeded.
Leaving 3.10 as an execution option is just wasting space, as 3.10 has lost all of its libraries and packages:
3.10 offers functionally no difference from 3.11 and will probably be removed eventually. [Source](#dev-contrib message)
Seems as if this was already discussed in: #2324
We could make sure it's a 40X error and raise otherwise
I think we shouldn't obfuscate other 4xx status code, we could indeed make it catch HTTPException, and if it's a 400 or 404, we return None, otherwise we raise.
And I can take this if you want
So the only thing that needs to be done here is to keep reference of all tasks that are created by asyncio.create_task ?
We could make sure it's a 40X error and raise otherwise
I think we shouldn't obfuscate other 4xx status code, we could indeed make it catch
HTTPException, and if it's a 400 or 404, we return None, otherwise we raise.And I can take this if you want
Sounds good, assigned!
We already do this don't we?
https://github.com/python-discord/bot-core/blob/main/pydis_core/utils/scheduling.py#L80
I believe it was mostly added so that The below dunder works, but it should also alleviate the above issue.
https://github.com/python-discord/bot-core/blob/main/pydis_core/utils/scheduling.py#L44
I'll be taking care of this, discussed [here](#dev-contrib message)
GitHub Actions run 3674659192 succeeded.
I've attempted to present this case to the user in the most recent commit to this PR.
GitHub Actions run 3675061682 succeeded.
GitHub Actions run 3675246197 succeeded.
eb86541 Migrate Setting Different Statuses to Set Your ... - iamericfletcher
63c67a1 Adding extra space at end of file in response t... - iamericfletcher
eee7ace Migrate Setting Different Statuses to Set Your ... - iamericfletcher
4714b30 Merge remote-tracking branch 'origin/695-settin... - iamericfletcher
c0a15c9 Migrate Setting Different Statuses to Set Your ... - iamericfletcher
GitHub Actions run 3675280416 succeeded.
GitHub Actions run 3675721912 succeeded.
- **Store Expression Value** Underscore(**_**) is used to store the value of last expression in an interpreter and can be used as a variable. Example:
- **Single leading Underscore**: In front of a variable, a function, or a method name means that these objects are used internally, such as `_name`. However, remember that these objects **can** be accessed outside.
Looks good, but could use some rephrasing in certain areas
Use the `!dunder-methods` tag to know more about these methods
071cffa Support 3.11 & bump all deps - ChrisLovering
5ca70e5 Support 3.11 and bump CI to use 3.11 - ChrisLovering
20e7f08 Mark project as requiring poetry-core>=1.2.0 - ChrisLovering
21fcc58 Add changelog for 3.11 and new decorator - ChrisLovering
ff977c9 Simplify docker-compose volumes - ChrisLovering
[python-discord/bot-core] branch deleted: Python\-3\.11
[python-discord/bot-core] New tag created: v9\.2\.0
Looks good indeed, thanks for this !
I've left some small comments that I think should be addressed.
I think it would be helpful to link some article that explains it better here
It is indeed correct that it can be used as a variable, but I think we should state that we usually only use it for variables that are not needed from return statements, iterations, etc.
I know you've mentioned later on, but here's how I think it should be
"Underscores can also be used for variable assignments, but they are generally used to store values that will not be needed."
Then you can give your detailed examples (i see you do that later down the tag) where you say how they're using...
Looks like you have one extra indentation level here, can you fix that please ?
Maybe "python shell" is better than interpreter here ? We can wait for other people's opinions here as well
We already do this don't we?
https://github.com/python-discord/bot-core/blob/main/pydis_core/utils/scheduling.py#L80
I believe it was mostly added so that The below dunder works, but it should also alleviate the above issue. https://github.com/python-discord/bot-core/blob/main/pydis_core/utils/scheduling.py#L44
That's on the scheduler class, this issue is about the create_task function.
closes #152
Instead of returning a null member instance upon NotFound exceptions, we've also decided to do the same for all bad requests, e.g. 400 status codes.
GitHub Actions run 3679009764 succeeded.
GitHub Actions run 3679033037 succeeded.
GitHub Actions run 3679113819 succeeded.
GitHub Actions run 3679189856 succeeded.
GitHub Actions run 3679272659 succeeded.
@wookie184 What do you think of creating a global TASKS inside the scheduling module and save those tasks there ?
We would of course add a callback to clear it from the set once done along with the _log_task_exception one.
Why doesn't HTTPException need to be suppressed?
This should be named get_message since it's not a property. Generally, function names should start with some verb. Thus, the function name currently implies that it sends a message.
msg = f"{ctx.author.mention} {result.status_emoji} {msg}.\n"
if not result.files or output not in ("[No output]", ""):
msg += f"\n```\n{output}\n```"
Could you bump the version in the pyproject.toml to 9.2.1 and add a changelog to https://github.com/python-discord/bot-core/blob/main/docs/changelog.rst ?
I changed the wrong files, :facepalm:
I'll fix it
- :feature:`169` Return :obj:`None` upon receiving a bad request from Discord in :obj:`pydis_core.utils.members.get_or_fetch_member`
By doing :obj:foo you can link to the actual objects. This change rendered looks like

Neat ! I didn't know that.
Applied in 5a2f70199cf9e9bbd10c4137b72d8fdec9598ce0, thanks !
00b4f16 Return None upon receiving a bad request from D... - shtlrs
[python-discord/bot-core] New tag created: v9\.3\.0
GitHub Actions run 3686237535 succeeded.
You still didn't explain that if this variable has been assigned once, it won't allow the latest evaluated value from the REPL anymore.
Example
>>> 1 + 1
2
>>> 2 + _
4
>>> _
4
>>> _ = 12
>>> 1 + 1
2
>>> 2 + _
14
>>>
I think it would be better if we phrase it like this:
These mean that they're used in front a variable, a function or a method name, which indicates that these objects are meant to be used internally, such as _name. However, these objects can still be accessed from outside
We could also benefit from saying that the usage of these conventions is to remediate to the lack of "access modifiers" in Python, we'll let others give their opinion on this as well.
I think you should say something like: More details & examples about name mangling can be found here.
Seems you have the "Single leading underscore" duplicated.
I think you were referring to "Single trailing underscore", right ? Description needs fixing as well
GitHub Actions run 3687336956 succeeded.
Connected!
GitHub Actions run 3688795631 succeeded.
@ChrisLovering We can use all the methods present in site's APIClient without having to rewrite the code in the new Snekbox one.
We will override the ctor and url_for for it to use the new class instance that holds the base url.
The only thing that bugs me is that it'll be coupled to APIClient, but i don't think that client will change in the future which makes me think it's fine, what do you think ?
Sorry if this is taking a bit long with the review.
It is important that we maintain good quality and make this as explicit and as understandable as we could for everyone.
These should be the last changes I would request of you.
Thanks ! :D
Nit: Single Leading Underscores
- **Single Trailing Underscores**: They are used to avoid naming conflict while making a new variable whose name might conflict with a reserved keyword or package name, etc. For example, using `class` as a variable name will produce an error; and to avoid this conflict, you can add a trailing underscore to it, i.e. `class_`.
Use the `!dunder-methods` tag to know more about them.
- **Double Leading Underscores**: Double leading underscores are typically used for "Name Mangling". Name mangling is a process by which the interpreter changes the attribute name to avoid naming collisions in subclasses. More details regarding this topic can be found [here](https://www.geeksforgeeks.org/name-mangling-in-python/).
- **Ignore Values**: We previously stated that underscores can also be used for variable assignments, but they are most commonly used that way to store values that will not be needed. It is known as `throwaway variable`.
Description & Reasoning
While it's entertaining that Sir Lancebot reacts to comments containing certain words during Halloween (more accurately, all of October), it seems mildly unfair that this feature is specific to Halloween. Surely other events - notably Christmas - deserve such entertainment as well? This issue proposes adding more events to the reaction feature.
Proposed Implementation
Implementation involves upping the number of reactable "holidays" to 7, with some having ...
GitHub Actions run 3691600562 failed.
GitHub Actions run 3692021096 succeeded.
7deda34 Suppress HTTPException for redo emoji - ionite34
7c31368 Merge branch 'snekbox-files' of https://github.... - ionite34
Hm, strange, I think that was a mismerged update from main. Added it back in 7deda34
GitHub Actions run 3693076157 failed.
So it seems the limit is on the file and not total content from testing:
(Exact 8MiB file):
<img width="549" alt="image" src="https://user-images.githubusercontent.com/13956642/207548466-6ef1a223-1b0c-42f4-92bd-3f80f384361b.png">
(1 byte over 8MiB fails)
<img width="784" alt="image" src="https://user-images.githubusercontent.com/13956642/207548558-9ad1df50-b184-4c60-b10b-0c2c81bf34d3.png">
(2x 8MiB files somehow works?)
<img width="541" alt="image" src="https://user-images.githubuse...
Makes sense, changed to get_message in e248e9e
GitHub Actions run 3693234020 succeeded.
44d3607 Rename print-return to return-gif - janine9vn
c050a5a Merge pull request #2350 from python-discord/re... - minalike
36ee872 Don't count bot messages as an answer in a thread - wookie184
5708021 Fix help channels with no content not opening p... - ChrisLovering
3e17a97 Merge pull request #2356 from python-discord/fi... - minalike
GitHub Actions run 3693244450 was cancelled.
GitHub Actions run 3693251134 succeeded.
GitHub Actions run 3693495365 was cancelled.
GitHub Actions run 3693503942 succeeded.
I'm really not sure, I guess since it's in memory, closing on GC should be fine.
In any case whether we close it or not is kind of pointless, it must be open when it goes into File(), and within there, discord.py explicitly disables the close() function by patching it:
https://github.com/Rapptz/discord.py/blob/799e3c5bf09cedcd9b7e2b83df733910fa11532a/discord/file.py#L106
GitHub Actions run 3693722690 succeeded.
d005844 Add FILE_COUNT_LIMIT and error messages - ionite34
Added a 10 file upload limit and associated error messages in d005844
<img width="885" alt="image" src="https://user-images.githubusercontent.com/13956642/207570006-3f353a6e-ce84-4436-b7c7-9f3ceb7c2c88.png">
GitHub Actions run 3693933622 failed.
Connected!
Connected!
Connected!
Connected!
Connected!
Closes #1135
Adds a check to see if the errored command invocation starts with a period before suggesting commands.
Technically, to match the intention of ignoring messages that start with ".." this assumes that the prefix will remain ., but that seems like a safe assumption and it's not a huge problem if we're ignoring messages that look something like >. in the far future.
GitHub Actions run 3698331650 succeeded.
Connected!
GitHub Actions run 3699046466 succeeded.
GitHub Actions run 3699257785 succeeded.
Description
Codewars has changed the way they display their data, and this made the .challenge command not work.
Steps to Reproduce
Run .challenge python
Expected Behaviour

Actual Behaviour

Known Impacted Platforms
- [X]...
[python-discord/sir-lancebot] New branch created: kata
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #1168
Description
Updated the CSS class that was used for the soup to find new kata items.
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](htt...
GitHub Actions run 3699577939 succeeded.
It turned out to be a productive evening after all!
Thanks for taking care of it!
Thanks.
There seem to be a couple of other issues with this command but i'll open a separate issue for those
Running the .challenge command. the following issues occur:
- Interactions edit the message but still show as failed

- The same challenge seems to be shown every time for a given query, where it should be random.
Possible Solutions
I think the failed interaction thing should be fairly simple to fix, I haven't looked at the code though.
The same challenge being show...
[python-discord/sir-lancebot] branch deleted: kata
Connected!
GitHub Actions run 3706812095 succeeded.
GitHub Actions run 3706827585 succeeded.
Connected!
GitHub Actions run 3706839560 succeeded.
GitHub Actions run 3707916672 succeeded.
Tested it locally, and it looks good aside from a couple of comments.
This needs to be truncated to avoid exceeding Discord's character limit for messages. If truncated, it should be clear that it is truncated (e.g. by appending ellipsis). For the sake of readability, I think we should be fairly conservative with the amount of space these file names can take up in the message.
I'm not a fan of how this looks when inside a quote block. I also think this should be moved below the code block showing the output, which feels more consistent with other messages that conditionally appear. Any strong opinions against that?
To facilitate that change, it would be good to create separate functions to get all these different strings instead of returning a tuple.
It's meant to be closed when File.close() is called: https://github.com/Rapptz/discord.py/blob/799e3c5bf09cedcd9b7e2b83df733910fa11532a/discord/file.py#L145-L148
Does that get called anywhere either implicitly or explicitly?
GitHub Actions run 3710427470 succeeded.
GitHub Actions run 3712107662 succeeded.
PEP 585 allows us to write things like list[int] directly instead of needing to do from typing import List; List[int]. With this, the typing imports are now deprecated:
The deprecated functionality may eventually be removed from the typing module. Removal will occur no sooner than Python 3.9โs end of life, scheduled for October 2025.
My current understanding is that removal wont happen for a long time and isn't currently planned, although I think...
I generally dislike repo-wide style changes. They creates huge PRs which are a chore to review, and merge conflicts for open (and yet to be opened PRs). I'm not exceptionally against it, but I think a healthier approach is to make these updates as we go in code that we're already changing. For example if we fix a bug in some function, we can update the signature while we're at it to change List to list. If we ever do hit a point where it's about to be removed from the stdlib, the repo-wide PR...
It would be a large PR, but it shouldn't be hard to review, since it's a simple code transformation, there's not really much to review. IMO these things only end up as a pain when other issues are noticed in the process and other bits and pieces end up being added.
I don't really like unrelated changes being added into PRs. If it's new code or lines being changed that's fine, although if we only change it in those cases I don't think things would really change, especially since many people...
Wich firewall is running on this infrastructure?
Looks good to me, thank you ! :D
@ChrisLovering a couple of questions here
- Paste service utilities
I'm struggling to see why would snekbox wrapper contain paste service utilities, shouldn't it have its own wrapper ?
But also, are you talking about this precise utility ?
- Base class for use with eval-like cogs (snekbox, internal eval, latex)
I noticed that we don't use snekbox to eval code...
-
Moved message to be below output
-
Changed wording a bit, now shows count of failed files.
-
Truncation on whole file names, either exceeding 85 characters, or 5 files.
<img width="764" alt="image" src="https://user-images.githubusercontent.com/13956642/208238523-972b4684-db8d-48e5-a096-3d57a885af8e.png"> -
If a single file exceeds 85 characters, only displays
(...)
<img width="764" alt="image" src="https://user-images.githubusercontent.com/13956642/208238610-6944345c-2e6c-4e9b-9cf...
GitHub Actions run 3719786805 succeeded.
GitHub Actions run 3719938347 succeeded.
GitHub Actions run 3719975065 succeeded.
Yeah but BytesIO is an instance of IOBase, which in this check means self.owner = False
https://github.com/Rapptz/discord.py/blob/master/discord/file.py#L90-L95
So even calling self.close() would not run the conditional self._closer() for BytesIO
Separate functions implemented, and added some unit tests since d2de465. Images in other review comment thread https://github.com/python-discord/bot/pull/2326/files/56664828c300b0380e16cde66f6106b0fdcf56bd..d00584408a20e231df1e3d6ce3c4837e6bb829e4#diff-578c89688caf1d45de35421fc8343ffa1d3e675aeda44a6d476d11a3ff286322
SELF_ASSIGNABLE_ROLES_MESSAGE = (
f"Hi there {GREETING_EMOJI},"
"\nWe have self-assignable roles for server updates an events!"
"\nClick the button below to toggle them:"
)
Looks great, just a few nitpicks
https://github.com/python-discord/bot/blob/91a869e4a23fdee8c6407678ca178e324d6184f3/bot/exts/info/subscribe.py#L101
Let's get rid of that dot at the end while we're at it.
Oh, that's a good one.
Done in c55b9ffb
GitHub Actions run 3723870966 succeeded.
Should be named get_failed_files_str, and maybe also be private.
Thanks for refactoring that. Returning a tuple there has been bugging me for a while now.
Instead of just showing ... when it's too long, can it truncate the file name e.g. 1 file (reallylongfi...)?
Also, I'm okay with the current logic of 85 chars or 5 files, but I would have just had a character limit and truncated the last filename in the list. Let's say there are 10 files, but they are under 85 chars in total. It's free real estate being given up I think.
successful qualifier submission -> push submission ID to a MessageQueue -> sir-robin digests queue to add to CJMS using the forms API, fetching all the background info that Cam mentioned above.
After qualifier run a (new) command that spawns a persistent view with a confirm/unconfirmed button. This marks the user a confirmed in the DB.
After some time run another command that removes this view and runs the script auto-generation script against the database and returns a CSV of the sugge...
Make sure the button has some cool down, so users can't spam confirm/un-confirm
I'm struggling to see why would snekbox wrapper contain paste service utilities, shouldn't it have its own wrapper ?
This was in the context of which modules should be ported over, so it doesn't mean that the paste utils have to be part of the snekbox wrapper.
Last thing, I don't see any Latex cog in our code base, so I wanted to make sure whether I'm missing something or not.
There used to be on in Sir Lancebot, but maybe it got removed or disabled due to issues.
I noticed ...
@wookie184 Do you still plan on continuing your review?
Alright, thanks @MarkKoz for clarifying.
In that case, here's what I'll do
- Start with the basic eval endpoint for snekbox
- Wait for Ionite's PR to finish, then port that over as part of the wrapper
- Open up a new issue for a new wrapper over the pasting service, and I'll take care of porting it as well (and discuss details in a separate issue)
In the meantime, I suggest the original comment that Chris has made about what should be ported over for better context to future readers
Though interal eval does not use snekbox, there is likely still some overlap in code. I imagine we can have a base class with common features, and we can also take the opportunity to make the eval commands behave more consistently with each other.
Internal eval is used in pretty much every bot, so we can just straight up port that command over I believe (modifying it to use the base class described above). Snekbox will only ever be in one bot, so I'm not sure why this issue is named "snekb...
GitHub Actions run 3735156321 succeeded.
Renamed in d7722b3
Not sure if it should be private, it doesn't mutate or allow any access that needs to be protected, maybe invoking it directly could be useful for custom error logging or such?
GitHub Actions run 3737567375 succeeded.
3dfde52 Truncate FileAttachment repr to avoid log spam - ionite34
Minor update in 3dfde52 to truncate FileAttachment.__repr__ to avoid logs being spammed with megabytes of data from large user written files.
GitHub Actions run 3739161761 succeeded.
Actually this reminded me, we need to do some sanitizing of file paths before attempting to upload to discord, since they only allow ascii-alphanumeric, underscores, slashes, and dots.
<img width="704" alt="image" src="https://user-images.githubusercontent.com/13956642/208638316-2fd43674-2133-4f25-a073-04c990a1fa7c.png">
Added normalization and associated unit tests since b04143c
2b4c85e Change failed files str to truncate on chars only - ionite34
Changed to only truncate on 85 characters. Will skip further files if less than 3 characters left in the limit. 2b4c85e
GitHub Actions run 3739623591 succeeded.
5e0c8b7 update create reminder permission error to ment... - shenanigansd
[python-discord/bot] New branch created: shenanigansd\-patch\-1
GitHub Actions run 3743252600 succeeded.
Currently, the reminders cog just says "you can't" if you can't create a reminder in a specific channel:
https://github.com/python-discord/bot/blob/c85ef1648ce54ec9f500361fcab5add83e47c837/bot/exts/utils/reminders.py#L281-L284
It should be updated to mention that you can create a reminder in #bot-commands
GitHub Actions run 3748282521 succeeded.
00eee0d Add a server bootstrap script - ChrisLovering
[python-discord/infra] New branch created: server\-bootstrap\-script
[python-discord/infra] branch deleted: server\-bootstrap\-script
0f7d8c1 Add instructions to the bootstrap script - ChrisLovering
[python-discord/infra] New branch created: bootstrap\-script
8532047 Make the .ssh folder before making a file within - ChrisLovering
16763e7 Add instructions to the bootstrap script (#74) - ChrisLovering
[python-discord/infra] branch deleted: bootstrap\-script
I don't think i'll have a chance to test this thoroughly, but this looks good.
5fb5ce7 Update bootstrap script to use shorturl - ChrisLovering
[python-discord/infra] New branch created: use\-shorturl
bfad182 Update bootstrap script to use shorturl (#75) - ChrisLovering
[python-discord/infra] branch deleted: use\-shorturl
This does not include the sudoer lecture.
b4a3715 Add MOTD and sudo lecture roles - ChrisLovering
[python-discord/infra] New branch created: Add\-sudo\-lecture
Hi, if you want to help out with the python-discord/bot there is a good guide to contributing that can be found here.
In the future, please make sure that pull requests created meet the Contributing guidelines
I like the ephemeral response route for this.
Connected!
GitHub Actions run 3752098998 succeeded.
GitHub Actions run 3752117985 succeeded.
Connected!
GitHub Actions run 3752136364 succeeded.
GitHub Actions run 3752145198 succeeded.
Connected!
GitHub Actions run 3752164735 succeeded.
Why isn't this receiving any love?
I see the PR you mentioned has been Merged @Robin5605 .
I can yoink this and make our lives better!
@shtlrs you can feel free to work on it but I can be a backup if needed.
I've worked on similar code with the eval bookmark one and it's quite similar so I should be able to do it as well.
So I just want to save you the headache beforehand: you can't have have a context menu decorator inside of a cog. See this comment for more information.
As for making it ephemeral, I'm not sure I like making the resultant meth...
No I definitely see your point concerning the ephemeral part.
However, the "definition" of important here is debatable, but also the reach of the message, meaning where it was invoked.
If this were to be in py general for example, and that's because a lot of people engage there ( or in other topical channels as well)
But this can't always be the case in forum help posts, and having a random message popup could be a bit confusing (just a tiny bit IMO)
I struggle to position myself with whe...
Looks like the general consensus is to keep it ephemeral. If, for some reason, we change out minds at a later date, it's an easy fix.
@shtlrs you can go ahead and self-assign now ๐
The only reason we added the emoji (now button) is to stop people running the command themselves to bookmark a "good" message and spam the channel.
Now that ephemeral messages and context menus exist, I am happy to entirely remove the command portion of it and just have the context menu, as it's far more intuitive and doesn't disrupt the conversation.
This logic means that clicking on the topic refresh button doesn't actually output a new topic, it just uses the previous input, if the title is beyond the limit.
I think a better way to deal with this would be when a user clicks on the emoji the new topic becomes number 1 and the rest get pushed down a number.
Then, when adding the topics if the last topic would make the title go beyond 256 characters, don't add it.
This would mean the newest topic is always the number 1 topic, and th...
GitHub Actions run 3754121511 succeeded.
I think a better way to deal with this would be when a user clicks on the emoji the new topic becomes number 1 and the rest get pushed down a number.
I considered this,but this would change the ordering of the older messages. One point of adding this feature is so that people wanting to respond to a specific topic could include the number of that topic in with their reply, e.g. someone responding to the second conversation starter could say something like "For topic 2, ...". Changing the...
GitHub Actions run 3754252326 succeeded.
Proposal to add a !mypy command
Works like !eval or !timeit but instead of running the file, run a mypy type check on the file using snekbox and return the stdout results.
Depends on
- https://github.com/python-discord/snekbox/pull/159
- https://github.com/python-discord/bot/pull/2326
- Add
mypyto our snekbox deployment venv
Alright, I'll take this then
1b44290 Fix typo in AoC unlink command - shenanigansd
[python-discord/sir-robin] New branch created: shenanigansd\-patch\-1
I think a better way to deal with this would be when a user clicks on the emoji the new topic becomes number 1 and the rest get pushed down a number.
I considered this,but this would change the ordering of the older messages. One point of adding this feature is so that people wanting to respond to a specific topic could include the number of that topic in with their reply, e.g. someone responding to the second conversation starter could say something like "For topic 2, ...". Changi...
self.cog_load_task: asyncio.Task | None = None
IMO this tag is currently much too long, I had to zoom out to even fit it on my screen:

I've had a go trying to condense this down. I would even consider removing the code blocks but it may not be necessary.

**Meanings of Underscores in Identifier Names**
...
[python-discord/bot] branch deleted: shenanigansd\-patch\-1
Sounds like a good idea, I don't think we have a tag like this currently.
Connected!
GitHub Actions run 3758569786 succeeded.
@wookie184 What do you think of creating a global
TASKSinside theschedulingmodule and save those tasks there ? We would of course add a callback to clear it from the set once done along with the_log_task_exceptionone.
Sounds good (although I'd probably call it _background_tasks, not really constant so wouldn't be all caps)
Okay, the change seems quite easy, shall I take care of this ?
The docstring could also be changed (with -> from) but it's no biggie.
Okay, the change seems quite easy, shall I take care of this ?
Sure
74227ca Move Kubespray Inventory - HassanAbouelela
[python-discord/infra] New branch created: unify\-inventory
a5ea11c Enhance code consistency in the AoC Cog - D0rs4n
[python-discord/sir-robin] branch deleted: shenanigansd\-patch\-1
f2a3680 Fix typo in AoC unlink command - shenanigansd
[python-discord/sir-robin] New branch created: shenanigansd\-patch\-1
[python-discord/sir-robin] branch deleted: shenanigansd\-patch\-1
f2a3680 Fix typo in AoC unlink command - shenanigansd
[python-discord/sir-robin] New branch created: shenanigansd\-patch\-1
[python-discord/sir-robin] branch deleted: shenanigansd\-patch\-1
GitHub Actions run 3762413107 succeeded.
Related: #1880
Hm, do you think we should just give a way for users to specify a -m? That would allow stuff like mypy and flake8 without adding new commands. It would just need for those modules to be added to snekbox.
!e -m mypy
# code to check with mypy
!e -m flake8
# code to check with mypy
we can continue to default the first block as main.py and append main.py to the end of the arguments
Current working command schemes:
!eval -ipython!e -i
Support IPython mode for eval with code blocks as "cells". Matplotlib will use a custom backend for show() which writes a png file to the output folder for upload.
This will use the ipykernel backend with full support for ipython magic commands like %%time
We can also inject custom exec tasks, imports, or custom ipython macros and magic commands via ...
GitHub Actions run 3764817130 succeeded.
GitHub Actions run 3766866923 succeeded.
Closes #1089
This adds the support of bookmarking a message from a context menu, but preserves the old behavior as well.
Unfortunately, the user loses the possibility of selecting a title for a bookmark if invoked from a context menu.
GitHub Actions run 3766973590 succeeded.
@Robin5605 @ChrisLovering @shenanigansd
It's sad to see that a user loses the possibility of choosing a title for the bookmark.
What do you think about upon interaction, the bot prompts the user for a title, and sends a bookmark for it ? I know it may not bee the best experience, but i think it's a shame to lose the title possiblity.
It could be a bit annoying for the people that don't use the feature now to suddenly have it be required, but I think that enough of the userbase uses to make it worth implementing.
GitHub Actions run 3766998637 succeeded.
Hello, thanks for the PR!
Just a few issues :slightly_smiling_face:
I'm not sure this function had to be extracted out into it's own function. It also does more than the name implies, not only does it check if a user is permitted to bookmark, but also sends an error message.
I think we should just move the logic back into the context menu callback and original text command, since a method to build the error embed is already there:
if not permissions.read_messages:
log.info(...)
error_embed = Bookmark.build_error_embed(...)
# In t...
For consistency with the other build_* methods
embed = discord.Embed(
description=(
f"Click the button to be sent your very own bookmark to "
f"[this message]({target_message.jump_url})."
),
colour=Colours.soft_green,
)
return embed
I think it makes the most sense to only sync the tree either A) on command or B) in setup_hook on bot startup
I think the experience for the majority of users who don't often give it a title should be prioritized.
We want it to be a simple right click > bookmark > done experience.
I'm thinking something like a button attached to the ephemeral embed that opens up a modal allowing you to further edit the title.
This way only people who want to have a title for their bookmark embed have to go through this modal and we don't force everyone to.
I offer my services for this code as it could be potentiall...
b32eec2 Bump flake8-isort from 5.0.3 to 6.0.0 (#1175) - dependabot[bot]
Connected!
GitHub Actions run 3770090212 succeeded.
If we offer the optional ephemeral with modal, how will we time the sending of the DM?
I don't want to sacrifice the ability of adding titles.
That's what I had in mind, in a "general" setup hook for the bot, not per Cog, but I thought __main__ would be that.
But I just browser and I saw that Bot has a setup hook as well, I'll move it there
@Robin5605 Yes that's the original idea.
What you said would work, I'm thinking the user gets a text input that comes with 2 buttons, a '' submit '' one and a '' i don't want to give this a title one'' where the whole operation can be skipped.
It's just the raw idea of course, and the wording is just there as a placeholder.
@minalike when it comes to timing it, here's how i see it.
The user utilizes the context menu, and gets prompted for a title through a view that'll have the previously me...
I don't think having a timeout would be a good idea, someone might take a little longer to type it out and then it would get cancelled.
I do like the idea of a modal with a text input though.
I think this would work best if we had an optional text input, where the placeholder is the title it would be by default.
That way a user can just submit the modal and get the bookmark with the default title, or overwrite it if they ant to.
this likely makes more sense in bot core
30ac392 save strong references of newly created tasks i... - Amrou Bellalouna
b0384ec Merge branch 'main' of https://github.com/shtlr... - Amrou Bellalouna
4dc7593 save newly created tasks in a set - Amrou Bellalouna
f68399e update version and carve it in changelog - Amrou Bellalouna
31265fd fix instantiation of bg tasks set - Amrou Bellalouna
Well, that's actually a great idea as well.
Especially because the message is ephemeral, so if someone doesn't submit the choice, they just wouldn't get the bookmark, but it also won't flood the channel.
I think I'll go for that, and if anyone else disagrees, we can still discuss it of course.
That's true, I'll move this to a different PR
5742596 Sync global and guild app command tree on startup - ChrisLovering
[python-discord/bot-core] New branch created: sync\-tree\-on\-startup
This change syncs all app commands after extensions have been loaded.
This release also removes the need to run :obj:pydis_core.BotBase.load_extensions in a task, and it can just be awaited directly.
A beta release for this PR is available under 9.4.0b1 on pypi.
df0cd51 TEMP COMMIT FOR TESTING - ChrisLovering
I have also made this available for testing on this PR https://github.com/python-discord/sir-robin/pull/71
Looks like I didn't communicate my idea well -
So a user would click on the bookmark context menu, and immediately the bookmark would be sent to their DM with the default title. The people who don't care about custom titles are happy - nothing has changed for them.
Now, there is an extra button in the ephemeral message in the channel where it was invoked "click here to change the title". This button brings up a modal where you can enter your title, and on submit, the bot would go back and e...
GitHub Actions run 3775559266 succeeded.
6736eb1 Start Completionist Role Assignment - janine9vn
[python-discord/sir-robin] New branch created: janine9vn\-patch\-1
Uncomments the starting of the completionist role task. A better approach for future years will be taken after this event ends.
Description
The proposed feature is to enable Lancebot to make queries to DeepL. This is an AI-powered translator that, although limited to few languages, performs quite well with the supported ones and vastly outperforms Google translate.
Reasoning
It would be cool, for one. Additionally, it could help some users whose English is not so great (either by allowing others to translate their messages into English, or backwards).
Proposed Implementation
I have none in mind, ...
The actual implementation is up for debate (e.g which service we use)
But as an overall I'm in favor of this translation feature because it's not uncommon we have folks who have difficulty with English and it would widen up our audience a lot.
[python-discord/sir-robin] branch deleted: janine9vn\-patch\-1
I'd like to increase the task timing for the completionist role assignment to something higher. I'm fine with any value up to 12 hours. I think maybe something every hour or 3 hours could be a good compromise.
I'd also like to create a stop/start command(s) for the completionist role that'll be role locked to Admins & Event Lead. We don't want the completionist assignment running all year.
GitHub Actions run 3776961254 failed.
75063a4 Modernise CI with reusable workflows - ChrisLovering
[python-discord/sir-robin] New branch created: moderinse\-CI
Connected!
Connected!
The actual implementation is up for debate (e.g which service we use) But as an overall I'm in favor of this translation feature because it's not uncommon we have folks who have difficulty with English and it would widen up our audience a lot.
I don't think it'd be the ideal move to try and open the server up to more languages, there would be burden on moderation to actively trans
We've already begun a slow but steady migration to using the new features. We already have a bunch of buttons in places, and we're about to start using context menus for bookmarks. Our approach to all of these is to create these new slash commands as alternatives, while keeping the text commands as they are. People can use whichever they prefer the most. I am completely in favor of creating these alternative slash commands for commands that would benefit from them (not all commands do, it's i...
Oh, and this would probably have to be a whole project on it's own as we have quite a few commands and migrating to slash commands would be a lot of work.
Changing to up for grabs - no response from author.
Hey @Bluenix2 ! Don't mean to rush you, but what's your status on getting the reviews resolved? If you're unable to, we can make this up for grabs for someone else, no worries!
Thanks ๐
Ignore my previous comments. The tags were incorrect. This PR is pending any further reviews.
@Diabolical5777 will you be able to resolve the rest of @Bluenix2 's requests or can we change this to up for grabs? Thanks!
Hello! So the main goal of the project is complete. All the pins linked here have been migrated to site. The only ones left are the "additional topics" (#702 and #703).
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?
Thanks!
GitHub Actions run 3780564763 succeeded.
Done in dc5fa83c8720a8ea90867705b1b5463b0511d40b
I don't understand this suggestion. Some of the other build functions save embed to a param, since they need to add authors or thumbnails etc. However, this and build_error_embed don't, so just return the embed directly.
[bot-core] Branch sync\-tree\-on\-startup was force-pushed to `c4d5630`
Connected!
GitHub Actions run 3783437736 succeeded.
Description
When using the bookmark command, if your DMs are closed the bot warns you to enable DMs to receive the bookmark. However, you are still registered as having received the bookmark afterward.
Steps to Reproduce
- Block Lancebot (or close DMs)
- Run the
.bmcommand for a reply - warning embed is displayed
- Unblock Lancebot (or open DMs)
- Click the "Receive Bookmark" button
- *private notice is displayed that you have already received a bookmark to that messa...
GitHub Actions run 3786694154 succeeded.
GitHub Actions run 3786784787 succeeded.
Bumps botcore from 8.2.1 to 9.3.0
Currently, this stops at 9.3.0 because sir-lancebot depends on python 3.10.x as a runtime dependency, this will be addressed in a separate issue.
GitHub Actions run 3787196599 succeeded.
Looks good to me! 9.3.1 is available on pypi now too. Feel free to bump to that version, consider my approval is still valid if you do.
GitHub Actions run 3788959944 succeeded.
GitHub Actions run 3789056833 succeeded.
GitHub Actions run 3790059960 succeeded.
As a rule of thumb we want the bookmark_title to come before __init__
bookmark_title = discord.ui.TextInput(
label="Choose a title for you bookmark",
placeholder="Type your bookmark title here",
default="Bookmark",
max_length=50,
min_length=0,
required=False
)
def __init__(
self,
message: discord.Message,
action_bookmark_function: Callable[[discord.TextChannel, disc...
I'd like to be very clear that this is completely optional. Users would only know this was optional if they knew that required modal inputs had a little red asterisk, which is easy to miss and not something everyone knows about
label="Choose a title for you bookmark (optional)",
@Rithx - you posted a seemingly valid Discord API token in your message. This means that your token has been compromised. Change your token immediately at: https://discord.com/developers/applications
GitHub Actions run 3796222106 succeeded.
GitHub Actions run 3796221804 failed.
GitHub Actions run 3796221891 succeeded.
GitHub Actions run 3796221074 succeeded.
GitHub Actions run 3796221875 succeeded.
GitHub Actions run 3796242261 succeeded.
GitHub Actions run 3796229099 succeeded.
GitHub Actions run 3796561382 succeeded.
GitHub Actions run 3796587158 succeeded.
GitHub Actions run 3796586043 succeeded.
GitHub Actions run 3796589746 succeeded.
GitHub Actions run 3796591240 failed.
GitHub Actions run 3796610416 succeeded.
GitHub Actions run 3796636494 succeeded.
GitHub Actions run 3796633358 succeeded.
GitHub Actions run 3796659180 succeeded.
GitHub Actions run 3796741352 succeeded.
This function is a closure which closes over msg, confirmation and self. We need access to these during the check.
One possibility would be putting this as a method and then using functools.partial however I think that a closure is more clear.
This was a conscious decision, as it is generally seen as bad practice to store unicode characters in source files: they are quite difficult to work with. The alternative used here is the most readable one.
That said, I will change this since it appears that I have been outvoted.
Connected!
GitHub Actions run 3797271819 succeeded.
GitHub Actions run 3797283449 succeeded.
GitHub Actions run 3797285505 succeeded.
5144f83 add thread_id column to the nomination table - Amrou Bellalouna
bb160ae add thread_id to serializer's fields - Amrou Bellalouna
bf34837 delete buggy migration - Amrou Bellalouna
5c2b8c2 fix grammar in thread_id's help text - Amrou Bellalouna
8bc05d1 push forgotten model update - Amrou Bellalouna
GitHub Actions run 3797312407 succeeded.
Since this PR that this one depends on has been merged, we can now merge this one as well.
5bde608 Link previous nomination threads to a user nomi... - shtlrs
I think this one is irrelevant now since our help system has been fully migrated to the forum one.
Connected!
GitHub Actions run 3797337469 succeeded.
@gamingbuddhist I think we have this now thanks to the new help system.
Unfortunately, we're a bit limited when it comes to the number of tags allowed (I think it's 10)
This PR moves the kubespray inventory, updates parts of it, and documents deployment steps.
There are a lot of files, particularly in 232f631, which have been moved up from the kubespray directory. Because that directory was a submodule, there is no real diff, however I've made minimal changes which are as follows:
- Documented and linked docs for
upstream_dns_serversingroup_vars/all.yml - Added the credentials folder to the gitignroe
- Combined the inventory file at the project r...
Now we're using forum channels this doesn't seem relevant any more.
I think this can be closed
Dedicated commands would make it easier to add special casing to commands, which we may need (e.g. to provide default settings, maybe allow users to change settings, and maybe for formatting the output).
Commands are more "standard" so e.g. they would work with the !help command by default.
Duplicate of #2188, will close that one since this has more discussion, but please check for existing issues before opening a new one in the future.
GitHub Actions run 3801719033 succeeded.
Rock solid man. You didn't just take the ball and drove it home, you took the entire stadium with you as well. Awesome work.
Can we remove this file? I don't understand what it's doing at the moment. Artifact of kubespray?
Thank you. Great change.
Itโs generated when running in the init script, not sure if itโs actually used anywhere.
Not part of the init script, just the sample inventory https://github.com/kubernetes-sigs/kubespray/blob/master/inventory/sample/inventory.ini
eb86541 Migrate Setting Different Statuses to Set Your ... - iamericfletcher
63c67a1 Adding extra space at end of file in response t... - iamericfletcher
eee7ace Migrate Setting Different Statuses to Set Your ... - iamericfletcher
4714b30 Merge remote-tracking branch 'origin/695-settin... - iamericfletcher
c0a15c9 Migrate Setting Different Statuses to Set Your ... - iamericfletcher
GitHub Actions run 3802873076 succeeded.
[python-discord/site] branch deleted: improve\-page\-contribution\-guide
63f1d78 Add tips that showcase markdown quirks. - kosayoda
7f80bdc Point showcase link to an actual example. - kosayoda
d584c7c Kaizen: Ensure consistent formatting and wording. - kosayoda
abf7a32 Merge branch 'main' into improve-page-contribut... - Xithrius
b4e2c53 Merge pull request #815 from python-discord/imp... - Xithrius
GitHub Actions run 3802893907 succeeded.
GitHub Actions run 3803099031 succeeded.
I'm confused, it seems like half of the PR was removed in this merge commit https://github.com/python-discord/bot/pull/2319/commits/f2c138fd87afd42c21325a55d1f57a1d29452813, so what was merged is incorrect
GitHub Actions run 3807850718 succeeded.
GitHub Actions run 3809068711 succeeded.
I'm reopening this issue since the most of the code was unfortunately lost due to a merge.
A new PR will be made to reinclude the previously implemented changes here.
[Link to discussion](#community-meta message)
Should the eval command !e with an inline codeblock or no codeblock at all be ran and the output printed by default? (This is similar to how the Python REPL functions:
python
Python 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> "Hello, world"
'Hello, world...
After discussing this further with @ionite34, I'm rejecting this idea in favour of #2369. While this seemed good on paper, the implementation details makes this a bad idea:
- If the one-liner already has print() then !eval will output None ... and then the rest of the output which would be confusing
- Statements would break (we could catch SyntaxError and try again without the implicit print call being wrapped, but that's messy)
- Semicolons have no chance of working
And interacting...
With #2369 as-is, you'd do !e -i <one-liner> and thanks to IPython, it would show the eval result (like ipython).
b132292 Add jump_url_text field to infraction model - vivekashok1221
[python-discord/bot] New branch created: vivek/jump\-url\-infr\-log
GitHub Actions run 3811141666 failed.
GitHub Actions run 3811171618 succeeded.
eb86541 Migrate Setting Different Statuses to Set Your ... - iamericfletcher
63c67a1 Adding extra space at end of file in response t... - iamericfletcher
eee7ace Migrate Setting Different Statuses to Set Your ... - iamericfletcher
4714b30 Merge remote-tracking branch 'origin/695-settin... - iamericfletcher
c0a15c9 Migrate Setting Different Statuses to Set Your ... - iamericfletcher
GitHub Actions run 3811222390 failed.
GitHub Actions run 3811349159 succeeded.
I guess infraction messages would never be deleted, would they ?
otherwise that'll be a blank jump, but i think it's unlikely for something like that to hapen.
Because what I'm thinking is, if an admin or mod expect to find the infraction message, but they don't, it could potentially be confusing.
So storing message id then fetching it would give more context, but again, i think it's almost impossible to happen
A couple of nit changes here and there but I haven't tested this yet.
Jump URL: {jump_url_text}
For consistency with the one in `management.py
This is purely a code review, will test later!
Thanks for the PR vivek ! :D
Wouldn't it be better to store the raw URL in the database ? And do the formatting on the bot's side ?
Is this file supposed to exist ?
It looks like it came from a merge, but it's strange since the two dependencies have the same identifier.
I think deleting these 2 & making a new migrations would be cleaner
Help posts with deleted messages and no further messages from the opener are closed faster than normal posts.
You can see the logic here.
This PR fixed the merge mistake that happened in this PR
The original description of the linked PR contains all the details.
GitHub Actions run 3812108437 succeeded.
@vivekashok1221 After some testing, and when I tried deleting the message, the jump URL will take you to the latest message sent in that channel, which is confusing.
Again, this is a very unlikely case to happen so it might not even be worth dealing with
Back when we discussed this feature in our internal mod channel, we agreed that it was okay to leave dead links as is because, you're right, it's not something that happens often.
Well, in that case, I'll resolve this then.
Thanks !
This file's the result of running python manage.py makemigrations --merge.
Ah I see, I didn't know this existed.
Don't you think it'd be cleaner to have a separate one, with a different id ? instead of this merged format ?
I was initially doing what you described but changed to this because it looked cleaner bot-side. But I'll do what you're suggesting because it will be more modular.
Similar merged migration files already exist in the project so imo it's fine.
Sure, that's one way to view this.
Even though I don't fully agree, since having something that can or could've been improved doesn't mean we should do it again.
I think the conflict happened because of the migration I did on the nominations table, which has already been merged into main 2 days ago.
And the conflict happened just on the naming, and not on the model itself, and I still think it should be done on its own.
We can wait for others to see what they think about this.
Connected!
GitHub Actions run 3812981431 succeeded.
Yea, i did not imagine this to be a wrapper for the snekbox API itself, as it is already very trivial, but rather a wrapper for the logic involved in evaling code, as Mark says.
GitHub Actions run 3817894935 succeeded.
[python-discord/king-arthur] New branch created: rule\-refresh\-command
This adds a command to refresh the devops rules, and bumps all the deps
GitHub Actions run 3817925885 succeeded.
That change is due to the fact that my other PR that hasn't been merged is needed, so I merged it here.
When it does get merged, I'll clean up the history.
Should we make this configurable to run just like we do for autoreview ?
Fixed in 5a916ac6de32f13758eff0ba536d5243accd8998
And now that my previously mentioned PR has been merged, these changes no longer exist
Merge happened here 59319b4dd38d6fa49d3eb135604b2c1977c31b03
Alrighty, fixed in 1c8059adda2a26f01d55e384d4506e4fefb882e0
ecb835a Make the infraction message mention @ModMail - swfarnsworth
[python-discord/bot] New branch created: swfarnsworth\-modmail\-account\-mention
Previously, the footer for non-ban infraction messages would say to DM the ModMail bot. This commit makes "ModMail" a clickable mention of the bot.

When this footer was introduced, we decided not to make it a mention, in case the recipient did not have the ModMail bot account in their user cache (which would cause it to render as the account ID, ie "send a message to 683001325...
GitHub Actions run 3818164329 succeeded.
How about having the mention inside a pair of parentheses instead?
f'send a message to the ModMail bot (<@{MODMAIL_ACCOUNT_ID}>).'
this check can be done in the init function so that the loop isn't even started if this secret set
nomination.inserted_at is the datetime the nomination was created, rather than put up for review.
We want to use the date that the nomination message was posted up for review for this calculation.
GitHub Actions run 3821734180 succeeded.
What is the difference when having <@{MODMAIL_ACCOUNT_ID}> opposed to <@!{MODMAIL_ACCOUNT_ID}>?
Since this is sent in a DM channel, the bot doesn't have a nickname, so the ! will do nothing right?

This is how @barren sonnet rendered for me in my DMs with the Python bot. But @barren sonnet` renders the same way.
GitHub Actions run 3826990262 succeeded.
GitHub Actions run 3826992883 succeeded.
GitHub Actions run 3826994887 succeeded.
How about we made these updates per package/module?
Yes it's a lot of PRs, but at least
- We control the range
- It's very easy to review and can be merged instantly
- Makes reverting (just in case, even thought i don't see why we'd do this) easier
The only "downside" to this if we do it per module, is that it'll result in a lot of PRs since we have a lot of modules.
Looks great, thanks wookie :D
One tiny comment for you :p
This would be a good place to start using PEP 604 :D
If it's just been deleted then the cache is the only thing we can rely on, since fetching will just 404. Not sure the best approach to fixing this, outside of keeping our own cache or looking to improve upstream.
We have the thread in the on_thread_delete function, but we're trying to get it from the cache again in the is_channel_ignored function. If we passed the thread directly to is_channel_ignored rather than the ID we could avoid this.
That is, unless the on_thread_delete function isn't being called at all, but I can't see why this would be the case without some discord.py bug.
95fd2df Allow passing ful channel objects to check if t... - ChrisLovering
[python-discord/bot] New branch created: allow\-passing\-channel\-objets\-when\-checking\-ignore
This means that the is_channel_ignored fucntion can be used with on_*_delete events that have the channel object, but can't be retreived fromthe cache by the is_channel_ignored function
Ahh right, that makes sense. An easy thing to check opened https://github.com/python-discord/bot/pull/2375 for this
GitHub Actions run 3829148927 succeeded.
Code seems fine, but where would this be necessary?


