#dev-log
1 messages ยท Page 78 of 1
GitHub Actions run 1015740435 succeeded.
Connected!
[python-discord/api] New comment on pull request #14: Fallback to the old API for undefined routes\.
Could we possibly add the python-discord/site GHCR package to docker-compose.yml?
I also thought about that, but decided against it, due to the docker initialization steps required to get the site up and running. I don't really want to duplicate postgres/init.sql across the repositories (albeit not sure if it's required in the first place), and if you have the site development set up locally, it's very straightforward to use it.
@vcokltfre Are you still working on this? If not, I'd like to work on it instead.
I'm assuming that this hasn't been worked on because I can't seem to find any PRs related to this...
I have most of it done, just been a bit busy with life stuff recently
Relevant Issues
Closes #782
Description
Adds a cog to run Duck Duck Duck Goose games. It randomly chooses cards for the game, then crops the corresponding card images from a pregenerated PNG file of every possible card and pastes them together into a board with index labels.
It listens for comments in channels with a currently running game for those that contain three numbers, and parses them as potential answers. The game ends either when the time limit is up (set at 3 minut...
GitHub Actions run 1016156181 succeeded.
Connected!
Connected!
Maybe something to think about: the large-ish image file is currently opened at load time. I don't have a good sense of the bot's resource limitations, so is this bad? fine? I don't know.
ddaeaaa Rename v1 package to endpoints. - jchristgit
[python-discord/api] New branch created: rename\-v1\-to\-endpoints
@MarkKoz, could you resolve conflicts here?
Presumably the only conflict here is that .pre-commit-config.yaml was removed, I'll solve that quickly so we can get this in.
Excellent Joe, thank you
Am 10.07.2021 um 22:00 schrieb Joe Banks @.***>:
Merged #2 into main.
โ
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Connected!
That's cool! I'm working on #7, which should be done somewhere over the next 7 days or so (maybe earlier).
I don't quite like the approach chosen to get additional confirmation for the command that removes the team channels. but it's not a blocker to me.
Do we know what kind of side effects we're trying to prevent here? I noticed a similar tactic in the help_channels package, but I'm not sure what we're specifically trying to prevent.
This is an interesting approach. Why did you not go for a single "wait for", but one that requires the original initiatior of the action to respond? The current approach has no way of resetting the "certainty" counter for if you decide that you're not sure after the bot's additional questions (unless you reload the cog/restart the bot).
It could be that someone took it up to "2", decided to not go through with it, leaving the command already "locked and loaded" for someone else.
I don't think visual separation is necessary here, with only two logical lines in the __init__ function.
self.bot = bot
self.end_counter = 0
c52c606 Improvements & fixes to homepage repository dis... - jchristgit
[python-discord/site] New branch created: smarter\-database\-usage\-in\-repository\-metadata
These changes mainly aim to prevent multiple concurrent requests from
deadlocking the table due to the lazy evaluation imposed by objects.all(),
and introduce some quality of life changes whilst doing so.
To prevent unwanted locks, the following is done:
- Instead of evaluating the first item of
objects.all()only in order to
determine when the table was most recently updated, we query for the least
recent updated entry and use that instead. As we use.first(), the model
...
GitHub Actions run 1020817563 succeeded.
GitHub Actions run 1020886937 succeeded.
GitHub Actions run 1021708681 succeeded.
Otherwise, looks good to me. We are reconsidering using the database to store this information, but for now this will hopefully fix the deadlock issue.
Consider using .values_list("last_updated", flat=True) here to not fetch the entire object and only get the field we need?
Thank you for the PR. As previously discussed, we won't merge this. It will just be less clear and more confusing for the users and moderators. We are not lawyers, the mods cannot know what is legal and what isn't, plus we don't think we can trust a user saying they will only download their own video, or something similar.
@kwzrd Could you give it a review again? I also have a few comments on your previous reviews, Thanks!
[python-discord/site] New branch created: Update\-replit\-links\-for\-new\-branding
replit recently updated branding to replit.com, so we now reflect that in our site too.
Closes #554
GitHub Actions run 1022762951 succeeded.
[python-discord/site] branch deleted: Update\-replit\-links\-for\-new\-branding
GitHub Actions run 1022859587 succeeded.
Concerns were raised about blindly deleting a mass of channels. I'll improve the confirmation message before merging this PR.
I thought about this initially but decided against it due to flake8 then wanting to wrap the line. I ended up with something like:
last_update = (
RepositoryMetadata.objects.order_by("last_updated")
.values_list("last_updated", flat=True).first()
)
or
last_update = (
RepositoryMetadata
.objects
.order_by("last_updated")
.values_list("last_updated", flat=True)
.first()
)
and I think the current approach is much more readable....
Well, given the flexibility in ordering we have due to how django QuerySet's work, I think the following would probably be cleanest:
last_update = (
RepositoryMetadata.objects.values_list("last_updated", flat=True)
.order_by("last_updated").first()
)
Basically
- what we're getting
- how we're filtering it
GitHub Actions run 1025050787 succeeded.
GitHub Actions run 1025724692 succeeded.
Connected!
GitHub Actions run 1025750703 succeeded.
c404a01 Fixes Broken Doc Link - HassanAbouelela
[python-discord/site] New branch created: fix\-docker\-link
Fixes a slightly malformed link, which is 404ing in the sir-lance set up guide (link in the yellow box, in the linked section).
GitHub Actions run 1032554053 succeeded.
@MarkKoz I think the current duplicated functions should remain where they are for now. If we do decide to move these functions somewhere else, it should be within a different PR focused on refactoring.
The functions themselves in my own attempt of refactoring ended up taking a bit too many variables as arguments. That may have just been me though, and it was quite a while since said last attempt. Although at this point in time it seems to be still the same case.
Thanks fo...
The endpoint URL needs to be updated here
This command's primary name (which affects the help command) shouldn't have "watch" in it. Furthermore, the function should be renamed.
Mentions of "watch" should be removed ...
The variable names this comment references should be updated.
The name should be "add". "watch" can be added as an alias if desired.
These users aren't being "watched" anymore.
Hello, I finally have time again to get around to reviews. The API sensible but there are still some things to address. I haven't run the code yet to test it out.
The dictionary contains the task_id's as keys, and the times at which the tasks should run as values.
Wraps the task factory, so that it can first delete the task from the cache.
On second thought, what is even the use case of this? The task wouldn't exist in the cache unless it's already scheduled. Furthermore, reschedule_all_tasks takes care of rescheduling it on restart.
Discussed with @HassanAbouelela in [#dev-contrib](#dev-contrib message).
GitHub Actions run 1032842532 succeeded.
GitHub Actions run 1033695667 succeeded.
GitHub Actions run 1035014834 succeeded.
[python-discord/bot] New branch created: feat/mod/1664/resend\-infraction
Resolves #1664
The command added is !infraction resend . It uses the same ID converter that the other commands in the !infraction group use. It has the following aliases: !infraction send, !infraction dm, and !infraction rs (short for "resend").
Unlike the automatic DM, this command does not send the full reason for superstarify infractions. Instead, it sends the reason stored in the database, which is f"Old nickname: {old_nick}. {reason}'", where reason is the reason giv...
GitHub Actions run 1035624113 succeeded.
According to the type annotation, the user argument may be a discord.Object. This does not have a mention attribute. This will lead to an exception when trying to send the confirmation message or log message. I don't remember why user can be discord.Object but I think it's related to users that aren't in the guild. I haven't tested to see if it's a bug in practice, but this should be looked into.
Note to self: append to the reason something that clearly identifies the new DM as an edit rather than a new infraction.
We're probably not going to add templates, as this repository is meant for more advanced users after coming from sir-lancebot.
Along with that, I agree that there should be no need for a format of PRs in terms of initial comments.
@HassanAbouelela I believe you were planning to clean up the config at some point?
If so, discussion should continue here.
Update on this: waiting on #1567 since it adds a bunch of stuff in redis that will be used for this too
That issue has been closed, and the PR has been merged.
I've seen it brought up a few times now, and I disagree with the notion that "advanced" users don't find templates helpful.
Templates have a few benefits:
- They guide beginners about what they should add,
but 2. They also guide any user about what they should add.
You can know what you should add, but still forget something. I also personally find it easier to give the required details, when it's more of a questionnaire than an open-ended response. I'd personally like to see issue t...
Should we have issue templates that are more simplified than sir-lance's?
There are a few things in lance's template that I would like changed, but besides those, I think having the templates be identical would be the easiest choice, both in terms of maintenance and user-friendliness.
[python-discord/bot] New branch created: quote\-normalization
I agree with Numerlor about this all at once.
Regarding hook vs flake plugin, I prefer the plugin because I don't want us to tie ourselves up in maintaining and modifying the hook. A single person's changes will probably be minimal, and hopefully, they'll drop to 0 as they become more familiar with our code style.
To get over the initial hurdle of converting everything, I made a short script to go over the output of the flake plugin, and clean everything up. I tested AST equivalence, ra...
We should make sure to not accept hidden infractions, as those weren't meant to be sent to the user in the first place.
GitHub Actions run 1036069462 succeeded.
@mbaruh How should it handle expired infractions?
There are several approaches I can think of. Which one should be chosen?
- Go through the normal unmute process, then apply a new mute as a separate infraction.
- Unmute without sending them a DM for being unmuted, then apply a new mute as a separate infraction.
- Edit the existing mute infraction (and maybe send a new DM).
I am leaning towards option 2.
66ec867 Allow manual mutes to override auto mutes - MarkKoz
[python-discord/bot] New branch created: feat/mod/1665/override\-auto\-mute
Resolves #1665
If a moderator mutes a user, allow them to override any active mute that was automatically applied by the bot (e.g. from antispam).
GitHub Actions run 1036371222 failed.
GitHub Actions run 1036392502 failed.
GitHub Actions run 1036403562 succeeded.
GitHub Actions run 1036492443 succeeded.
Regarding hook vs flake plugin, I prefer the plugin because I don't want us to tie ourselves up in maintaining and modifying the hook. A single person's changes will probably be minimal, and hopefully, they'll drop to 0 as they become more familiar with our code style. Manual compliance with the plugin is not all that difficult.
While I agree that it is a non issue after the first run, using the hook could make it easier for contribs, where they'd use their personal style that'd then be ...
This change looks good to me ๐
[python-discord/site] branch deleted: fix\-docker\-link
It's a security risk to let anyone in a test server have essentially full access to the host machine. Thoughts on this? Does it need to be configurable or should it always be on when in debug mode?
I think it is a good idea. Some people are using test bots in larger servers where not everyone could be trusted. Also, it is possible to accidentally expose your bot.
I would say it should be easy to disable, maybe even from inside the internal eval itself (ie. run the int e bot.get_cog("Internal").allow_everyone_eval = True)? But either way, it should be disabled for non-owners by default and if it is disabled I feel like it should be reset back on restart and have a big red message on...
Description
Discord's timestamp feature will be rolling out to all platforms soon... ish ... probably. This timestamp takes an epoch timestamp to use in a rich/dynamic updating field. More information about this can be found here. I am not Xith a bot, therefore I don't know specific epoch times off the top of my head.
This command would take a simple datetime or a duration and then Lancebot would r...
We can't get the timezone of the user calling the command, I propose we use the same time/duration converter we have in Python.
This converter accepts durations and ISO date times.
Hey, I believe you're referencing the reorganization I did. That already happened sometime in January.
That said, a good look at what can be changed is not a bad idea. The file is indeed very terrifying as is.
This is the converter I was referring to, that we use in Python.
https://github.com/python-discord/bot/blob/133a1349ee52cc774c3c991a0753fd12f478a010/bot/converters.py#L570
It's a union of https://github.com/python-discord/bot/blob/133a1349ee52cc774c3c991a0753fd12f478a010/bot/converters.py#L317-L332 and https://github.com/python-discord/bot/blob/133a1349ee52cc774c3c991a0753fd12f478a010/bot/converters.py#L372-L411.
Here's a simple example of where it's used https://github.com/python-disc...
I would like to implement this
Sure! Once it's finished planning and accepted, we can assign it to you.
It seems like timestamps have been rolled on iOS ๐ฅณ
It can take a bit to be available everywhere, but by the time we merge this PR we should be fine.
I would like to implement this
Sure! Once it's finished planning and accepted, we can assign it to you.
Cool thanks ^^
[python-discord/snekbox] New branch created: jb3/increase\-available\-pids
This PR increases the PIDs cgroup limit to 5. Processes spawned in snekbox will have up to 5 PIDs available, each sharing the same memory limits and environment as the parent python process. As far as I could see in testing this does appear safe and processes behave as expected, even when detatching from the parent and so on.
I'd appreciate if anyone with a local setup could give this a shot and play with things like multiprocessing, subprocess and any other low level proc interfaces.
b48d938 Bump 3rd party thread limit environment variables - jb3
As long as this goes into the same cgroup, this is good, Joe, very good
Thank @jb3. Can you think of any way to write a test for the resource limits being shared?
5318d03 test: add test_multiprocess_resource_limits for... - jb3
The tests are passing, so I'm gonna go off that and say this works.
[python-discord/snekbox] branch deleted: jb3/increase\-available\-pids
Connected!
Connected!
I see. Thank you for the confirmation.
Connected!
When <t:1:R> is typed out in Discord, it seems that it converts to 52 years ago. Is that supposed to be correct here?
Since the decoded timestamp is 1, yes. We used to patch the function that gets the formatted timestamp to return 1 year ago but since it is gone, we can just assert that it constructed a valid timestamp.
I see. Thank you for this information.
This looks great! A small comment. Nice use of Walrus.
This docstring needs to be updated.
Connected!
Connected!
In order to add a reaction in discordpy, we need the emoji's unicode. For most emotes/emojis we can do :emoji: , but for some of them (such as numbers and letters) this option is not possible. The best replacement for it is the charinfo command, which currently isn't allowed in discord.py, but I feel should be for the above reason.
Sounds good to me, do you want to PR it @NIRDERIi ?
Closes #1684
Add support to charinfo command in discord.py channel
Connected!
GitHub Actions run 1047923425 succeeded.
GitHub Actions run 1047951421 succeeded.
527c623 chore: remove quackstack folder - vcokltfre
[python-discord/branding] New branch created: vcokltfre/chore/remove\-quackstack
This was meant to happen a long time ago, but I guess we forgot about it. The Quackstack assets have moved to the Quackstack repo and are fully self contained in there, so it makes no sense to maintain consistency between 2 repos of assets.
This can close #147 #150 #151 which pertain to quackstack which will no longer be here. (Or they can be transferred to the Quackstack repo.)
GitHub Actions run 1047984877 succeeded.
This can close #147 #150 #151 which pertain to quackstack which will no longer be here. (Or they can be transferred to the Quackstack repo.)
I feel like transferring to the Quackstack repo and adding an assets tag of some sort is a good idea, what do you think?
After consideration, making a CLI should be done as part of a separate PR, so this is now marked as ready for review.
I feel like transferring to the Quackstack repo and adding an assets tag of some sort is a good idea, what do you think?
Sounds good to me
Currently, we only have PNGs for some of our ducky accessories. There are also some accessories that don't combine well. Let's clean this up and get a nice set of accessories added to this repo, in the quackstack root folder, with pngs and svgs for everything.
Mandarin is the world's most beautiful duck, it is full of colors.

GitHub Actions run 1047993037 succeeded.
Got the idea from the duck builder project, where we build ducks.
A possible implementation can be a ๐ฆ with a ๐งโ๐ญ 's cap and a ๐จ .
carpenter ducky = duck + factory worker's cap + hammer
Description
Since introducing inline issue resolving, i.e. quackstack#9, the .issue command has been essentially useless - it contains the same information but with confusing syntax. I propose that we make the command show more detailed information about a single issue or PR. This information would include author info, creation date, and issue tags.
Reasoning
The command is, currently, essentially useless. This would mean that we could make use of the command again for better i...
I'm tempted to delete the .issue command entirely.
As you said it doesn't get used often, in favour of the on_message listener. I don't think adding more info to the embed is worth the time and maintenance, since you can get the most information by just clicking on the link to github.
I think @Akarys42 was working on the CLI for quackstack, could you update us on the progress?
Connected!
GitHub Actions run 1048409974 succeeded.
I think @Akarys42 was working on the CLI for quackstack, could you update us on the progress?
I honestly totally forgot about it, I'll unassign me from the issues to stop blocking further progress.
I think we can just keep this issue as making it a PyPI package as done in #52. The rest of issue i.e. making it a CLI tool is already included in issue #5.
We have gone the highway the other way round and made the PyPI package first.
I'm in favor of what Chris said as well. Plus, the default meta image that GitHub shows is already really nice and provides the information in a clean, readable manner.
I don't see myself using a command or even automatically linking anymore instead of the new preview embeds, to be honest. I vote for removing the command.
If Alec hasn't already decided to work on this, I can work on this.
PokemonGame
It would be fun if we add more games..making it intresting
Reasoning
Overall would be really fun to play with and later i will add some more features to it
Proposed Implementation
Got this idea from watching pokemon ๐
..would like to implement this "who is that pokemon" from classic pokemon series..add then later people can view the stats to it
I would like to implement this feature myself
I think removal of the command seems better as well
ef1a0b7 Add Discord status embed workflow - ChrisLovering
This triggers a webhook whenever a workflow completes, sending it's status to #dev-log
a081b2a Empty commit to trigger actions - ChrisLovering
GitHub Actions run 1050340735 succeeded.
I have now done some basic testing and squashed the commits so that this can be rebased.
- Move notes about how to get certain properties into the code-block itself
- Add missing enviroment variable
- Update HTTP method used in description
GitHub Actions run 1050795753 failed.
GitHub Actions run 1051137872 succeeded.
- Could you add
Responseto theget_detailsfunction return type annotation, it is returned when thetypeis an invalid one.
Otherwise, the change looks good
Missed this out earlier, could you remove the extra-indentation here.
Good stuff, thank you!
40bee31 Reminder: remove footer - Akarys42
[python-discord/bot] New branch created: utils/reminder/remove\-footer
Now that we have Discord timestamps, the timestamp in the footer isn't useful anymore since it can be hovered to have a localised timestamp.

GitHub Actions run 1051841802 succeeded.
Here's an example of a docstring:
You should include an explanation of this function in the example, to show best practice
A [`docstring`](https://docs.python.org/3/glossary.html#term-docstring) is a string with triple quotes that often used in file, classes, functions, etc. A docstring usually has clear explanation, parameter(s) and a return type.
[python-discord/sir-lancebot] New branch created: Remove\-user\-input\-images
Description
Following a moderation decision, we have decided to not allow any commands that parrot arbitrary images back via the bot, or anything that members can run against other members with their permission.
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 the [contributing guidelines](https://pythondisc...
GitHub Actions run 1051903133 succeeded.
GitHub Actions run 1052365652 succeeded.
GitHub Actions run 1052428753 succeeded.
Abstract
The majority of the event for members was simpy placing pixels, they would implement the simple routes and authentication and then would call it a day. I am suggesting implementing several ways of authentication, this would have the member learn how to use all sorts of APIs, as well as keep them working throughout the event.
Implementation
Simply searching "How to authenticate web app" on Google is enough to find sufficient ways of authentication we could implement. Ra...
a591154 Information: make !server use moderation_team - Akarys42
[python-discord/bot] New branch created: information/server/mod\_team\_role
We use the ping role instead of the team role here, leading to inaccuracies.
GitHub Actions run 1053248025 succeeded.
Connected!
GitHub Actions run 1053279316 succeeded.
114ffad fix reference role constant in !server - ChrisLovering
[python-discord/bot] New branch created: fix\-reference\-role\-constant\-in\-\!server
Sentry Issue: BOT-1J0
KeyError: 'moderation_team'
File "bot/constants.py", line 182, in __getattr__
return _CONFIG_YAML[cls.section][cls.subsection][name]
AttributeError: 'moderation_team'
File "discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "bot/exts/info/information.py", line 189, in server_info
member_counts = self.get_member_co...
GitHub Actions run 1053823285 succeeded.
[python-discord/bot] branch deleted: fix\-reference\-role\-constant\-in\-\!server
Connected!
GitHub Actions run 1053859653 succeeded.
d9fb29f Fix joined at lookup using wrong attribute - ChrisLovering
[python-discord/bot] New branch created: ChrisLovering\-patch\-1
[python-discord/bot] New branch created: Akarys42\-patch\-1
f5d781f Fix joined at lookup using wrong attribute - ChrisLovering
[python-discord/bot] New branch created: ChrisLovering\-patch\-2
[python-discord/bot] branch deleted: ChrisLovering\-patch\-1
[python-discord/bot] branch deleted: Akarys42\-patch\-1
Connected!
GitHub Actions run 1054098585 succeeded.
[python-discord/snekbox] New branch created: jb3/shared\-mem
This PR introduces a small 40mb tmpfs mounted at /dev/shm to allow shared memory, utilised by multiprrocessing to work. This means that multiprocessing.Pool should work in snekbox (and we have a new test that verifies this).
I'd appreciate if anyone would like to test that you try break the 40mb limit and other general trickery surrounding these new capabilities.
GitHub Actions run 1054542028 succeeded.
GitHub Actions run 1054542021 succeeded.
GitHub Actions run 1054563280 succeeded.
GitHub Actions run 1055432435 failed.
The delivery_dt argument isn't used anymore, so I guess it could be removed
GitHub Actions run 1055564819 succeeded.
a591154 Information: make !server use moderation_team - Akarys42
5e9f087 Merge pull request #1688 from python-discord/in... - Akarys42
114ffad fix reference role constant in !server - ChrisLovering
f2445e4 Merge pull request #1690 from python-discord/fi... - ChrisLovering
c5b76c9 Talentpool: join_at -> joined_at - Akarys42
[python-discord/bot] branch deleted: utils/reminder/remove\-footer
GitHub Actions run 1055698457 succeeded.
Connected!
GitHub Actions run 1055709482 succeeded.
For more details about what docstring is and it's usage check out this guide by [Real Python](https://realpython.com/documenting-python-code/#docstrings-background), or the [PEP-257 docs](https://www.python.org/dev/peps/pep-0257/#what-is-a-docstring).
This is how you do hyperlinks.
Return a string that greets the given person, including their name and age.
Actually document what the function does
A [`docstring`](https://docs.python.org/3/glossary.html#term-docstring) is a string with triple quotes that often used in file, classes, functions, etc. A docstring should have a clear explanation of exactly what the function does. You can also include descriptions of the function's parameter(s) and it's return type, as shown below.
[python-discord/pixels] Issue opened: #123 Refactor authorization to use refresh\- and access tokens
After discussion surrounding #122 it was agreed that the API should implement access tokens that members will have to use to interact with the API as well as keep track of and make sure they don't expire.
Preferrably the access tokens would have a lifetime of a couple of hours, with the refresh tokens lasting at least double the lifetime of the access tokens. One big downside of the refresh tokens having a short lifetime would be that if a member's script goes down, they would have to re...
Closing in favor of #123 after discussion in the Discord channel.
@RohanJnr thanks for the docstring update.
There's currently an error in CI due to conflicting migrations:
CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0070_auto_20210519_0545, 0071_increase_message_content_4000 in api).
20
To fix them run 'python manage.py makemigrations --merge'
Could you look into fixing this?
It also seems the branch needs to be updated.
Looks like I forgot to push the new commits, haha. Will do when I am at my pc tmw ๐
Forgot to include comment. This works very well, I have tested it.
[python-discord/sir-lancebot] branch deleted: Remove\-user\-input\-images
Connected!
GitHub Actions run 1057421275 succeeded.
Looks good to me, tested a day or two back and seems to be working
Connected!
GitHub Actions run 1058161525 succeeded.
GitHub Actions run 1058162247 succeeded.
GitHub Actions run 1058175359 succeeded.
GitHub Actions run 1058178086 succeeded.
Connected!
GitHub Actions run 1059068850 succeeded.
9c8d606 Update docstring tag to use 4 space indents - ChrisLovering
[python-discord/bot] New branch created: Update\-docstring\-tag\-to\-have\-4\-space\-indents
GitHub Actions run 1059223535 succeeded.
[bot] Branch Update\-docstring\-tag\-to\-have\-4\-space\-indents was force-pushed to `cb0ea80`
GitHub Actions run 1059228902 succeeded.
[bot] Branch Update\-docstring\-tag\-to\-have\-4\-space\-indents was force-pushed to `bfd4611`
GitHub Actions run 1059235720 succeeded.
[bot] Branch Update\-docstring\-tag\-to\-have\-4\-space\-indents was force-pushed to `f3286ee`
[bot] Branch Update\-docstring\-tag\-to\-have\-4\-space\-indents was force-pushed to `bbc3873`
[bot] Branch Update\-docstring\-tag\-to\-have\-4\-space\-indents was force-pushed to `c1ecdd5`
GitHub Actions run 1059241859 succeeded.
GitHub Actions run 1059244093 succeeded.
GitHub Actions run 1059246513 succeeded.
[bot] Branch Update\-docstring\-tag\-to\-have\-4\-space\-indents was force-pushed to `463b005`
Doesn't PEP 257 say docstrings should be written like this:
"""A magic method, we don't know what it does.
Only kept here for legacy reasons, if we remove it the code breaks.
"""
You can get the docstring by using the `.__doc__` attribute. For the last example you can print it like this: `print(greet.__doc__)`.
GitHub Actions run 1059261382 succeeded.
I don't think it mandates that, it uses that in some examples, but then also uses the blank first line as an example lower down, saying they're equivalent. At least that's how I read the pep
[bot] Branch Update\-docstring\-tag\-to\-have\-4\-space\-indents was force-pushed to `9aaf455`
GitHub Actions run 1059288952 succeeded.
[bot] Branch Update\-docstring\-tag\-to\-have\-4\-space\-indents was force-pushed to `5aec987`
[bot] Branch Update\-docstring\-tag\-to\-have\-4\-space\-indents was force-pushed to `b86cb3a`
[bot] Branch Update\-docstring\-tag\-to\-have\-4\-space\-indents was force-pushed to `1dec12a`
GitHub Actions run 1059310513 succeeded.
A docstring should contain a clear explanation of what it's describing.
Huh?
:param age: The person's age.
I kind of want to include some form of note that explains that a PEP is the official specification/proposal for those that don't know.
Maybe just?
For more details about what a docstring is and its usage, check out this guide by [Real Python](https://realpython.com/documenting-python-code/#docstrings-background), or the [official docstring specification](https://www.python.org/dev/peps/pep-0257/#what-is-a-docstring).
I was actually about to commit The age of the person to include in the greeting. What do you think?
fb7ec43 Refer to PEP-257 as the official spec
- ChrisLovering
Something more like The age of the person to greet? Since we want to know the age of the person that we're about to greet, the person isn't necessarily included.
4b1cf36 Further describe the funciton in docstring tag - ChrisLovering
GitHub Actions run 1059329817 succeeded.
A [`docstring`](https://docs.python.org/3/glossary.html#term-docstring) is a string (always using triple quotes) that's placed at the top of files, classes and functions. A docstring should contain a clear explanation of what it's describing. You can also include descriptions of the subject's parameter(s) and what it returns, as shown below:
We didn't want to enumerate files, classes and functions again, so we went with this instead, not sure how to improve this.
We should be consistent here, either change all of them or change this to..
:return: The string representation of the greeting.
GitHub Actions run 1059334591 succeeded.
b0536bc Update grammer in docstring tag - ChrisLovering
We could probably uses dashes for the triple quote comment?
A [`docstring`](https://docs.python.org/3/glossary.html#term-docstring) is a string - always using triple quotes - that's placed at the top of files, classes and functions. A docstring should contain a clear explanation of what it's describing. You can also include descriptions of the subject's parameter(s) and what it returns, as shown below:
GitHub Actions run 1059357916 succeeded.
What about..
A docstring should contain a clear explanation of what it does and its purpose.
it would need to be referring to the subject here, rather than the docstring itself. So what about A docstring should contain a clear explanation of what it's describing does and its purpose.
[bot] Branch Update\-docstring\-tag\-to\-have\-4\-space\-indents was force-pushed to `e5ebccc`
GitHub Actions run 1059400201 succeeded.
what it's describing does still rubs me the wrong way.. what if we change that to whatever?
Or I guess completely different more like A docstring should be a clear explanation of the purpose of what it describes.
I think something along the lines of A docstring should describe the behaviour and the interface of what it's attached to would fit.
Would inspect.getdoc make more sense here? I'm not sure if the attribute is intended to be accessed directly, or something like getdoc which also cleans it up is a better alternative
It's kind of like dir() vs. .__dict__.
I like what it's attached to, but a docstring should not explain the interface. That is up to the function signature to do.
Given the situation where a channel/category could be whitelisted for a filter and blacklisted for another, how would a primary key on the ID work to address the validation issues? From what I can see of the current implementation, a ChannelRange entry is just the domain in which a filter applies.
With the interface I meant describing what some of the more complex parameters mean, not just how the signature looks- - maybe the original wording is clearer there
GitHub Actions run 1059458005 succeeded.
GitHub Actions run 1059467213 succeeded.
It's kind of like
dir()vs..__dict__.
inspect.getdoc Also clears indents, which is nice
I don't have time to check it completely again, but I saw the test in Discord. It seems good!
a2592d0 update docstring command to use 4 space indents. - ChrisLovering
1abbb06 Fix grammar issues in docstring tag - ChrisLovering
1dec12a Move type docs to type hints - ChrisLovering
fb7ec43 Refer to PEP-257 as the official spec
- ChrisLovering
4b1cf36Further describe the funciton in docstring tag - ChrisLovering
[python-discord/bot] branch deleted: Update\-docstring\-tag\-to\-have\-4\-space\-indents
Connected!
GitHub Actions run 1059517063 succeeded.
Solves #1624.
Will no longer delete the invoking message when the given symbol is invalid if the message contains user/role mentions. If it has mentions, allows deletion of error message through reactions.
GitHub Actions run 1059729068 failed.
GitHub Actions run 1059739548 failed.
GitHub Actions run 1059750734 failed.
I'd honestly rather see this at the top before the cog rather than afterwards.
This messes with the git blame and could be considered unnecessary.
Did it to shorten the predicate_emoji_reaction function signature.
Was just copying what was done in the eval code. Will move it up if you still think I should.
the pypi command and possibly others in the future also delete invalid invocations, we should extract this to an util function under utils.messages instead of only implementing the functionality for this cog.
Also, like @โBluenix2 mentioned, please do not make unnecessary styling changes like the imports
GitHub Actions run 1059881465 failed.
GitHub Actions run 1059894677 failed.
GitHub Actions run 1059900383 failed.
GitHub Actions run 1059915289 succeeded.
You can actually refer to Unicode characters by their name, that might be a better option.
In that case keep it like that for consistency.
See the first option..
>>> "\N{GREEK CAPITAL LETTER DELTA}" # Using the character name
'\u0394'
>>> "\u0394" # Using a 16-bit hex value
'\u0394'
>>> "\U00000394" # Using a 32-bit hex value
'\u0394'
From Python 3 docs - Unicode HOWTO.
GitHub Actions run 1060165221 failed.
For the sake of the diffs, can you remove this empty linee you added?
GitHub Actions run 1060172287 succeeded.
For the sake of the diffs, can you remove this empty line you added?
Yep.
You still need to remove error_message.
with suppress(discord.NotFound):
await error_message.delete()
GitHub Actions run 1060182964 succeeded.
Might as well remove this line, I don't think it helps much in terms of readabily. Good to not introduce unneccessary changes.
GitHub Actions run 1060300518 succeeded.
Should we perhaps add a comment for this? I feel like it may not be immediately obvious.
GitHub Actions run 1060317331 succeeded.
Are you referring to the if statement?
If so, something like if ... # if message doesn't ping anyone?
You could add a comment above the if statement (but keeping a new line). For example:
# Make sure that we won't cause a ghost-ping by deleting the message
if not (ctx.message.mentions or ctx.message.role_mentions):
Yeah, that works better. Will do now :+1:
I haven't tested it, but I see nothing wrong. Looks good!
The code seems to be solid and should work just fine.
Connected!
GitHub Actions run 1060694173 succeeded.
The !pypi command has the same issue so will work on that too and link to this issue. Will also edit title to reflect this.
Discussed this in #dev-log with @Bluenix2. [Full conversation](#dev-contrib message).
Summary:
This is a nice quality of life feature as currently when the timeout expires (e.g. after 5 minutes for the !eval command), the reaction stays on the message but the bot will no longer react if the emoji is pressed. This makes it seem like the bot isn't working since there's no response. By removing the reactions after the tim...
Solves #1624
Solves #1695
Will no longer delete the invoking message of !pypi command when the given package is invalid if the message contains user/role mentions. Always allows deletion of error message through reactions.
utils.messages.wait_for_deletion() now also clears the added reaction(s) once timeout expires.
GitHub Actions run 1060965581 failed.
Please look over this again haha
GitHub Actions run 1060973890 failed.
GitHub Actions run 1060982241 failed.
GitHub Actions run 1060982251 failed.
GitHub Actions run 1060991156 failed.
Was referring to the fact I didn't need to import bot.constants.Emojis anymore. Import was removed
GitHub Actions run 1060993753 succeeded.
The code changed should work just fine...
I want to know how other feels about this:
await wait_for_deletion(await ctx.send(embed=embed), (ctx.author.id,), timeout=INVALID_INPUT_DELETE_DELAY)
It could degrade readability and make less sense.
This comment is still very weirdly worded.
Could be good to be consistent, everywhere else it's from contextlib import suppress.
Forgot to reword it when pasting over. Will do that
Wasn't sure if it would change the import orders (I don't really understand how the linting works for imports)
I considered that but opted not to in the end. If others think it's a good idea though I can commit this.
GitHub Actions run 1061079383 failed.
GitHub Actions run 1061117784 succeeded.
Same as last time, can't test it but it looks good! Nice work
Same as last time, can't test it but it looks good! Nice work
Thanks! Appreciate your help today :+1:
Did you mean to overwrite the whole docstring here?
The superstarify _pardon_action will need to be changed to accept the notify argument, currently it'll error out when an user is attempted to be unstarified.
Yes, because it was incorrect: the function doesn't actually add the role back, and this was confirmed to be intentional behaviour.
The superstarify _pardon_action will need to be changed to accept the notify argument, currently it'll error out when an user is attempted to be unstarified.
Good catch. Pushed a fix.
GitHub Actions run 1061327574 succeeded.
Won't this fail because you don't specify notify?
This should be capitalized.
You should move this inside the if statement like in the other file.
No. This function has a default value for that parameter. Furthermore, tests run in CI and you can see CI is passing.
Lowercase is consistent with the other messages sent out by infraction stuff.
It could be done, but not really worth it IMO because in practice this won't get called directly with a True/False value โ instead a variable is forwarded to it. This is the same reason it doesn't have a default value.
Unlike the other function, this one has an early exit with if not user: ... return. Your suggestion would call for a refactor of the function, resulting in a more significant diff. I didn't want to change more than necessary.
I just forgot to write "to" after "attempt".
Well, I didn't forget. I was using it as a noun, but I agree it's ambiguous.
GitHub Actions run 1061591033 succeeded.
In some cases they can make the output appear quite ugly. For example, here is the result of a command I ran yesterday (this is a printed Numpy array):
001 | [0.35319467 0.03863742 0.08606454 0.08990213 0.71744555 0.43287303
002 | 0.90408936 0.13358966 0.10614465 2.138059 ]
Once you introduce line-wrapping, it can end up looking like this:
001 | [0.35319467 0.03863742 0.08606454 0.08990213 0.71744555
0.43287303
002 | 0.90408936 0.13358966 0.10614465 2.138059 ]
...
Is this change intentional? Prior, both the invoking message and the error embed would be deleted, but now the error embed remains. I noticed that this is a duplicate commit of the other ghost ping PR, but the situation is still similar to the pypi command.
Are you sure? Here's from that same file..
https://github.com/python-discord/bot/blob/693573412dcf726426271c66f832e626fa77a5d4/bot/exts/moderation/infraction/infractions.py#L355
https://github.com/python-discord/bot/blob/693573412dcf726426271c66f832e626fa77a5d4/bot/exts/moderation/infraction/infractions.py#L155
https://github.com/python-discord/bot/blob/693573412dcf726426271c66f832e626fa77a5d4/bot/exts/moderation/infraction/infractions.py#L73
To clarify, I mean the comment. You should move the comment down a line to be consistent.
Straightforward and reasonable. Very nice. ๐
Yeah, I changed this deliberately assuming we'd want consistent behaviour with the docs command. If you think this should be reverted to the old behaviour then I'll do so, but my thoughts was that this should be updated to be the same as docs.
For now I'll leave this conversation unsolved and wait for your response @kosayoda.
I am asking this question for both this and the docs PR. wait_for_deletion does not delete the embed after the timeout. Before the docs PR, the error embed would be deleted after the timeout (code being the removed lines), which is no longer the case now.
Right, I see. I personally prefer keeping the embed and just removing the reactions, but if we want to revert to old system we can do.
For these embeds specifically, the idea is to not have multiple error embeds lying around, since they have lose meaning right after being shown. This is in line with the short configured delay on the reaction check.
I think we should add the embed delete inside the same suppress(), that way the embed only gets deleted if the bot is able to delete the invoking message.
See this diff:
# Make sure that we won't cause a ghost-ping by deleting the message
if not (ctx.message.mentions or ctx.message.role_mentions):
with suppress(discord.NotFound):
await ctx.message.delete()
+ await error_message...
GitHub Actions run 1062599504 succeeded.
That sounds good to me. I'll do this if @kosayoda thinks that's good too.
This is rock solid code as always, Mark. Nice catch on the superstarify bug.
One small comment I also wanted to mention was that the join_role_stats function in its current form is not very useful for other code, returning a dictionary with the name that was passed in is a bit odd. That said, it's perfectly reasonable and useful for the code here, so I don't think we should generalize it at this point in time
Turns out there's no consistency. Whether this message is lower or upper-cased, it will be inconsistent with some other message. The confirmation messages use lower case, so that is what I was originally thinking of. I don't think making the messages consistent should be addressed by this PR.
Oh. That's such a minor thing, I don't think it's worthwhile. Maybe if I had another reason to be modifying that area of code now, I'd throw in this change.
Kosayoda has approved on discord so will commit this :+1:
This looks good to me.
As for your request to test breaking the memory limit, writing there using multiprocessing.shared_memory would have also been my one and only test, and since we're doing that here, I personally can't think of another possibility to break this. Since it says "File too large", what happens if multiple shared_memory.SharedMemory objects are created that exceed the limit together? I would assume that the first file exceeding the limit hit the error?
Why does test_subprocess_resource_unavailable still pass when you up this limit? Speaking of which, that test could also be reading this value from config instead of hard-coding it.
We need to understand exactly why it has to be upped to 6. Someone showed that it spawns some extra internal threads as an implementation detail. The rest of the threads are based on os.cpu_count if the count is unspecified.
How consistent and reliable is that behaviour? Furthermore, should we be using os.cpu_count to automatically calculate what this value should be? Such feature would have to be optional, otherwise it'd force an effective minimum on the PID limit, which not all users...
Do you think this size should be read from the config instead of hard coded? Other tests strive to do this with the memory (though I see one that is still hard coded, and that can be fixed whenever). Unfortunately, this value in particular would require a bit of parsing since it's stored in a string with other stuff.
On second thought, using cpu_count for calculation sounds like tight coupling, especially considering it's also relying on an implementation detail of the number of threads the pool creates. I suppose hard-coding the PID limit in the config is fine, as long as we can ensure the cpu_count is consistent in the production environment.
It's been a long time since I've looked into this. I think it'd have to be a composite PK on the channel ID and the filter ID.
Refering to our other conversation, this could be the same reasoning as to why capitalization is so inconsistent.
That's just because no one noticed when reviewing the PRs which introduced those messages. Furthermore, there's an important difference: those messages are user-facing, but comments such as this one are not. Outside of readability/ambiguity reasons, I think worrying about the placement of comments is being too pedantic; someone doesn't need to go out of their way to address such issue.
I won't continue arguing about this, but code is read more times than it is written. It most likely will never be changed when this is merged, so now is the time to change it.
You're right, but in this case, I think that's okay; moving this comment would be so inconsequential. If we're concerned with consistency, the function should undergo a more significant refactor as I originally mentioned. In fact, I will later make a separate PR to make the message capitalisation consistent, and I can also refactor this function in that PR.
GitHub Actions run 1063290888 succeeded.
Connected!
GitHub Actions run 1064294948 succeeded.
Connected!
Changes look pretty much good, but it seems that if a role doesn't exist, the command will fail.
guild.get_role(role_id) can return None, leading to the following error:
bot_1 | Traceback (most recent call last):
bot_1 | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
bot_1 | ret = await coro(*args, **kwargs)
bot_1 | File "/bot/bot/exts/info/information.py", line 194, in server_info
bot_1 | member_counts = self.get_member_counts(ctx.guild)
bot_1 | File "/bot/bot/exts/inf...
The main thing missing from these changes is that file reloading does not work. Webpack-dev-server by default enables the webpack watch option, but for whatever reason, it doesn't work in the docker build. I've stumbled upon this SO post multiple times in my search, but nothing I tried worked.
Ultimately, file watching is a QoL feature. I think not having it slows down development significantly, bu...
Isn't the depends_on missing?
a91b4cb Add beforeunload event listener when a form is ... - Bluenix2
[python-discord/forms-frontend] New branch created: beforeunload\-warning
95e7b11 working demo of smart resources search - fisher60
[python-discord/site] New branch created: kyler/smarter\-resources
Socratica YouTube Channel
Resource location
Python Programming Tutorials
Introduction to SQL
Payment type
Free YouTube content. Socratica also has a Patreon but all tutorial content is free on YouTube.
Why it should be included
Socratica is a small studio focused on producing...
Thank you for the suggestion! I think this is probably a good candidate--we'll review it and make a decision.
c4ea108 refactor search function for resources - fisher60
53af888 remove redundant variable declaration - fisher60
be9cb47 EH Tests: Created test cases set + already hand... - ks129
8229d21 EH Tests: Created test for CommandNotFound er... - ks129
28e8321 EH Tests: Remove class member cog + other sma... - ks129
3ea33bc Error Handler: Changed CommandNotFound error ... - ks129
28e962b Test Helpers: Added new attribute to MockContext - ks129
GitHub Actions run 1067751112 succeeded.
GitHub Actions run 1067772035 succeeded.
[forms-frontend] Branch beforeunload\-warning was force-pushed to `fd48286`
This means that the browser will prompt the user before it tries to close the page, that way someone cannot accidentally close the page mid-submission.
Currently this does not work for the home a element (Python Discord logo), for some reason it does not appear to trigger the beforeunload event that we subscribe to. Further investigation could be made into adding an onclick to this element that will throw a similar prompt and potentially cancel, or find a way to also trigger `beforeu...
GitHub Actions run 1068934891 succeeded.
Copyright (c) 2021 Python Discord
For the moment, our consensus is that the SQL series shouldn't be included as it doesn't relate any of the information to Python. We're still debating the Python series.
There are some issues that come up in help channels that are usually solved by just sending a tag, the person reads it, and the problem is solved.
For example: 'python' is not recognized as an internal or external command. This problem is answered by the windows-path tag, but you need to wait for someone to come to the channel and type the command for it.
It would also be useful for if, say, someone mentions youtube-dl in their question, to automatically send the ytdl tag. This one ...
class School:
def init(self,rooms,floor,staff,students):
self.rooms=rooms
self.floor=floor
self.staff=staff
self.students=students
def myfunc(self):
print("This school having"+self.rooms)
s1=School(4,15,85,2500)
s1.myfunc()
Error
AttributeError Traceback (most recent call last)
in
----> 1 s1.myfunc()
AttributeEr...
Hey! Seems this is just a general python question, not related to the actual repository.
We do answer python questions, just not here. Check out our discord server to get help.
Going to transfer this to meta for discussion.
c114398 Rename repl.it to replit and update links - ChrisLovering
e42a8f6 Merge pull request #555 from python-discord/Upd... - ks129
c404a01 Fixes Broken Doc Link - HassanAbouelela
cb26873 Documents expected emoji format - onerandomusername
dc94977 Merge pull request #557 from onerandomusername/... - HassanAbouelela
[python-discord/site] branch deleted: smarter\-database\-usage\-in\-repository\-metadata
GitHub Actions run 1072349354 succeeded.
I don't feel strongly either way. However, I do agree that they sometimes make the output ugly and that they seem to seldom be used. What does everyone else think?
Removing the line numbers will only give us an extra 6 characters of width, so the above example would still be wrapped anyway.
There isn't really a good solution to this, since it fully depends on the width of your monitor, and now if you have a thread open, since that will limit width even further.
Having the line numbers can be useful when it wraps like this, since it shows where the newlines are from stdout.
We could possibly look at changing the characters we use however, as the...
GitHub Actions run 1072701859 succeeded.
Resolves #1683
As mentioned in the issue, it's a security risk to let anyone in a test server have essentially full access to the host machine.
A new debug entry is introduced in the config file. This is false by default, but can be set to true in the user config. When set to true, an is_owner check is added to the internal eval command.
There isn't quite an easy way to disable this during runtime, or to disable this without disabling debug mode entirely. However, I don't feel t...
GitHub Actions run 1072727610 succeeded.
5a71e8b Handle zero deployments found - jb3
d8808bc Merge branch 'main' of github.com:python-discor... - jb3
While "ternary" is more recognisable, this is technically called a "conditional expression" in python.
[python-discord/branding] branch deleted: vcokltfre/chore/remove\-quackstack
GitHub Actions run 1074692567 succeeded.
Connected!
Okay, I pushed some changes and this should not be a problem anymore.
GitHub Actions run 1074931207 succeeded.
Doc item doc_item.symbol_id='color' present in loaded documentation inventories not found on site, inventories may need to be refreshed.
GitHub Actions run 1075702044 succeeded.
GitHub Actions run 1075715476 succeeded.
Could you explain how you produced this bug? I naively just spammed some messages, and then used clean user, and it worked as expected
We should be good after this change.
Error should be more specific. If this were to go off, neither the user or anyone looking at the logs would exactly be able to identify which role is missing.
raise ValueError(f"Could not fetch data for role {role} for server embed.")
role_stats.update(
**join_role_stats([constants.Roles.project_leads, constants.Roles.domain_leads], "Leads", guild)
)
Like @jchristgit mentioned this is not really useful for other code so I don't think it fits into this module as a general util. I think having it in the information module or cog directly would make a bit more sense.
The bot is also running on python 3.9 so the generics f rom typing aren't required and builtins can be used directly
Description
Add a !venv tag to explain the purpose, creation and activation of virtual environments.
It should outline the following:
- Purpose: keeps system clean, dependency management, etc.
- Creation:
python -m venv .venv - Activation for both PowerShell and Bash
Notes
On Windows systems, the execution policy needs to be set before activating from Power...
I have to say, I have no idea what is venv or what it's used for. I think you should write some explanation that you think is good to be a tag about it, and let users review and suggest more things. Waiting to see the tag soon!
You can submit a draft if youโd like, but Iโm not sure a tag is the right medium for this. With the execution policy extension, the content would probably be longer than whatโs ideal for a tag, and may be better suited to site content.
GitHub Actions run 1076860504 succeeded.
After giving it some more thought, I think both the issue and PR templates should be copied from the sir-lancebot repository and put into this one.
Besides that, they should not be enforced as not all PRs require the templates that we will be providing.
In some cases, newcomers are confused with how to paste/format code and ask Hey how do I send code in this server? in python-general, members need to type two commands to show, which is !paste and !code because they do not know which kind of code is the newcomer asking. However, there's slowmode in python-general so if members did the command !paste first and the newcomer is sending short code then he/she will use the wrong tool. (eh sorry bad english)
GitHub Actions run 1078017509 succeeded.
I understand what you are saying, the slowmode is not really long, but, I think it would be better to add some more context to paste and code commands. Such as for code command: "if the code seems to be long, please consider using our pastebin service, run !paste in #bot-commands for more info"
No problems here, would love to have them. ๐
GitHub Actions run 1079482139 succeeded.
145279b Implement access- and refresh tokens - Bluenix2
Resolves #123
This pull request does not make any change to regenerating of the refresh tokens, but starts the foundation to make this possible.
In terms of semver, since #106 was never deployed I think this change should be considered part of 2.0's breaking changes and the version shouldn't be bumped again.
GitHub Actions run 1080153834 succeeded.
I don't like the debug mode being false as the config default as it should almost always be set for dev; what do you think about making it an env var with defaulting to enabled?
Looking at it now, the code in get_member_counts that runs before the call to this function doesn't have any error handling and will raise an attribute error for non existing roles.
We should make that consistent with not handling the same error (for different roles) here, raising a common error for both cases, or providing a default so the command can be used in servers that aren't completely configured
Why was the line added here? It's inconsistent with other modules and creates an unnecessary diff
def join_role_stats(role_ids: list[int], name: str, guild: Guild) -> dict[str, int]:
Like I mentioned we can use the builtin generics now, you can also remove the List import with this
I've also added a comment to the error conversation above that'd probably be addressed https://github.com/python-discord/bot/pull/1678#discussion_r679544471 not sure if it was collapsed before
I don't like the debug mode being false as the config default as it should almost always be set for dev; what do you think about making it an env var with defaulting to enabled?
That's a decent idea. The downside is it goes against the concept of the default config being the default values for production, but I don't see a simple way around this.
Most of the code still uses the typing module, I thought I should change it. But I'll change it then.
GitHub Actions run 1080684483 succeeded.
[python-discord/sir-lancebot] Pull request opened: #791 Make user affirm their pr follows guidelines
Description
The contributing guidelines also contain a part which requires contributions to follow the open source license.
This requires the user to agree that they do follow said guidelines when making a pr.
Did you:
- [X] Join the Python Discord Community?
- [X] Read all the comments in this template?
- [ ] Ensure there is an issue open, or link relevant discord discussions?
- [X] Read and agree to the [contributing guidelines](https:/...
GitHub Actions run 1080920111 succeeded.
I'm unassigning myself for now. It should not be a lot of work, but I'm not sure how soon I'll have time.
If it's up for grabs I would love to help. If not.. I'll just leave my suggestion here anyways
After some research I found a library SQLAcodegen that works just like reflecting the current database in SQLAlchemy, except it actually generates the models. (As an additional bonus, it produces a PEP 8 compliant code). This way the API doesn't have to reflect the database every time the it starts up.
Naturally, it would still require a review to make...
Resource name
py.checkio.org
Resource location
https://py.checkio.org/
Payment type
free, signup required
Why it should be included
Seems like a interesting interactive way to learn/improve at python with decent explanations and examples. seems to cover a wide range of topics but i couldn't check those (they're locked until i advance)
Potential limitations
Not 100% a fan of their UI, it looks neat but compromises on performance (im on a older PC righ...
Free Comic Book Day is on the 14th of August this year and we are approaching it. It is an annual promotional effort by the North American comic book industry to help bring new readers into independent comic book stores.
I think we could have a comic, retro, pop or classic style branding for this event.
I think this is a great idea! I saw in the dev-branding channel in the python server you suggested making some sort of a banner or guild icon, which sounds great, can't wait to see your idea and icon design!
@melodicht will you be able to finish off this PR?
[python-discord/sir-lancebot] New review comment on pull request #583: Add the stackoverflow command
The emojis have been added, being stack_tag and stack_eye.
@Vthechamp22 Sorry for the wait, the emojis have been uploaded.
GitHub Actions run 1084617995 succeeded.
@sam-heller will you be able to resolve these requests for changes?
@Kronifer what's your status of this PR?
GitHub Actions run 1084629507 succeeded.
Connected!
GitHub Actions run 1084631865 succeeded.
GitHub Actions run 1084723235 succeeded.
@onerandomusername I'll accept this PR, but next time please have an issue open. Thanks!
Connected!
GitHub Actions run 1084731809 succeeded.
I'm not sure if this is enough information. Maybe it would be a good idea to have this on the site, where we also go over poetry and/or pipenv?
@blankRiot96 will you be able to finish of this PR? If so, please let me know.
Hello @ToxicKidz, due to https://github.com/python-discord/sir-lancebot/issues/788, please throw the .issue command into the sun.
Hello @ToxicKidz, due to https://github.com/python-discord/sir-lancebot/issues/788, please throw the .issue command into the sun.
@blankRiot96 will you be able to finish of this PR? If so, please let me know.
probably not, as i was banned from the server
do what you want with the questions
[python-discord/sir-lancebot] New branch created: more\-py\-topics
5f7abe9 Add pride leader cog and resources. - Shivansh-007
9ff3d04 Add link to wikipedia in error embed and inform... - Shivansh-007
1c6bcfd Apply requested grammar changes. - Shivansh-007
8e6e27c Give more information in function doc-strings - Shivansh-007
f6d8a3f Remove redundant code - Shivansh-007
GitHub Actions run 1084877967 succeeded.
I added a custom error to handle both cases!
e0ea48d Added list of cj8 submissions in subpage - mbaruh
[python-discord/site] New branch created: mbaruh/cj\-links
- New page at /events/code-jams/8/submissions/ with a link to all CJ8 submissions.
- Removed the "how to join" section in the main event page, and replaced with a link to the submissions page.
- Added submissions page at sidebar.

GitHub Actions run 1085770350 failed.
a5cbe72 Add partners to the filtering whitelist - ChrisLovering
[python-discord/bot] New branch created: whitelist\-pydis\-partners
A partner being filtered is highly unlikely to be correct
GitHub Actions run 1085795618 succeeded.
Lgtm, if it breaks, blame the owl
[python-discord/bot] branch deleted: whitelist\-pydis\-partners
Connected!
GitHub Actions run 1085804918 succeeded.
GitHub Actions run 1085853740 succeeded.
GitHub Actions run 1086010972 succeeded.
GitHub Actions run 1087108683 succeeded.
@melodicht will you be able to finish off this PR?
Hi, I have made changes to the PR, hopefully that fixes the conflicts.
GitHub Actions run 1087213561 failed.
GitHub Actions run 1087222918 failed.
GitHub Actions run 1087230653 failed.
GitHub Actions run 1087230632 failed.
GitHub Actions run 1087244651 succeeded.
@kwzrd Issues should be solved now and I also improved docstrings slightly.
GitHub Actions run 1087259223 succeeded.
Is there a case, other than showcased above when user is not passed, when this is called with a discord.Object instance?
Because if there's no other case, the if-statement and this fetch can be combined.
Should this emoji perhaps be put in constants.Emoji?
There's some unnecessary code-duplication here.
You never set this attribute in the __init__().
This makes it look like the variable is unused. You should flip it.
if (role := ...) is not None:
members += role.members
else:
raise ....
This makes it clear that role is used.
I was reminded that if there is a terrible misconfiguration and those essential roles, such as helpers, or owners do not exist this bit of code would fail, so I added an additional check. In case of the other bit of code (join_role_stats) the roles that need to be joined might also not exist so I had to add another check)
I'm not sure how to get around this, the roles that needs to be joined must be handled differently than the ones that don't.
We define this type a lot, isn't there a way to create an alias. As in:
tag_pair = tuple[TagIdentifier, Tag]
Then this code can become:
matching_tags: list[tag_pair],
May not be a huge benefit, but I thought I'd mention it.
I'd honestly place this outside of the if-statement to make it clear that tag is used after the if-statement, even though Python doesn't have strict scoping like JS for example.
What's the difference to this and COOLDOWN = object()?
I assume this has the benefit of __repr__ right?
GitHub Actions run 1087731248 succeeded.
Yes, there is. Besides, if the fetch fails, the except block needs to be able to access the id attribute.
I don't know. It's a standard Unicode emoji, which normally doesn't have a constant. The only one that does is ok_hand, but the constant is only used once out of the nine references to that emoji.
I just noticed the emojis right above ok_hand in the config. Didn't recognise them at first since they were Unicode escapes. Still, it's not very consistent, and I imagine it being cumbersome to use a constant instead of e.g. just typing ":x:".
Although type aliases should be in PascalCase
We may want to temporarily stop new nomination reviews from being automatically posted, so this PR creates three new commands, tp autoreview on, tp autoreview off, and tp autoreview status, all with fairly self-explanatory names, I think :)
This uses RedisCache to store the status so it can be persisted over restarts.
GitHub Actions run 1087951791 succeeded.
I'd agree with Xithrius that I'm not sure this tag explains enough at the moment, and may be better off as a page on the site.
For example, there may be editor specific advice people should follow. If someone using Pycharm tried to follow the instructions in this tag they might end up more confused than before.
It could be worth having a tag that explains what a venv is and then just links to other pages for how to use them, maybe including one on our site if we write one.
I agree with @wookie184 , but, why not make a tag that does show how to use venvs and create ones, with a comment on top suggesting for some editors that they have less confusing ways. But, if it's a lot to explain, and there are some examples to show which are important, I would suggest making some page on the pydis website(or the appropriate place) that covers almost everything needed to know about venvs. I wish I could be more of a help, but I have no idea what venv is, how do I use\create...
Completely agree that it's worth mentioning other IDEs that integrate venvs already, else it could prove more confusing. I'm happy to move this to site content, though I think there should be a summary tag to briefly describe their purpose, linking to the site page, which explains how to set them up -- both for PyCharm, VS Code, etc. and manually.
where we also go over poetry and/or pipenv
I imagine packaging should probably be a separate section, or at least subsection, though defini...
Use a constant for the key. String literals are prone to programmer errors.
Don't check decorators have to go under the command decorator?
Sentry Issue: SIR-LANCEBOT-5T
KeyError: 'query'
File "discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "bot/exts/evergreen/wikipedia.py", line 78, in wikipedia_search_command
contents = await self.wiki_request(ctx.channel, search)
File "bot/exts/evergreen/wikipedia.py", line 42, in wiki_request
number_of_results = raw_data["query"]["s...
From a quick check it didn't seem to matter, although makes sense to change it for consistency anyway.
GitHub Actions run 1089405648 succeeded.
Yeah, I think including the information in the help command is enough here, although I don't think the current link to strftime.org is actually very helpful in this case, as it actually uses a custom duration parser, https://github.com/python-discord/bot/blob/main/bot/converters.py#L296. There is overlap as it's inspired from strftime, but I don't think looking at that page makes how it works clear.
It could probably be edited to show something like this (mostly just copied from the converte...
This is what the tag could look like:

The current two tags are currently quite small, and very often make sense to be sent together, so I do quite like this idea.
If we decided to do this I think it would make more sense to replace the other two tags with this tag, rather than adding this as a third tag.
I think it would also be worth adding the command for cmd, .venv\Scripts\activate.bat
I think this tag probably could be useful. We could maybe update it more if/when we have a page on our site, although I don't think it's worth waiting for that at the moment.
Feel free to question my comments/rewrite them with your own wording.
This sort of feels a little out of scope for the tag. Would be nice if we could just link to this section in the venv docs next to the command above, although i'm not sure you can specifically link to that part. You could try linking to another page, like https://dev.to/aka_anoop/enabling-virtualenv-in-windows-powershell-ka3, may be nicer to have this info on our site at some point though,
For more information, take a read of the [documentation](https://docs.python.org/3/library/venv.html). Your editor may also have venv integration, in which case you should check out your editors documentation. Here's the docs for [VSCode](https://code.visualstudio.com/docs/python/environments#_select-and-activate-an-environment) and [PyCharm](https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html)
There are also tools such as [poetry](https://python-poetry....
Just grammar and wording. There are a couple of pythons that should be Pythons I didn't comment on. Could you also fix capitalization on line 19, as PyPi, should be PyPI. Not part of this PR but probably not worth it's own one ig.
- Was Python your first programming language? If not, what was?
- What's your favourite aspect of Python development (e.g. backend, web dev, game dev, machine learning, ai)?
- How would you approach learning a new Python library?
Maybe, previous was fine though as well
Sounds like a good question. Since @Xithrius already has #792 open and it's a simple addition, it may be easier for him to just add it to that, unless you wanted to do it yourself?
Seems like this can be closed
Description
In https://github.com/python-discord/bot/pull/1676 we removed fuzzywuzzy from the python bot as it used GPL so is not compatible with our MIT License. I guess the same thing would apply to sir-lancebot, so we should probably replace the fuzzywuzzy module with Rapidfuzz.
Would you like to implement a fix?
Note: For high-priority or critical bugs, fixes may be implemented by staff.
- [x] I'd like to implement the bug fix
- [x] Anyone can implement the bug fix
The issue with those pages is that they suggest changing the execution policy to Unrestricted, whereas RemoteSigned would be preferred -- as the Python docs suggest.
Until we get a page for the site, keeping something about execution policies here will probably be useful.
Another possible option could be to link to a gist, something like https://gist.github.com/wookie184/4bec5f2785ad72736a6a46bb4cc7defc#file-executionpolicy-md, although if you'd like to leave the note in the tag for now I think that's fine too.
This is how the tag currently looks:

would be interested to hear thoughts from others on what they think so far.
GitHub Actions run 1090239950 succeeded.
I used an Enum because I couldn't find a way to type the sentinel alone
I'm happy to move it to a gist, in order to get the line count down by ~2.
The only disadvantage I can see is that some people may skim over it, miss that information, and then ask why PowerShell raises an error... If length isn't a problem at the moment, then it might be worth leaving it for now.
I've reworded a few things, just to make it a little more concise. Feel free to make any more suggestions :)
Information to activate from cmd has been added too.
Do you mean doing group, name = tag_item[0] to avoid the else case?
It looks a bit nicer, but I'm not sure if it's as clear on when True is returned
I suppose an empty string could be used, but I don't think there's any benefit of using it instead of a plain object like the current use
Yes, that'd be nicer, although I don't think TagPair is a fitting name as I'd expect a pair of Tag objs from that, not sure on a good name myself
Reworded things a bit in e40cd9840c188210a7cfde6bffbf08ce563c2a11
I think this was a leftover from when I was prototyping and had it in an elif, moved to a normal assignment in e40cd9840c188210a7cfde6bffbf08ce563c2a11
Moved the assignment to the comment and changed the uses to use the name directly instead of identifier.group in 5cbb7d20713c0a7027c2e0909ddcdb6e02dbddc2
Looks like it can, but other embed titles were changed to not be bold and I think it was a bit harder to read so I removed the bolding in 96a8390290f379a90fa0f966b74993dd1ddf9f44
Changed the other use to not use a kwarg in e3b9924920a32e19adfa1274cfdbc4cf9ddb874a
Reworded things a bit in e40cd98
GitHub Actions run 1090383512 succeeded.
I'd like to pick that up! ๐
Could fix that with some comments, like If we reached here it was successful or Wait for the cooldown message to be deleted before returning True.
I was originally thinking about doing ident, _ = tag_item since tag_item should be treated more like a pair than a tuple.
But that sounds great doing group, name = tag_item[0], I didn't think about TagIdentifier being a named tuple.
@D0rs4n
If it's any use to you, this is the message that caused this error
#sir-lancebot-playground message
The command was .wiki ICANNT
I think that enable and disable would be better names, either way add them as aliases.
Could this not be moved into the group command instead of showing help?
Can't redis be used for this?
Pretty much the same thing, but we avoid some unnecessary nesting
) -> Union[Embed, Literal[COOLDOWN.obj], None]:
if len(tag_identifier.name) > 3:
What purpose would it serve? We gather the data from the tag file and after that it's unchanged at runtime
I like this tag. It definitely fits the use case where a user doesn't know what a virtual environment is, or why they should need one.
However, at the moment the wording does seem a little more technical than I think it needs to be. Right now it assumes a bunch of baseline knowledge (why should the dependencies be clean, that I may need to set an execution policy, etc), and I think we can clean that up. Otherwise though, I like it. Thanks for your PR!
We should note that bash applies to linux/osx. It took me a moment ( despite extensive familiarity with all three here and the os's and python ) to realize that yeah, the line marked "bash" was the one that I was looking for. If we put (OSX/Linux) in there, or perhaps something better if you can figure it out, that might help make things clearer and more obvious.
I think we can fit a sentence in here explaining why clean dependencies are important. We have an opportunity to make this more beginner friendly without adding too much, and I think we should take it. Eg:
- knowing what your program actually requires
- dependency conflicts
- partial upgrades rather than having to update every script on your system at once
Would changing may to is likely to or likely has make this better?
Specifically I am talking about the cooldowns but that may not be big enough to experience a benefit?
I don't think they're important enough to persist if that's what you mean
Okey doke, totally agree. I'll try to throw some of those in there.
My concern with specifying an OS would be that bash, for example, could be for Linux, OSX or WSL. Likewise, PowerShell can be installed on platforms other than Windows. The only specific difference between the three is the shell itself.
I guess this is a little pedantic, and can probably be ignored. Thoughts?
WSL is linux, technically. While you can get bash underneath windows proper with MingW, the reason to mention the OS is to catch the people who are using it (starting anew on mac, or just getting their feet wet on linux), who think of "terminal" rather than "bash".
It is a significant portion of the people likely to view the tag, rather than those who've installed powershell on something other than windows, who are unlikely to get confused on which applies since they've chosen to install ...
We should be able to make this useful other than to Leads.
def join_role_stats(role_ids: list[int], guild: Guild, name: Optional[str] = None) -> dict[str, int]:
I actually don't remember if this unpacking is necessary.
Additionally, you can reach this staticmethod through self.
Extremely tiny nit-pick, it is convention to call super().__init__() first before doing your own setup.
No, Redis will not store them persistently.
Redis is an in-memory cache (key-value store). Pretty much exactly like this dict.
I would like to hear others thought about it, as I am no expert on Redis, but I suggest you look into it if you're unaware what Redis is.
If we did have a linux distro of some popularity utilizing powershell as the default
Sent shudders down my spine haha
Yeah, with the target audience, it's probably best to choose clarity over accuracy. Would something like below be okay?
Shell (OS):
path/to/activate
Well, I'm not sure what the best option is, but again, we're painting targets. Like how bow targets are concentric rings and the comment button here is green and on the bottom right, we want the people searching the tag for what activate command they need to have their eyes immediately go to the right spot.
I do think duplicating Windows (powershell) might be too much.. but maybe not. I'll defer to other's judgement on that.
I'm aware of what it is, but I fail to see how it could be used here
Writing "Windows" twice I think would be redundant. I've used bold for the OS to draw attention to the determining factor. This is the best way I can think to distinguish between PowerShell and Command Prompt:
Windows (PowerShell): .venv\Scripts\Activate.ps1
or (Command Prompt): .venv\Scripts\activate.bat
MacOS / Linux (Bash): source .venv/bin/activate
My reasoning for its placement is that it follows directly after the activation examples, which is the stage where changing the execution policy is required. I'll make some changes to suggest that it's only required once.
I agree that it is rather prominent, however. Changing to single backticks seems to work, but it should probably be on a new line to avoid wrapping.
I think that sounds pretty good and clear.
GitHub Actions run 1090855767 succeeded.
!i a l 3d raises the following exception:
TypeError: can only concatenate str (not "NoneType") to str
https://github.com/python-discord/bot/blob/e65afc4e83f822f06fa2d25a7eb8c233b1cce71a/bot/exts/moderation/infraction/management.py#L58 makes reason optional
assumes that the provided reason is not None. Should be a very straightforwards fix...
get_member_counts is a staticmethod as well.
Fair, i'll change the names to enable and disable and make on and off aliases.
It could be, although I think both ways are equally fine. The current method is similar to how !defcon does it, and as it's a command that wont be used very often I think having it show the help by default may be helpful.
GitHub Actions run 1090960198 succeeded.
I think the wording here could be a little better. Perhaps preventing cross-project dependency conflicts and easy isolation of requirements?
I really do think this should be at the very bottom. As it is it somewhat interrupts the flow of the text like an overly large () in the middle of a paragraph.
GitHub Actions run 1090971836 succeeded.
That's a lot cleaner - done :+1:
Note: When using Windows PowerShell, you may need to change the [execution policy](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies) first. This is only required once:
This doesn't apply to cmd, so we should specify it's PowerShell only. I also like bast's suggestion of moving this to the bottom
Relevant Issues
Closes #793
Description
I read the Wikipedia API docs, and noticed that when the Wikipedia API encounters some kind of error or warning, it'll send back the response with the proper error message, but regardless of that the HTTP Reponse Code still remains 200, so I added an additional check to avoid such issues in the future. Docs (the Wikipedia API uses the same API system)
Did you:
- [x] Join the [*...
GitHub Actions run 1091107315 succeeded.
Python Discord uses double quotes (I won't bother with commenting on every single instance).
Including prefix like this is rather brittle. Can you not refer to it ambiguously?
This could probably be simplified to a ternary (status = "enabled" if await self.autoreview_enabled() else "disabled") and then an f-string.
I think we can just do 0 here haha
To be consistent with the errors above, capitalize "Role".
GitHub Actions run 1091343552 succeeded.
This is a fun game, I found it quite difficult๐ . The images and handling of the images is really neat.
A few thoughts:
- I think it would be a good idea to send the scoreboard as a new message after the game has finished, imo editing the original message isn't a very clear UI, especially as channels can get very busy.
- I think the help command could maybe be a bit clearer, it could probably do with being a bit more verbose to ensure it is clear for somebody who has no idea what the ga...
Block comments should be lines starting with #s rather than a docstring, as per pep 8 https://www.python.org/dev/peps/pep-0008/#block-comments
could probably be capitalised as they're constants.
Sounds good, made it a constructor of the class in 359a17c00bb036f9a90fe7681592dee29f84c806
Nothing wrong, but I wanted to make it clear that the method is fuzzy matching the passed in identifier with self as the target
Many people ask a lot of times how to access some variable through all the files they have, and we have to explain many times what is a bot-var and how to use it, a tag that we can show can be a real help in #discord-bots channel, like how to use bot vars in cogs and why to use it anyway
About the cogs, also this is for the discord-bots channel, which is a was to organize your code, also about this topic many people ask, and the responses are ofc not enough, a tag could also be very useful.
Tho even some pinned message could be helpful, but I am not sure what is for a better suggesion.
I find the Optional a bit nicer as it's immediately obvious that it either returns None or some other value
I can change it if others agree though
I think it should be clear with tag being changed on the line right before the condition
Is this else block (and extra indentation) needed if we're returning above on failure?
I think we should refactor this functionality entirely.
Ideally we should check the bad path first and then return, so that we don't havea huge if/else block.
For example:
if resp.status != 200:
... send error message ...
return
... carry on as normal ...
Also ideally for errors, we would raise an error and then let the error_handler cog deal with sending an error embed. Having a quick look at the error handler, we don't have a good error being handled there for ...
As for the first part, I think that wouldn't work since as the docs says the Wikipedia API "usually" returns a 200 status code even for errors and warnings, (Docs) so checking the status is actually not useful. I just left it there in case the API goes down.
As for the second part, yes, I'm not sure why I left it there! ๐
Also, the API should never even send back an error, just in case of malformed query URLs, and I'm not sure why this error was raised in the first place, I tested out the payload that caused the error, but I could only reproduce it once.
The commands don't check the current status, causing them to sometimes perform redundant operations. For example, if autoreview is already enabled, then an enable command will still cause all reviews to be rescheduled. What do you think about adding a check to avoid that?
Apart from that, this would be ready for approval from me. My tests have shown everything is working.
GitHub Actions run 1091548340 succeeded.
This is starting to look really good now, nice work.
I think the bit about other IDEs should be reworded. I think it should be more clear that the links relate to the corresponding editors' virtual environment documentation rather than just information about the editors itself. I also think it should be specifically recommending looking at your editors venv documentation.
For example, it is common that a user may set up a venv using a guide similar to this, and then be confused when they click the green run button in the IDE and it runs with t...
Yep, I struggled to keep that section short, while keeping it relevant. I think that sums it up nicely.
Just a slight reword:
If you run code through your editor, check the relevant documentation on how to use your new virtual environment. For example, see the VSCode or PyCharm docs.
Is that alright?
Yeah, that sounds great.
This is maybe slightly more concise again
If you run code through your editor, check it's documentation on how to make it use your virtual environment. For example, see the VSCode or PyCharm docs.
Anything along these lines or what you suggested is good though
GitHub Actions run 1091749279 succeeded.
Looks good to me, thanks!
GitHub Actions run 1091826724 succeeded.
The syntax has changed for the yaml file, given the : near the end of it. I think I need to escape that with one singular \.
Oh interesting, that makes sense.
Also still some pythons that need capitalizing btw
I wish I could help with the Python caps, but it'll be a lot of trouble to start a new fork for it
c1fcab3 Fix TypeError when infraction append is not giv... - MarkKoz
[python-discord/bot] New branch created: bug/mod/1706/infr\-append\-no\-reason
Fix #1706
Not much to say. See the related issue.
GitHub Actions run 1092451731 succeeded.
[python-discord/bot] New branch created: bug/bot\-1jd/backend/wait\-for\-deletion\-404
[bot] Branch bug/bot\-1jd/backend/wait\-for\-deletion\-404 was force-pushed to `8bfc0d7`
GitHub Actions run 1092552531 succeeded.
[python-discord/bot] New branch created: feat/deps/sentry\-1\.x
It was quite outdated. 1.0's breaking change doesn't affect us. 1.3 doesn't have any features or bug fixes that really benefit us either, but updating it will make sentry.io stop pestering us to update it.
GitHub Actions run 1092574058 succeeded.
GitHub Actions run 1092576830 succeeded.
Connected!
GitHub Actions run 1092586647 succeeded.
699375b Suppress 403 error when sending DEFCON reject DM - MarkKoz
[python-discord/bot] New branch created: bug/mod/bot\-137/defcon\-reject\-dm\-403
[bot] Branch bug/mod/bot\-137/defcon\-reject\-dm\-403 was force-pushed to `4d40f6d`
Sentry Issue: BOT-37
403 occurs if the user has DMs disabled. The specific code is 50007, but I don't think 403 would be raised for any other reason here, so I didn't check the code explicitly. If someone has more insight on this, please comment.
[python-discord/bot] Checks Successful on PR: #1711 Suppress 403 error when sending DEFCON reject DM
GitHub Actions run 1092664468 succeeded.
Wouldn't it require to handle discord.HTTPException? Or I totally misunderstood you
I'm not sure it makes complete sense for this command to accept an empty reason, as the only reason to use it without a reason is if you were changing the duration, in which case you should just use !infr edit. It's probably fine to leave it like it is, though.
Wouldn't it require to handle discord.HTTPException? Or I totally misunderstood you
discord.Forbidden is a subclass of discord.HTTPException, httpexception could be any response from the api saying it didn't work, e.g. a random error with the Discord API, while Forbidden is more specific, and as in that part of the code we only want to catch disabled DMs, I believe Forbidden is correct.
If you were instead referring to replacing the general Exception with `discord.HT...
I can't think of any other reason the bot should get a Forbidden error here. lgtm
I think the way it is currently looks simpler than a ternary and an f-string would.
True, although the cog (and the whole bot) is so mixed already that i'm not sure it's really worth it, imo if we want to enforce it it should be through a linting workflow, as suggested in https://github.com/python-discord/bot/issues/1641. I guess I can fix this on the bit's I PRd though, will leave the rest of the cog as-is though.
GitHub Actions run 1093742747 succeeded.
Caps issue:
Line: 26. Word: python -> Python. Reason: Name
Line 31. Word: python -> Python Reason: Name
Line 32. Word: python -> Python Reason: Name
Line 33. Word: python -> Python Reason: Name
Line 35. Word: python -> Python Reason: Name
Line 67. Word: what -> What. Reason: After question mark (?)
501f0d5 Create Resource type annotation. - swfarnsworth
f3b17e7 Restructure table of resources for new query lo... - swfarnsworth
d244bc9 split up checkbox options in query params - fisher60
c81c29f Convert data structure for query. - swfarnsworth
a627dd9 Implement desired query logic. - swfarnsworth
[python-discord/site] New branch created: swfarnsworth/smarter\-resources/filtering\-system
[python-discord/site] branch deleted: swfarnsworth/smarter\-resources/new\-resources
[python-discord/site] branch deleted: swfarnsworth/smarter\-resources/update\_labels
[python-discord/site] New branch created: dawnofmidnight/smarter\-resources/filtering\-system
[python-discord/bot] New branch created: mbaruh\-patch\-1
- Fixed wrong condition in rescheduler which made the eventual consistency not work.
- Mods now correctly removed from cache on role reapplies.
GitHub Actions run 1094671339 succeeded.
GitHub Actions run 1094678395 succeeded.
Connected!
GitHub Actions run 1094693609 succeeded.
GitHub Actions run 1094763897 succeeded.
"""Show whether automatic posting of reviews is enabled or disabled."""
status = "enabled" if await self.autoreview_enabled() else "disabled"
await ctx.send(f"Autoreview is currently {status}")
Should we have punctuation? As in, ":x: Autoreview is already disabled." (currently missing).
Connected!
Elsewhere we use self from what I found (instead of Information).
GitHub Actions run 1094775588 succeeded.
Can you give this a description of what the keys and values are, similarly to the ones in modpings and voice_gate
But it's a static method, and the reason it is a static method is because it's a helper function, but it is sort of unique to this cog, so I put it directly into this cog.
Neither seems preferable over the other to me. Your suggestion looks neater but the one liner is maybe slightly less readable.
Should we have punctuation? As in, "
:x: Autoreview is already disabled."(currently missing).
The rest of the cog doesn't seem to include full stops, and I don't think it matters too much anyway, so I don't think so, no.



