#dev-log
1 messages ยท Page 95 of 1
[bot-core] Branch monkey\-patch\-in\-util\-namespace was force-pushed to `1b99786`
Raised https://github.com/python-discord/bot-core/pull/35 for this comment, good point Mark
[ ... ]
VoiceChannel** which may not include all attributes/methods (send()andedit()would be present I believe). Any issues that may arise from this that come to mind?
Not that I can think of, we also don't use text in voice channels in the server.
Additionally, this pull request is pretty much incompatible with every other pull request currently open. Has there been any thought put into figuring out which ones should be merged before this is merged, and which ones should be m...
Marked as do not merge to allow me to squash fixup commits on this PR before it hits main
Are the parenthesis necessary?
Should this really be exposed in __all__? I mean, it's meant to be internal.
I don't know how to test this other than importing the function and calling it, but that worked as it was supposed to. Thanks for the quick PR Chris!
[bot-core] Branch monkey\-patch\-in\-util\-namespace was force-pushed to `19c8ddd`
[python-discord/bot-core] branch deleted: monkey\-patch\-in\-util\-namespace
9e6989a fixup: Bump bot-core to 3.0.0 for new monkey pa... - ChrisLovering
GitHub Actions run 1930646450 succeeded.
0d1fb62 Add a README for the API app - jchristgit
[python-discord/site] New branch created: readme\-for\-api\-app
GitHub Actions run 1930838419 succeeded.
Would it be worth mentioning here our policy of renaming migrations to be human-readable/more informative? That might be diving too deep into our policy.
Fantastic and helps explain how our api folder is setup with wonderful resources as well.
I have a small comment/note, but otherwise this makes it much more approachable with clear points/resources that people can run with and learn more about if they're feeling a bit lost.

Resolves python-discord/meta#167
GitHub Actions run 1932067757 failed.
GitHub Actions run 1932130866 succeeded.
Connected!
GitHub Actions run 1932805350 succeeded.
GitHub Actions run 1933081017 succeeded.
Connected!
GitHub Actions run 1933105415 succeeded.
What about
"On Oct 18, 1963 the cat was launched into space on rocket No. 47."
The sentence doesn't need to be very long to get the point about digits across.
I would say "The re docs for the list of regex functions" and "regex101 for figuring out the right regex for what you want to match".
I would prefer something shorter and less formal:
Regular expressions (regex) are a tool for finding patterns in strings. The standard library's
remodule defines functions for using regex patterns.
What you wrote is good, but many of our users are young and/or not fluent in English. Also, novice developers might see that regex are a language and think that learning to use them is like learning a new programming language.
It's difficult to explain what regex can do without usin...
This is the first step for #7, as the next step is to incorporate the code jam management system.
This PR also adds aiodns for our http requests, and a utility for uploading our pastebin output before it is added to bot-core.
Good points, changed ๐
Shortened it even more to fit on one line in the embed
Tried slightly different wording, let me know what you think
GitHub Actions run 1937180793 succeeded.
Maybe the migrations and models could use some more explanation (i.e. what those terms actually mean), but it could be covered elsewhere in a more general area I suppose.
I've looked over all the diffs; looks fine except that one comment. I ran the bot and it started up fine. I did my own search for missed references and couldn't find anything.
Reviewing every line paid off
# cooldown logic, taken from disnake's internals
GitHub Actions run 1938247630 succeeded.
f8ea3e8 Add day duration convertor - Shivansh-007
3dda754 Make 16hours the max off time and not on - Shivansh-007
034c6c7 Make the help message more verbose - Shivansh-007
a0c742e Don't add modpings role back (after manual off)... - Shivansh-007
6b8a874 Get member object to properly add modpings role - Shivansh-007
[python-discord/bot] New branch created: fix/modpings
4920515 fix: Set the logger class in botcore.utils.logg... - ToxicKidz
[python-discord/bot-core] New branch created: fix/trace\-logging
Fixes an issue when using trace logging on loggers that were instantiated before the class was set.
[python-discord/bot-core] branch deleted: fix/trace\-logging
Is this the only app for which migrations are relevant? If not, we may want to have a more general documentation page to explain this, which ties into my review comment.
72c26b5 No longer use Interaction.message, as it was re... - ChrisLovering
3031a12 fixup: remove . from subscribe buttons - ChrisLovering
GitHub Actions run 1939474749 was cancelled.
GitHub Actions run 1939477776 succeeded.
Ran most commands, seems to work well. Thanks!
GitHub Actions run 1939544380 succeeded.
a30f885 Migrate from Discord.py to disnake - ChrisLovering
960619c Update all references of discord.py to disnake - ChrisLovering
ab073c8 Migrate to use monkey patches from botcore - ChrisLovering
a1c73b5 No longer use Interaction.message, as it was re... - ChrisLovering
acaae30 Merge pull request #2103 from python-discord/di... - ChrisLovering
[python-discord/bot] branch deleted: disnake\-migration
Connected!
GitHub Actions run 1939581513 succeeded.
The issue is not approved @MaskDuck (you can tell if it's approved when there's an approved label on it). I'm not sure if we need this given the wolfram command exists.
GitHub Actions run 1939711833 succeeded.
discord.py just went back to life (Nice timing btw :joy: )
073e09a Mention human-readable migration names - jchristgit
I added this in 073e09a0. Thanks for the review!
Maybe the migrations and models could use some more explanation (i.e. what those terms actually mean), but it could be covered elsewhere in a more general area I suppose.
For what it's worth, I don't think we should need to explain what these mean. We require basic Django knowledge, and if you've worked through the tutorial, you know what these mean. I don't want to duplicate Django documentation here either.
GitHub Actions run 1940873584 succeeded.
GitHub Actions run 1940884421 succeeded.
[python-discord/sir-robin] New branch created: pr/migrateaoc
Closes #6
Currently in Draft State, as I still need a site PR to store AoC related data there.
[python-discord/infra] New branch created: feat/h\-service
This is a basic setup for an h-asgi deployment. Me and @MarkKoz got as far as we could without access to any staging environment.
We found 2 major issues with trying to deploy h-asgi in this way. First being a possible issue around conflicting iptables rules with ufw and podman. Where a published port cannot be port forwarded easily. See: https://stackoverflow.com/a/51741599
This should not be an issue if we use only reverse proxies, like nginx. But is something to keep in mind as a possi...
This PR relates to issue #26
How would you like to document this FAQ?
Just to make sure I understand your proposal, you'd like to simply write actual files to disk rather than faking the filesystem in tests? Should the tests also clean up those files in the teardown?
An alternative could be using a temporary directory instead of the tests folder. Ideally, it would get cleaned up between tests to avoid violating the test isolation principle.
Yet another alternative could be using a container for development that does include (some of) the development dep...
Core Developers will be discussing this internally. There is no need for a public issue tracker on this.
Hi, well, some parts of it will be covered elsewhere by e.g. the app-specific documentation. The rest I'm not sure yet - perhaps a good place to link it would be in the site contributing site for both DRF-specific topics and pydis-specific topics
Just to make sure I understand your proposal, you'd like to simply write actual files to disk rather than faking the filesystem in tests?
Yes
Should the tests also clean up those files in the teardown?
No, the files would be present beforehand. I'm 99% sure we don't have anything that depends on "what happens if I move this file there" or "delete this file here and there", the idea is mostly to create a resource layout
I see this as an absolute win. I left some Ansible suggestions:tm:
Absolute winner. ABSOLUTE winner.
Wait, how does this work with a list..??
For sake of correctness, this should probably be in a role called systemd with just this handler that's depended upon, otherwise we may end up duplicating this everywhere.
dd49c02 Support arbitrary podman run options - 1101011
7517f68 Support arbitrary podman systemd service options - 1101011
549326f Ensure cid file exists before using podman rm - 1101011
d5a3ea4 Be consistent with spaces around = in service unit - 1101011
e68667c Remove duplicate cgroups option for podman - 1101011
Honestly, i have no idea. But it does :D
We should probably use the no-conmon option rather than completely disable cgroups. As it is the default option when generating a new podman service file with --new. Maybe @jchristgit remembers why there is a disabled on the cgroup here?
https://docs.podman.io/en/latest/markdown/podman-generate-systemd.1.html
In #18, one of the goals is
Configure Podman services to use host cgroup and run managed by systemd
According to @jchristgit, we want to use systemd for resource limits (meaning we don't need pdoman to create cgroups) for "ease of getting metrics."
@imsofi Do you think this is resolved now that arbitrary options can be passed to podman? I imagine most services will only need to publish one port, so there isn't much benefit to the small convenience of supporting a list of ports directly.
While a good idea for flexibility, it does pushes the complexity up the stack. Leading to a more fragmented configuration for all the roles that rely on podman. Where it makes it harder to spot mis-configured services, or force specific requirements on all podman services (for example that every service would need to define a value for CPUQuota or MemoryMax limits).
I don't see why we can't have both.
No, arbitary arguments does not help adding extra options to the start command im afraid.
Using arbitrary options to simplify the complexity in our role is counter productive. As we are essentially pushing that complexity upwards. Where now everyone using the podman role now also needs to know how to configure systemd, leading to a very over-complicated interface to set up podman containers.
Im against it because of how much complexity it adds to the interface we are creating. And if we run without arbitrary key=value configuration, it makes it much more desirable to put the change you want in the podman role directly, rather than each podman role having to have several arbitrary key value settings copy-pasted and updated across the repo.
It's not using systemd options; it's https://github.com/python-discord/infra/pull/57/commits/3a826423014cf7c006feb05d74cf456a8abdb200
There is some merit to what you are saying, but I also think it's not unreasonable to expect some options to be known. I think it's a fair trade off for more flexibility. It seems tedious to maintain a template that needs to cover all options we need. Furthermore, because now instead of being able to leverage existing knowledge of podman/systemd, one has to ...
Oh yeah, that makes sense. ๐
There is no Startup* equivalent for memory limits. I'm not sure if that means the memory limit applies to all stages or only to ExecStart.
There is no
Startup*equivalent for memory limits. I'm not sure if that means the memory limit applies to all stages or only toExecStart.
Currently im looking into separating the downloading of the podman container, as it is not technically needed in the systemd file.
I think it would be beneficial to have a page with toggle dropdowns listing all the tags we have and their contents for easy viewing.
We have the !tags on the server, but to read their contents you would have to run !tag-name on each individual tag or browse to our bot repository and read the markdown files directly. Both are not quite the smooth user experience I would want the folks on our server to have.
We can can build this page somewhat dynamically as it can pull from the spec...
I think i understand your general idea, but I am still a bit unsure what you are proposing. Could we take a call when you have time and talk over this?
c771333 Remove API change references - jchristgit
[python-discord/site] New branch created: joe\-said\-"we\-dont\-do\-main\-pushes\-anymore"
GitHub Actions run 1947256244 succeeded.
[python-discord/site] branch deleted: joe\-said\-"we\-dont\-do\-main\-pushes\-anymore"
GitHub Actions run 1947277737 succeeded.
[python-discord/site] New branch created: pr/aoc
Summary
I added support for storing AoC related data in site
Description of changes
Added two new endpoints, with relating ViewSets and models
I confirm I have:
- [x] Joined the Python Discord community
- [x] Read the Code of Conduct and agree to it
- [x] I have discussed implementing this feature on the relevant service (Discord, GitHub, etc.)
[python-discord/site] Checks Successful on PR: #689 Add support for storing AoC related data in site
GitHub Actions run 1947493770 succeeded.
There is no
Startup*equivalent for memory limits. I'm not sure if that means the memory limit applies to all stages or only toExecStart.Currently im looking into separating the downloading of the podman container, as it is not technically needed in the systemd file.
In that case, probably good to use --pull=never for podman run.
One minor question and a few nitpicks. The question is probably not as useful. Thanks!
nit:
>>> {
... 'user': int,
... 'is_blocked': bool
... }
Wouldn't every user in this table be blocked? Should we add / use a reason field instead?
Nit:
... 'user': int,
... 'aoc_username': str
This should be a OneToOneField. I realise this is using the Discord User model rather than the Django user model, but I believe this is still applicable https://docs.djangoproject.com/en/3.2/topics/auth/customizing/#extending-the-existing-user-model
Yeah, I think it can be assumed the user is blocked by virtue of just existing in this table. Admittedly, it is kind of strange to have a table with just one field but on the other hand is_blocked seems redundant.
Can only linked users be blocked from being a completionist? Is that separate from this table because we need to be able to keep a user blocked if they unlink their account?
If that is the case, it may be better to merge the tables, and instead of deleting the record when the user unlinks, just set aoc_username to null/empty. This way, the block will remain for unlinked users. What are everyone's thoughts on this alternative?
[python-discord/infra] New branch created: psql\-exporter
login_unix_socket: /run/postgresql/
Can this instead use the service module which is a bit more generic, or is the a good reason to be using systemd here?
No, I don't believe there is a reason to use systemd here over service.
Is it confirmed that privilege escalation is necessary? Are we not connecting as root?
Does service support this? I'm not sure that we need this anyway.
Double space :)
>>> re.findall(regex_pattern, foo)
Ah yea, become is already yes in the config, so I do not believe this would be necessary.
Ah, it seems it doesn't so systemd would be needed to use this.
Talking with volcyy, it was needed to ensure that the service picked up the new config we set in the previous step.
GitHub Actions run 1949503575 succeeded.
Alright, they are just static test resources in that case. Cool, I'll have a stab at it.
b59b4f4 Remove modlog ignore for voice verif - ChrisLovering
[python-discord/bot] New branch created: log\-voice\-role\-assignments
When a user leaves and rejoins, and then asks for the voice verification role back in modmail, we want a way to see if they have every been given the role.
By removing this modlog ignore, it allows us to check the user-log channel for user updates to see if they were ever assigned the role.
GitHub Actions run 1950966081 succeeded.
In the linked PR I decided to only remove the ignore for the role assignment. I didn't think there was any point in logging the deleted message too.
Presently the bot has logic to exclude logging of both the member role update and the !voiceverify invocation. While removing the ignore for the role assignment does solve my issue of not knowing when a user had verified previously, I find the current behavior (prior to your PR) very odd and not intuitive.
Why have code to ignore !voiceverify invocations at all? It goes against my expectations as an end user of the bot as a moderator, since we log all other deleted messages in #voice-...
I see the concern, however there is no reason provided on the bot side, as a golden mean I could implement a deactivate block command which sets the is_blocked field to False whilst keeping a record of users who have been blocked previously.
Oh, yes. I didn't catch it. Thanks!
No, I don't believe so, this way Admins can block users even if they haven't linked their AoC account.
Otherwise, they would be limited to wait until they link their account, and then block them.
19c6e7b Enhance comments and table structure in AoC rel... - D0rs4n
[python-discord/site] Checks Successful on PR: #689 Add support for storing AoC related data in site
GitHub Actions run 1952091821 succeeded.
GitHub Actions run 1953821005 succeeded.
Connected!
GitHub Actions run 1954899935 failed.
This adds the Discord embed limits pinned message as a guide, as asked by @Shom770.
GitHub Actions run 1957834347 succeeded.
This adds the Discord embed limits pinned message as a guide, as asked by @Shom770.
GitHub Actions run 1957888563 succeeded.
GitHub Actions run 1958447408 succeeded.
It might make sense to keep the column in case we need to unblock someone. Altering a value in a row is ever so slightly easier than deleting a row. I also wouldn't be opposed to a reason field, so there's some context around it.
Alright, that might need some modification on the bot site, although.
But, minor ones, only.
[python-discord/site] Checks Successful on PR: #689 Add support for storing AoC related data in site
GitHub Actions run 1959067614 succeeded.
Currently when using the !tag command, if the text you wish to prepend to the channel name has multiple words, only the first word will be prepended to the channel name unless you use quotes.
Making the tag argument keyword-only will eliminate the need for wrapping the text with quotes.
It would also be cool if the command doesn't silently error when hitting channel name edit ratelimit and give a helpful message instead.
I can implement this but I'm not sure how to handle the r...
Resource name
Machine learning in Python with scikit-learn
Resource location
Primarily: https://inria.github.io/scikit-learn-mooc/
Also:
- https://www.fun-mooc.fr/en/courses/machine-learning-python-scikit-learn/
- https://github.com/INRIA/scikit-learn-mooc/
Payment type
Free
Why it should be included
The course presents a detailed overview of Machine Learning practices and the models offered by the sklearn package, and explains the reasoning behind each of the ...
This looks good and handles the issue cleanly in the code, thanks for the fix!
GitHub Actions run 1959702802 succeeded.
Awesome! I did have one cosmetic comment, but it does not affect my review.
Thank you for finishing this PR after it was stalled/delayed! โค๏ธ
The formatting of this line is a little odd, shouldn't it fit on one line?
await asyncio.wait_for(rename_channel(), 3)
A little nitpick to keep in consistency with the other titles
title: Discord Messages with Colors
Could we order this to be:
The way the colors look like on Discord is shown in the image below:

Note: If the change as not been brought to you yet, or other users, then you can use other code blocks in the meantime to get colored text. See this gist: <https://gist.github.com/matthewzring/9f7bbfd102003963f9be7dbcf7d40e51>
This would also apply to the PR #690 right?
The code looks good, and the feature works. Thanks Mark for putting this together!
[python-discord/bot] branch deleted: feat/mod/1664/resend\-infraction
f1894e5 Remove unnecessary config constant - MarkKoz
af3c145 Add util function to send an infraction using a... - MarkKoz
780074f Add command to resend infraction embed - MarkKoz
fa797ce Fix superstarify reason displaying the incorrec... - MarkKoz
44451dc Disallow resending hidden infractions - MarkKoz
[python-discord/site] Checks Successful on PR: #689 Add support for storing AoC related data in site
GitHub Actions run 1959944291 succeeded.
Connected!
GitHub Actions run 1959960136 succeeded.
[python-discord/modmail-plugins] New branch created: vivek/channel\-tagging\-improvement
[python-discord/modmail-plugins] branch deleted: vivek/channel\-tagging\-improvement
[python-discord/modmail-plugins] New branch created: channel\-tagging\-improvement
Closes #22. Description in the issue.
screenshots:
Hey @cheesemaafia, looks like we missed your comment sorry about that! If you are still interested join us on discord and let us know your name and we can help guide you!
GitHub Actions run 1962245551 succeeded.
As per the feedback from other mods, can you also remove the modlog ignore deleting !voiceverify messages?
Blocking temporarily, see my comment.
This URL breaks the page on mobile (see screenshot). Not sure why it's only this link, and I don't know if this is related to anything you did in particular, but I haven't had a chance to investigate.

The text says "below" but the arrows point up and the image is above?
To send colored text in a code block you need to specify the `ansi` language before writing your text:
Ah, okay. Please disregard this comment then. I'll mark it resolved.
I could use a hyperlink instead.
If we want to keep a reason around, then the is_blocked field makes more sense. However, this is starting to look more like an infraction at this point.
It might look like one, but admins might not want to block someone and give them an infraction the same time.
Especially, because that's on Events Bot, (used to be on Sir-Lanebot)
I was trying to keep the tables as close to the code as possible
I'm not sure if I agree with this approach going forward with other migrations from redis to the API. The design that makes sense for redis doesn't necessarily make sense for the API. I'd rather not have the API be beholden to the choices that were made for redis. This is more of a general comment; don't take it to mean that my alternative suggestion in this case was definitely the better choice.
If we want to make these...
Regardless of the general approach proposed, I'd still part with using two tables, to keep things consistent, and easier to handle on the bot side, as they're two distinct commands.
Better to use blank instead of null. But maybe we should leave it null since that seems to be what other endpoints use for similar fields (and change them all later in a separate PR if we want)?
https://docs.djangoproject.com/en/3.2/ref/models/fields/#null
Yes, I used Infractions as a reference, to keep things consistent
I'm not sure, but I think this is redundant since it's listing all fields. I believe leaving the fields unspecified would be equivalent.
Doesn't this makes it a bit easier to understand?
In my personal opinion it makes it easier to understand what those serializers are for.
Probably want to be able to filter by is_blocked too.
I don't know. Maybe. But it's also yet another thing to maintain when a field gets changed. On the other hand, maybe we don't want new fields to implicitly be included in the serializer. Just a comment so I don't feel strongly either way.
Deletes the AoC Completionist block item with the given `user__id`.
#### Status codes
Deletes the AoC account link item with the given `user__id`.
#### Status codes
Does this really still return a list for just 1 user? I am pretty sure the default DRF behaviour is to return a single object.
Surely it's meant to be this?
### GET /bot/aoc-account-links/<user__id:int>
Some minor things in the docs like user__id not always being surrounded by backticks or some sentences not having full stops, but I will leave it up to you if you want to be bothered with fixing that.
8c95f13 Enhance code, documentation consistency in AoC ... - D0rs4n
Another thing is inconsistent use of tense/mood.
[python-discord/site] Checks Successful on PR: #689 Add support for storing AoC related data in site
GitHub Actions run 1964272048 succeeded.
Yes, I was under the impression that it does, but after testing it out yesterday, it seemed to return a list still.
Don't mind me, you're right! :D
Not sure why I updated in the end.
245f8b0 Add new filter field, and patch the docs in AoC... - D0rs4n
[python-discord/site] Checks Successful on PR: #689 Add support for storing AoC related data in site
GitHub Actions run 1964790912 succeeded.
GitHub Actions run 1965313468 failed.
This was correct originally.
- 204: returned on success
Shouldn't be indented as far.
Are you not planning on unit tests by the way? Not sure if there is much to gain anyway since this is mostly relying on DRF.
For the systemd role, may be personal preference, but it may be nicer to have a systemd role that this role depends on, in that role just have a handler that does daemon_reload, otherwise we will start duplicating this across roles a lot.
[python-discord/site] Checks Successful on PR: #689 Add support for storing AoC related data in site
GitHub Actions run 1965651711 succeeded.
Initially I was not, I checked out a similar migrating PR (namely the PR made by @ChrisLovering ) to see if there were tests.
But yes, these things are strongly reliant on DRF, and I did not introduce things such as complicated constraints, or custom actions.
If we have these tasks in the base role like this, every dependency to the podman role with different vars will re-run the role again and thus also run all the tasks in here, such as installing podman itself. We should split the configuration into a separate task file, that is then included when we want to configure a container.
We can also talk about this in a meeting, though. I'll message the channel shortly
[python-discord/site] Checks Successful on PR: #689 Add support for storing AoC related data in site
GitHub Actions run 1970059398 succeeded.
[python-discord/site] branch deleted: pr/aoc
a6b8c27 Add support for storing AoC related data in site - D0rs4n
19c6e7b Enhance comments and table structure in AoC rel... - D0rs4n
b93dce5 Add reason field to AoC completionist block table - D0rs4n
d18d019 Patch AoC tables to use the Discord user as PK. - D0rs4n
8c95f13 Enhance code, documentation consistency in AoC ... - D0rs4n
GitHub Actions run 1970238762 succeeded.
GitHub Actions run 1971039042 succeeded.
GitHub Actions run 1971774538 succeeded.
c0666e5 Add a README for the content directory - jchristgit
[python-discord/site] New branch created: readme\-for\-content\-directory
GitHub Actions run 1973683428 succeeded.
With this blog post, the ability to create diagrams has been acquired.
Diagrams to provide users with information how services are connected would be quite useful for early contributors.
@jchristgit approved, or something.
c7300a9 Sync Filter models with relating migrations, ad... - D0rs4n
Doc item doc_item.symbol_id='disnake.PartyType.youtube' present in loaded documentation inventories not found on site, inventories may need to be refreshed.
5095c7a Replace ASCII diagram with mermaid sequence dia... - MarkKoz
This is a comma splice.
relatively little code in there; most of it is concerned with serving our
The process of contributing to pages is covered extensively in our online guide, which you can
find
All references to "Markdown" should be capitalised.
Good point. I've removed it in 4ad92b98a0df047b12e302ce8d849c2bd85862f1.
ca2c583b15d46d7821a03ec047678429f96c7e03
ca2c583b15d46d7821a03ec047678429f96c7e03
ca2c583b15d46d7821a03ec047678429f96c7e03
ca2c583b15d46d7821a03ec047678429f96c7e03
ca2c583b15d46d7821a03ec047678429f96c7e03
ca2c583b15d46d7821a03ec047678429f96c7e03
ca2c583b15d46d7821a03ec047678429f96c7e03
GitHub Actions run 1974383143 succeeded.
Just one thing you forgot. Looks good otherwise.
- `views` contains Django views which generate and serve the pages from the
"""Pin an initial question `message`."""
"""Unpin all messages sent in `channel`."""
Sorry Mark, I have the brain of a parrot. Rest assured this mistake is fixed and won't happen again in the future.
Thanks for the review!
GitHub Actions run 1974495144 succeeded.
This will allow a discord.Message to be passed to pin_wrapper instead of a message ID. Thus, the wrapper will be able to call the discord.Message.pin and discord.Message.unpin functions rather than using the undocumented methods on HTTPClient. Would you mind updating the wrapper function too @dementati?
GitHub Actions run 1975068290 succeeded.
Connected!
GitHub Actions run 1975076505 succeeded.
This comment is a bit too far to the right. If there's two spaces instead of this many, then it can all fit on one line, making the embed smaller. Oberve.
With many spaces:

With two spaces:

['18', '196', '3', '47'] # Notice the year is cut off
noTicE THE Year is cUT Off
I also shortened the other comment
GitHub Actions run 1975307237 succeeded.
GitHub Actions run 1975396431 succeeded.
Connected!
GitHub Actions run 1975404158 succeeded.
GitHub Actions run 1975814779 succeeded.
GitHub Actions run 1975814964 succeeded.
GitHub Actions run 1975814947 succeeded.
GitHub Actions run 1975814959 succeeded.
GitHub Actions run 1975812245 succeeded.
GitHub Actions run 1975831584 succeeded.
GitHub Actions run 1975835386 succeeded.
GitHub Actions run 1975835409 succeeded.
GitHub Actions run 1975835425 succeeded.
GitHub Actions run 1975844956 succeeded.
GitHub Actions run 1975852240 succeeded.
GitHub Actions run 1975852338 succeeded.
GitHub Actions run 1975853483 succeeded.
GitHub Actions run 1976093672 failed.
GitHub Actions run 1977199963 succeeded.
Changes the Project Lead color to the new one
Adds an entry for the Events Team (Note: I replaced the Project Teams entry completely on the assumption that it was no longer relevant)
GitHub Actions run 1977205789 succeeded.
Won't this raise AttributeError? We could add a falsely default:
for role_id in getattr(form, attribute, None) or []:
I think if you user hyperlinks for these 3 bullet points we should be good to go @kkrypt0nn
I would suggest using bolded text, and not inline code block for these links. Example:
<img width="243" alt="image" src="https://user-images.githubusercontent.com/75038675/158081476-32895fe8-d6d9-44d0-a38d-3c375e456f8a.png">
In my mind getattr already returned None by default, hence the or []. You're right though, I'll move the [] as the default.
Can we move this to a constant at the top of the file or in the constants file so that it is easily changed?
I tested this on my computer and it worked nicely! Not approving until the previous comments have been addressed though.
One thing I do want to bring up is perhaps using a prefix for the role scopes? I feel like we'll eliminate a potential issue with a role and an unrelated scope having matching names or similar. For example, just formatting role: in front of each name (role:Helpers for Helpers), could work nicely.
[python-discord/sir-lancebot] branch deleted: twemoji
a468379 Add Twemoji utility command (#988) - gustavwilliam
GitHub Actions run 1978052876 succeeded.
Connected!
GitHub Actions run 1978060630 succeeded.
GitHub Actions run 1978064284 succeeded.
Connected!
GitHub Actions run 1978072808 succeeded.
await request.state.db.forms.replace_one({"_id": form_id}, form.dict())
form = await request.state.db.forms.find_one({"_id": form_id})
GET/PATCHing a form both through the frontend and through making requests manually to the backend fails with a 404 for me, which is fixed through the suggested changes and verified by checking the state of the form in the database. Not sure if this is just an issue on my end, since it seems to work fine in @Bluenix2's testing
# Short circuit all resources for forms admins
since we are making the distinction between the two
This is interesting and would like to be assigned this issue if possible? It would be my first contribution and seems to be within my skillset. Thanks!
Does it need to be easily changed, or changed at all for that matter?
The model aliases and inserts both, so both should work here. Either way, I've changed it now if it helps you.
7c3afa8 Add Default Attribute For Form Access Helper - HassanAbouelela
GitHub Actions run 1978623244 succeeded.
GitHub Actions run 1978633680 succeeded.
Yes, please consider @iamericfletcher 's request as I might not be able to give my attention to issue due to having session ending examinations.
GET/PATCHing a form both through the frontend and through making requests manually to the backend fails with a 404 for me, which is fixed through the suggested changes and verified by checking the state of the form in the database. Not sure if this is just an issue on my end, since it seems to work fine in @Bluenix2's testing
I used to have similar issues. See [this message in our internal channel](#dev-forms message)...
Given the nature of the information sought by the user, I agree with @zeph-yrus9 that this command should reside in bot/exts/info. I've created a new file for this command on my local machine instead of adding the !resource command to help cog.
Also, I added a method to scrape the Topics from https://www.pythondiscord.com/resources/. I plan to use this information...
I see how this could be helpful in the face of a particular infraction by a user. If someone is advertising, it wouldn't be very productive to have the command ask them to visit a link for the particular rule in question.
Even just adding the particular rule snipped based on the optional keyword would be a more impactful way to communicate the rule that is being violated in my opinion.
56d7fdd Revert "No longer use Interaction.message, as i... - ChrisLovering
6447f71 Revert "Migrate to use monkey patches from botc... - ChrisLovering
e6c1ec0 Revert "Update all references of discord.py to ... - ChrisLovering
5f52290 Revert "Migrate from Discord.py to disnake" - ChrisLovering
[python-discord/bot] New branch created: revert\-disnake
GitHub Actions run 1982593789 succeeded.
Thanks Chris for doing this.
65f4240 Increase watch API call limit to 10,000 - jb3
[python-discord/bot] New branch created: jb3/increase\-watch\-limit
By default, the site infractions query API will only return 100 records,
but we have more active watches than this meaning that the response
truncated active infractions and so the bigbrother cog was not
initialising with all active watches.
This change ensures that up to 10,000 watches are fetched instead meaning no
infractions will be truncated and missed.
GitHub Actions run 1982747058 succeeded.
Connected!
GitHub Actions run 1982849913 succeeded.
48ef95b Pre-fetch watched users to avoid sequential API... - ChrisLovering
[python-discord/bot] New branch created: parallel\-fetch\-user\-bb
When there are many watched users, many sequential calls to get_or_fetch_member will be made, slowing down the whole command.
Pre-fetching them with an asyncio.gather will speed this up dramatically, thanks to the power of non-blocking networking.
GitHub Actions run 1983316143 succeeded.
You're already iterating over the entire list. You can build a dictionary instead and not have to iterate over all members in a loop.
Do you mean something like this, instead of the filter?
members = {member.id: member for member in members if member is not None}
GitHub Actions run 1983428404 succeeded.
Thank you for this fix Tizzy. Managed to fix a bug and simultaneously reduce code complexity - perfect!
[python-discord/infra] New branch created: jb3/certbot
Add a certbot role that generates a certificate on the first host in the
NGINX group and then deploys it to all other NGINX hosts. As of now we
generate wildcard certs for pythondiscord.com and pydis.wtf.
A unique SSH key is generated for each replica host which is restricted
for security purposes. A deploy hook is installed to push renewals to
other hosts.
Made draft until I figure out how to reload NGINX on renewals.
[python-discord/infra] branch deleted: jb3/certbot
[python-discord/infra] New branch created: jb3/http\-traffic
Allow HTTP traffic in addition to HTTPS by switching to the "Nginx Full" ruleset
[python-discord/infra] branch deleted: jb3/http\-traffic
[python-discord/infra] New branch created: jb3/housekeeping
- capitalise all role names
- remove vim modelines
[python-discord/infra] branch deleted: jb3/housekeeping
When a user sends a message which contains python code but isn't marked down, instead of simply letting them know about it, will also format the message, and send it as an embed, deleting the user's original message.
May also send the same "Now you know for next time" message to the user.
Migrates [this](#discord-bots message) message by the Python bot on different VPS services to the site, as part of the pin migration program described in issue #695. Also formatted it so it looks a bit nicer, by using unordered lists since markdown allows that.
Description
ahe anagram command always wait for 60s before announcing if i got right.
Steps to Reproduce
.anagram.- guess the word
- guess correctly
Expected Behaviour
it announce that i got it right
Actual Behaviour
it have delay for some seconds
Known Impacted Platforms
- [ ] Web
- [x] Desktop
- [ ] Android App
- [ ] iOS App
Possible Solutions
not yet, will edit this msg if i get any idea
Would you like to implem...
Description
There will be scenarios where we may want to re-render a page/component but keep track of prior state/entries for better user experience. Redux.js is how we'll be approaching this
Considerations
- We should incorporate redux into our current react setup.
- We use typescript, so we should be sure to follow the correct setup, taking inspiration from this
- Make...
Timestamps do rounding, which isn't something I want if I need to check for uptime. Relative timestamps also don't work on mobile.
I agree with @mbaruh, the rounding on relative timestamps makes them annoying for things like this
GitHub Actions run 1985938633 succeeded.
GitHub Actions run 1986019175 succeeded.
[python-discord/bot] branch deleted: revert\-disnake
4fcca02 Revert "No longer use Interaction.message, as i... - ChrisLovering
44121ea Revert "Migrate to use monkey patches from botc... - ChrisLovering
753e101 Revert "Update all references of discord.py to ... - ChrisLovering
a13fa94 Revert "Migrate from Discord.py to disnake" - ChrisLovering
93fafa2 Merge pull request #2113 from python-discord/re... - ChrisLovering
Connected!
GitHub Actions run 1986051166 succeeded.
[python-discord/infra] New branch created: jb3/fail2ban
Install and configure fail2ban to ban malicious SSH connections.
[python-discord/infra] branch deleted: jb3/fail2ban
3cb4389 Revert back to discord.py - ChrisLovering
ccd16f5 Change all instance of disnake to discord - ChrisLovering
6947100 Bump version and document breaking change - ChrisLovering
[python-discord/bot-core] New branch created: revert\-disnake
This reverts back to discord.py, and bumped the version of discord.py we use up to this hash.
This hash was chosen mostly because it's after my fix so we don't need the extra monkey patch, and there are a few "fix" commits after it (also since it's the HEAD of master right now)
This is stable software
[python-discord/bot-core] branch deleted: revert\-disnake
3cb4389 Revert back to discord.py - ChrisLovering
ccd16f5 Change all instance of disnake to discord - ChrisLovering
6947100 Bump version and document breaking change - ChrisLovering
bc0a470 Merge pull request #39 from python-discord/reve... - HassanAbouelela
[python-discord/bot-core] New tag created: v4\.0\.0
f1894e5 Remove unnecessary config constant - MarkKoz
af3c145 Add util function to send an infraction using a... - MarkKoz
780074f Add command to resend infraction embed - MarkKoz
fa797ce Fix superstarify reason displaying the incorrec... - MarkKoz
44451dc Disallow resending hidden infractions - MarkKoz
c62a52e Allow duckifying of messages in threads - TizzySaurus
7110024 Use discord.Guild.get_channel_or_thread() ins... - TizzySaurus
532ce7d chore: Simplify the permissions checking in duc... - ToxicKidz
a441a72 Merge branch 'main' into fix-issue-1930 - ToxicKidz
39deb2b Merge pull request #2087 from python-discord/fi... - ToxicKidz
[python-discord/bot] branch deleted: fix\-issue\-1930
GitHub Actions run 1987491510 succeeded.
Connected!
GitHub Actions run 1987517129 succeeded.
[python-discord/sir-robin] New branch created: migrate/dpyv2
- Migrate to use the newly announced Async Cog loading feature
- That's it, also the message content intent has been enabled.
We likely want _intents.members too, but isn't needed by any cogs right now.
[python-discord/infra] New branch created: jb3/elastic\-stack
- Deploy Elasticsearch
- Deploy Filebeat
- Deploy Packetbeat
- Deploy Kibana
- Allow all internal traffic in UFW
- Add NGINX configuration for Kibana
๐ช One innovation token has been deducted...
This, along with the "add elasticsearch repo to apt", should be in a base role used by both roles, to keep deduplication to a minimum.
A great and very needed solution.
[python-discord/infra] branch deleted: jb3/elastic\-stack
Seeing how many we're disabling. Would it be easier using discord.Intents.none()?
I mean that's how it's done on Lance, it's a bit more easier to understand this way, the result is basically the same. :D
[python-discord/infra] New branch created: jb3/auditbeat
Adds Auditbeat deployment for auditing.
[python-discord/infra] New branch created: jb3/default\-nginx\-server
When a NGINX node is reached with no matching server block, we will redirect to a random site from a list we build. Contributions are accepted.
Please install this in the parent task.
[python-discord/infra] branch deleted: jb3/default\-nginx\-server
We don't have enough labels in this repository. More are needed. We cannot live without them.
[python-discord/sir-robin] branch deleted: migrate/dpyv2
55a986e Migrate back to Discord.py V2 - D0rs4n
21e71f6 Merge pull request #20 from python-discord/migr... - ToxicKidz
Connected!
[python-discord/infra] branch deleted: jb3/auditbeat
Is there an "approved" label? Not sure if it's needed in this repo but I thought I'd bring it up just in case.
@Xithrius :spray_bottle:
There are plenty of labels for what we do in this repo. Also, make the DevOps one consistent with the others -_-
Hi, everyone.
Provided below is a gif of the progress thus far.
Note that I thought it may be helpful to write a simple method to scrape the Topics from https://www.pythondiscord.com/resources/ to make the !resources command a little more informative for the user. What do you think about this?
Also, what are your thoughts on building out the command in such a way that accomm...
GitHub Actions run 1992689209 succeeded.
GitHub Actions run 1994442712 succeeded.
Sure thing, will be done next week ๐
https://www.django-rest-framework.org/api-guide/routers/#simplerouter suggests that POST isn't supported with a lookup path POST /bot/bumped-threads/<thread_id:int> only PUT or PATCH would be.
However, query params would work. I'm not sure how much better this is over just using request body though since it would be adding ?thread_id=int to the url instead of adding {thread_id: int} to the request body
Never mind then. In practice, it doesn't matter since for aiohttp a dictionary needs to be passed either way.
Force push was to rebase onto main. Only conflict was in the migration, so I updated it to depend on the latest in main.
GitHub Actions run 1995339832 failed.
Ah, this commit will require tests since I added a custom retrieve, will fix
GitHub Actions run 1995634417 failed.
GitHub Actions run 1995654447 succeeded.
9a0e032 fixup: Don't use become: true as that's default - ChrisLovering
I've removed daemon_reload in this commit https://github.com/python-
discord/infra/pull/58/commits/9a0e0321b55fd3ef323de7dfffeea3734c14bde1
I don't quite understand your suggestion though volcyy, are you saying to add a new roll that just does the daemon_reload and the add that as a dependency in the meta of this role?
Hi, everyone.
This pull request is in reference to approved issue #2079.
Please note, I successfully ran poetry run task precommit and poetry run task lint prior to submitting this pull request.
Demonstration of new resources command:
Notes:
- Edge cases like
!resources data science @iamericfletcherlink the user to the resources page without any filterin...
GitHub Actions run 1996048391 failed.
GitHub Actions run 1996122972 succeeded.
Why not just have a resource API on the site which powers this command?
This PR accounts for some adjustments for lunar events of 2022.
- Holi is bumped up approximately a week to March 18.
- St Patrick's Day event is shortened by 1 day as a result.
- Diwali is bumped up approximately 2 weeks to October 19.
- Halloween event is shortened to 1 week as a result.
These days can be adjusted again next year because according to Google, Holi 2023 will be in early March and Diwali 2023 will be in November again.
GitHub Actions run 1999090073 succeeded.
The day on which Holi falls changes from year to year based on the local calendar and hence the date needs to be updated.
GitHub Actions run 1999158195 succeeded.
55a986e Migrate back to Discord.py V2 - D0rs4n
21e71f6 Merge pull request #20 from python-discord/migr... - ToxicKidz
089cf80 Merge branch 'main' of https://github.com/pytho... - ToxicKidz
Hey, i'd like to try and implement this
i closed this by mistake but i'd like to be assigned to this issue if noone else is already working on adding redux :)
I've made a banner and icon for pyweek 33. The banner dimensions are 4001/2251px which should be 16:9. The icon is 1825/1825px. Unfortunately due to incompatibility of some of the appearances in illustrator with the svg format, the banner svg file is missing the drop shadow effect along with some minor inaccuracies compared to the png files.
Assets added:
- icon.svg
- icon.png
- banner.png
- banner.svg
- banner_link.png (includes a link to pyweek.org in the corner)
- middle_bann...
GitHub Actions run 1999492833 succeeded.
Connected!
I think your original intention was to only test the custom serialisers, but it seems like you're testing other methods as well. If you were trying to test everything, then you have not covered all methods.
Please avoid using "we", "us", "I", etc. in documentation.
Only the thread_id field is useful, hence it is unnecessary to create a nested dictionary.
The two places that use this URL duplicate the trailing slash here, resulting in a link in Discord such as https://paste.pythondiscord.com//{code}?noredirect
This will raise a discord.ext.commands.errors.MissingAnyRole if the invoker doesn't have this command.
We should catch this, so that it doesn't result in a stack trace in the bot.
Either with a cog-specific error handler, or a generic error handler cog.
Some of the commands in this cog have required arguments, which result in discord.ext.commands.errors.MissingRequiredArgument being raised if they are given. This should be handled either with a cog-specific error handler, or a generic error handler cog.
await ctx.reply("\u2705 Changes may take up to 10 minutes to take effect due to rate-limits.")
await ctx.channel.edit(name=name)
Having them embed say it was successful in the title, and then say it make take 10 minutes in the description seemed odd.
This makes it clear to new mods why it would take 10 minutes, and also removes the need to add the reaction afterwards too.
Connected!
Is it typical to import/use both datetime and arrow? Why not just one?
I can't comment much on the code, but I can say it does work as expected in testing. Maybe @VirdanTheBurden can take another look since new code has been pushed since your last review.
Imperative mood rather than passive voice is more consistent.
If the condition fails, send a warning to the invoking context.
I think it's because the duration converter returns a datetime and Arrow does not subclass it.
I'm not sure why the type is being checked though, especially since it's silently ignored. The converter always returns a datetime, and this decorator is only intended to be used with that type. Thus, if the type doesn't match then it's a programmer error that should not just be ignored.
One could argue that the type check can still be used to raise a clearer error message but I argue that i...
How about ensure_future_duration as the name? It's slightly shorter.
I also humbly suggest to make this more generic (currently the name and error message tie it too close to infractions). The name could then be ensure_future_timestamp.
The failure isn't very silent

I suppose I could check whether it's not one of None and str instead of whether it's a datetime
Oh, right cause you call the original function and it picks up the error.
How about isinstance(duration, (datetime, Arrow)) for future proofing
I suppose I could check whether it's not one of None and str instead of whether it's a datetime
How about
try:
if (target < arrow.utcnow()):
...
except TypeError:
func(...)
Actually this would be a bit better since it's a narrower scope for the caught exception
try:
is_future = target > arrow.utcnow())
except TypeError:
func(...)
else:
if not is_future:
await ctx.send("!!!!")
GitHub Actions run 2002421959 succeeded.
You forgot superstarify but otherwise it looks good and works according to my tests.
GitHub Actions run 2002642506 succeeded.
5f48d63 disallow editing infraction durations into the ... - ShakyaMajumdar
fbd0721 remove redundant tzinfo check - ShakyaMajumdar
22ad252 migrate management.py to arrow - ShakyaMajumdar
69bcab1 disallow setting infraction durations into the ... - ShakyaMajumdar
ecf97bb Merge remote-tracking branch 'upstream/main' in... - ShakyaMajumdar
GitHub Actions run 2002671480 succeeded.
Connected!
GitHub Actions run 2002686051 succeeded.
Will do, Chris. I'd like to keep the reaction though. It will be added only after the channel name has been changed.
Can you link issues with the scenarios that you "may" want to implement where this is needed? On it's own this issue doesn't communicate any motivation or reasoning.
On it's own this issue doesn't communicate any motivation or reasoning.
@gitautas the main reasoning is cited, "re-render a page/component but keep track of prior state/entries". We want to keep track of the state of the form when the user closes the page.
The issue does lack a bit the full goal which is to persist (probably in localStorage) the state of all partially completed forms and restore on form open, which will ensure that progress is not lost should a form be open/closed/etc.
GitHub Actions run 2004894186 succeeded.
I think your original intention was to only test the custom serialisers, but it seems like you're testing other methods as well. If you were trying to test everything, then you have not covered all methods.
I'm not sure I follow, I tested unauthed requests for each endpoint. Then I also have a test for all the custom stuff I added, the list serializer and the custom retrieve method I added.
GitHub Actions run 2004894162 succeeded.
I think your original intention was to only test the custom serialisers, but it seems like you're testing other methods as well. If you were trying to test everything, then you have not covered all methods.
I'm not sure I follow, I tested unauthed requests for each endpoint. Then I also have a test for all the custom stuff I added, the list serializer and the custom retrieve method I added.
There is no authenticated test for POST (create).
Add custom help command page for Discord bot migration project
This PR adds a page to the website with the content from [this pin](#discord-bots message) from #discord-bots.
GitHub Actions run 2006010624 succeeded.
Thank you for the PR!
We should add YAML frontmatter and I don't think we should use markdown headers for the text. As for frontmatter, see this PR for an example. How about we start with something like this:
---
title: Custom Help Command
description: "Overwrite discord.py's help command to implement custom functionality"
---
First, a [basic walkthrough](https://gist.github.com/InterStella0/b78488fb28cadf279df...
Mark, I place my trust in you putting this into master, so I assigned you.
GitHub Actions run 2006417635 succeeded.
This will not contain all user_ids from watched_iter because members that could not be found will be removed in the line above (... for member in members if member is not None). This means that the lines below will fail with a TypeErro/AttributeError if I understand things correctly.
We need to handle member being None here.
I think your original intention was to only test the custom serialisers, but it seems like you're testing other methods as well. If you were trying to test everything, then you have not covered all methods.
I'm not sure I follow, I tested unauthed requests for each endpoint. Then I also have a test for all the custom stuff I added, the list serializer and the custom retrieve method I added.
There is no authenticated test for POST (create).
Yea, I didn't bother...
Great job on your first pull request! Thanks โค๏ธ.
Please look at the comments I made and to be clear, nothing here is an order and it's simply my ideas noted down so it's open for discussion if you do not agree with it.
Please see my other comments before spending too much time with this.
requests will be blocking the bot from doing other things. Take a look at HTTPX which we use.
Create another function, that's defined as async def to be able to await when using httpx's AsyncClient. Now, make the request and define a content variable set to the content of the request (similar to how you currently do page.content). Then, change get_topics() to tak...
Great work with this, but I agree with the comment made by @Shivansh-007 in the original issue that site should get an API such that we do not need to do this scraping.
I think for now, considering what you may be down to do, we can remove this and open another issue to improve it later once the site has received this new API. What do you think?
"""Display information about the Python Discord website Resource page."""
I think it would be better, if we moved this logic to the main coroutine, like this:
https://gist.github.com/Rapptz/6706e1c8f23ac27c98cee4dd985c8120#interaction-with-aiohttp
httpx is not used. aiohttp is.
Yeah, there are a lot of things that can be redone in a better way by leveraging the new features. I think in the long-term, it'd be better to come up with a base class in bot-core. Thus, I'm indifferent on whether this copied code is updated or left alone until bot-core changes come around.
Ah sorry, yes that was false. Both forms and pixels does though which seems to have left a mark on me ๐ .
Everything else looks good to me. Just gotta change the links to hyperlinks.
The URLs aren't hyperlinked. Let's get them to do that. Removing backslashes to keep the formatting consistent with other guides.
To change them:
* [https://www.scaleway.com](https://www.scaleway.com)
* Based in Europe.
* [https://www.digitalocean.com](https://www.digitalocean.com)
* US-based.
* Considered by many to be the gold standard.
* Locations available across the world.
* [https://www.ovh.co.uk](https://www.ovh.co.uk)
* France and Canadian...
Hey Robin, we'd drafted a different message to pin re: VPS services in an internal channel some time back (January 15th).
<img width="309" alt="image" src="https://user-images.githubusercontent.com/37447267/159114288-6d87b20c-3918-4794-a07e-94a8f4cd8503.png">
([message link](#organisation message) (staff-only channel))
IMO this PR should reflect the newly drafted message because the re-wording of the descriptions of some of th...
Hey Robin, we'd drafted a different message to pin re: VPS services in an internal channel some time back (January 15th).
([message link](#organisation message) (staff-only channel))
IMO this PR should reflect the newly drafted message because the re-wording of the descriptions of some of the VPSes is intentional and it includes https://www.netcup.eu/ .
GitHub Actions run 2008723256 succeeded.
It seems to me that this should just be a utility function imported from another module. It's a general purpose function to format a bot message (despite its specific name), and it could easily be made a static method, as the only usage of self is to get the bot instance, which can be imported or sent as an argument.
This is what we do with helper functions which are used in multiple modules, seems appropriate here as well.
[python-discord/bot] New branch created: bump\-d\.py\-version
This PR is just for reference & group debugging, this is not ready for review.
GitHub Actions run 2009246254 failed.
Okay I guess this is ready. I will test this tomorrow as a sanity check and then it's good to go.
Why is this making a possible ton of api requests? Additionally, gathering won't speed this up due to the library's implementation of ratelimit handling, internally each request is made sequentially.
There's a few ways to fetch a bunch of members but this does not seem like the most optimal way.
Consider using https://docs.disnake.dev/en/latest/api.html#disnake.Guild.query_members in order to request multiple members at once. This can fetch upto 100 users at once, which means using https://docs.disnake.dev/en/latest/api.html#disnake.utils.as_chunks in order to have lists of up to 100 users
While these links go to disnake they are the same in dpy
Because there is a large majority of users who are not in the bot cache (since they're off-guild) so we need to fetch their user.
Does you suggestion of using Guild.query_members fetch users that aren't in the guild?
This is already handled further down.
Sure... I am excited to help build the API. I've never done that before, nor do I really know what it would provide, but I'm totally down to help out. Without looking into it, I assume it means that there would be some sort of interface provided to extract the information in an easier way?
Although I still haven't figured out why the Form id field aliasing does not work on my machine, after 27b0c38694f6bdd557c58a6bd6c49e5c95d5cfa5 it is no longer a blocker.
Namespacing discord roles with role: (or even discord:) suggested by @Bluenix2 could improve the robustness of the starlette permission handling, but it also isn't a blocker for merging this PR.
8d934cc Bump pyjwt from 2.0.1 to 2.3.0 - dependabot[bot]
b411aee Merge pull request #111 from python-discord/dep... - HassanAbouelela
434c70d Bump python-dotenv from 0.17.0 to 0.19.2 - dependabot[bot]
fe2a5ec Merge pull request #115 from python-discord/dep... - HassanAbouelela
e50e111 Bump pydantic from 1.8.1 to 1.9.0 - dependabot[bot]
GitHub Actions run 2013067267 succeeded.
[python-discord/forms-backend] branch deleted: roles
3e786da Add Helper Functions For Managing Roles - HassanAbouelela
134b2f7 Overhaul Scope System - HassanAbouelela
513de69 Add Role Based Authorized Readers - HassanAbouelela
7ae2d87 Add Role Based Editors To Forms - HassanAbouelela
1f516d6 Add Docs For Editors & Response Readers Props - HassanAbouelela
GitHub Actions run 2013071666 succeeded.
[python-discord/site] branch deleted: thread\-dumping\-support
30b7b42 Move FilterList imports down so they're sorted - ChrisLovering
0aed5f7 Add support for BumpedThreads to be stored in site - ChrisLovering
3e95570 Only return list of ints when retrieving all Bu... - ChrisLovering
a018061 Don't return the BumpedThread object when retri... - ChrisLovering
cb52e60 Add tests for custom BumpedThread impl - ChrisLovering
GitHub Actions run 2013176440 succeeded.
Why not create all of this in the base class?
Not an extensive review but it's a start.
Is this still necessary if bot core is being used? Also, I don't think you ever updated the extensions util to use bot core (I don't see that file modified in the diff).
Even though I came up with this, I was never really happy with it. I think it'd make more sense to just do this stuff in __init__ while still allowing the args to be overwritten when instantiating the bot.
The redis session can be created outside and passed in as an arg.
Resolves #685 and #483
Done
-
Added a walk-through to main contributing landing page with links to various guides and some text to motivate the step.
- Moved the section on the Contributors role to the roles page.
-
Got rid of the old Supplemental Information page and split it's sections into more appropriate locations.
- Linting, Logging, and Writing Good Commit Messages each got their own page. The commit messages page is under Contributing Guidelines, the others are in t...
Thank you for the PR! I really appreciate it! I just have a few pieces of feedback.
* Get the command cooldown - `command_object._buckets._cooldown.per`
The trailing period may be misleading.
This language might be a bit confusing to readers, "You can handle when there is no command" is trying to explain if no command is passed in and just the bare help command, however the language itself seems to be describing something else.
You can handle when there is no command passed into the help command and make a fancy embed; a page that describes the bot and shows a list of commands is usually ideal here, however if a command is passed in, you can get display detailed ...
We won't need the # Custom Help Command, as it's already in the title, so it'll repeat as seen below:

What do you mean off-guild? Does this mean they are no longer a member in the server?
GitHub Actions run 2013756870 succeeded.
To get used to how site works (I somehow still haven't done so), I'd like to participate in this issue.
Doc item doc_item.symbol_id='disnake.PartyType.awkword' present in loaded documentation inventories not found on site, inventories may need to be refreshed.
[python-discord/site] New branch created: json\-is\-not\-good\-database
4762070 Json is not a database, at all - Xithrius
It won't do you well.
Finishes off one of the check marks for #691.
GitHub Actions run 2015027245 succeeded.
Thanks for the feedback, will get to working on it asap.
[python-discord/site] New branch created: keeping\-tokens\-safe
Migrates [this pin](#discord-bots message) by TizzySaurus.
GitHub Actions run 2019168382 failed.
GitHub Actions run 2019217317 failed.
GitHub Actions run 2021904560 succeeded.
Thank you for the reviews, I have adjusted the code based on your feedback so I believe everything should be good now.
This approach won't work.
Ideally this would be fixed by the paginator lazy loading the information.
Added the hyperlinks like Xithrius said, and also updated the content of the file to reflect [this](#organisation message) (internal channel) message like Vivek mentioned.
3ff628a Add UniqueConstraint to the Filter model - D0rs4n
GitHub Actions run 2023887092 failed.
GitHub Actions run 2024405209 succeeded.
You can put all of this in the same line:
# Extract a possible topic from the first line
resource_topic = resource_topic.splitlines()[0].lower().replace(" ", "-")
You should add from urllib.parse import quote above and do:
f"[Resources page](https://www.pythondiscord.com/resources/?topics={quote(resource_topic)}) "
Maybe construct the link in a variable before creating the embed so that you don't come so close to the line-limit?
Note that this more-or-less will always be True because of the if-statement you have above.
The only time it won't be True is when resource_topic is only 1 character.
I think you could remove this if-statement really.
This image will need to be updated to show the new layout.
The copy option is only available once you regenerate the token. On login, said copy button is not available.
- Press the Regenerate option to regen your bot token.
It may be best for us to use a different website than this one, due to the website's creator no longer being a part of this org.
Along with that, the we should probably wrap .env in a minature code block, shown below.
To help prevent leaking your token, you should ensure that you don't upload it to an open source program/website, such as replit and github, as they show your code publicly. The best practice for storing tokens is generally utilising `.env` files to export...
title: VPS Services
description: On different VPS services
First, a [basic walkthrough](https://gist.github.com/InterStella0/b78488fb28cadf279dfd3164b9f0cf96) by Stella#2000 on subclassing the HelpCommand will provide some foundational knowledge required before attempting a more customizable help command.
@hedyhli Greetings. What's the status of this PR? Thanks!
I don't know why I removed all the tags before, lol
Whoops, didn't mean to request another review from you, @Bluenix2. Sorry about that.
@ToxicKidz When you have the time, please resolve the file conflicts within this PR. Thanks!
@Bluenix2 Would you perhaps like to take over this PR?
@Xithrius I believe there was an approved issue, it's just not linked properly. #1001.
@Krish-bhardwaj Will you be resolving the reviews in this pull request?
GitHub Actions run 2025872327 succeeded.
GitHub Actions run 2026434979 succeeded.
GitHub Actions run 2026546427 succeeded.
I believe this has been resolved with https://github.com/python-discord/sir-lancebot/pull/778, closing.
This was not fixed with #778. https://github.com/python-discord/sir-lancebot/blob/657aaf5f613b0bd219d67c71f7dc37ede0bb6aab/bot/exts/utilities/githubinfo.py#L129-L130
Add detailed article on subclassing bot
GitHub Actions run 2026781355 succeeded.
It seems I have accidentally added the subclassing HelpCommand markdown file in this PR as well, but I intended to only make a PR on subclassing Bot because I've already made a PR about subclassing the HelpCommand so please ignore that
If you need to run your bot 24/7 (with no downtime), you should consider using a virtual private server (VPS). This is a list of VPS services that are sufficient for running Discord bots.
The bullet points here are a bit redundant. Perhaps remove them and just have a single sentence at the top saying they all have global options?
Yeah good idea. Or just leave them out entirely, since being under the "global" bullet point indicates that they have global data center options anyway. Will work on that, thanks for the feedback ๐
I don't think we should encourage this as there are better ways to initialize a database connection
GitHub Actions run 2029774171 succeeded.
Connected!
GitHub Actions run 2030832190 succeeded.
Tried to name them better according to some color name finders.
I don't know the stance for that one, would love to know how to proceed.
GitHub Actions run 2030888601 succeeded.
[python-discord/bot-core] New branch created: bump\-d\.py\-and\-add\-BotBase
This bumps d.py up to a more recent commit, that includes the changes to make cog.ext loading async. See here for more reading https://gist.github.com/Rapptz/6706e1c8f23ac27c98cee4dd985c8120.
This also adds a BotBase class, which is intended to be used by all our bots. This base class implements a lot of our "boiler plate" code, such as stats, root aliases and wait_until_guild_available to name a few.
Since the extensions util is only used on bot startup, to load extensions, I have remo...
This is needed since async_rediscache does not have an objects.inv file available for autodocs
The custom objects.inv file is needed here since statsd's objects.inv file only references the aliased statsd.StatsClientBase, and does not have a reference to the "real" object at statsd.base.StatsClientBase, so intersphinx complains.
I've been request for review but I do not think all my previous comments have been addressed.
You forgot to update the return type annotation for the function.
The "extensions" extension still needs a frozenset of this. It can't use bot.extensions since that contains currently loaded extensions rather than all available extensions. Not sure if it's better to expose it as a constant, as was done before, or if it should be stored as an instance attribute of BotBase.
Aren't these redundant? Just rely on passing them via *args or **kwargs.
Never mind. It's because it unloads extensions, which would modify what was being iterated if a copy was not made.
Yea, good point. I'm tempted to leave allowed_roles in there though, to ensure it's required to be used.
I'll add a comment to make it clear what it's doing.
[bot-core] Branch bump\-d\.py\-and\-add\-BotBase was force-pushed to `a904fcb`
Force push was to add co-authors
Changed back to frozenset in https://github.com/python-discord/bot-core/pull/42/commits/b8a245061689c45ebee05f27481837576a079e54 following a comment below
I've attempted to do this here https://github.com/python-discord/bot-core/pull/42/commits/a904fcb76d97af7076755e3c6f0e29f2b5d7642e. This is my first time doing something like this so would appreciate feedback on whether there is a better way.
I've been requested for review, but I do not think all my previous comments have been addressed.
You're right, this isn't quite ready for review just yet. It's on my list for after the d.py bump in bot-core and bot.
[python-discord/modmail-plugins] branch deleted: channel\-tagging\-improvement
cdc9922 add cooldown to tag command - vivekashok1221
4dc7307 make tag arg keyword-only - vivekashok1221
d17d2ab replace command cooldown with receipt message - vivekashok1221
db6b4bf send plain message instead of embed - vivekashok1221
978af6f Merge pull request #23 from python-discord/chan... - ChrisLovering
GitHub Actions run 2033370446 succeeded.
GitHub Actions run 2033446388 succeeded.
GitHub Actions run 2033646463 succeeded.
GitHub Actions run 2033647609 succeeded.
GitHub Actions run 2033653018 succeeded.
Any ideas for how to document this attribute (and possibly other attributes)?
I think the only thing worth exporting from this module is AsyncStatsClient. If you want to export the whole module then you should add an __all__ to it.
It's typical for an abstract method to raise NotImplementedError. However, I realise this function does get called by BotBase. It doesn't seem strictly required for this to be implemented. Thus, I do not think it is appropriate for this to be labelled as an abstract function, especially given that BotBase isn't even an abstact class.
It would be nicer to make AsyncStatsClient MISSING but I'm not sure of a nice way to do that.
I think the approach is okay. I did have some minor concerns, but I am not sure of a better way.
The image at the bottom of the page https://www.pythondiscord.com/events/code-jams/7/ is broken.
When working on improving the code here, you seem to have removed the newlines again!
Can you add some to group the lines together and not make it so cramped?
Oh dear... I'm sorry for waisting your time with such mistakes!
GitHub Actions run 2037540687 succeeded.
Description
How Long To Beat is a page where you can find how much time a game takes to be beaten on average.
Reasoning
It's a good and convinient tool for people interested in gaming.
Proposed Implementation
- Make a request to hltb search page.
- Scrap the game id. bs4? (might change if smt better is found)
- Make another request to the page with the obtained id,
- Obtain from the previous request the completions times.
- Genera...
This migrates the tag, so I'm approving.
That said, I do think the content is a bit weird, since the second paragraph makes the following points:
- "No redundancy built into JSON"
- "No built in ways to keep it safe and backed up"
- "No built in encryption", with some inclusion of GDPR
This, to me, sounds like standard databases offer any of that, out of the box. Unfortunately there's no magic setting or function in PostgreSQL where I can go SELECT spin_up_slaves(3), `SELECT per...
[python-discord/site] New branch created: fix\-image\-link
GitHub Actions run 2039180108 succeeded.
I think it's probably better for us to link the official Python docs here (and also trim the whitespace):
First, the [documentation on inheritance](https://docs.python.org/3/tutorial/classes.html#inheritance) on subclassing will provide some fundamental knowledge, which is highly suggested before moving on to this topic, as subclassing [Context](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Context) can ultimately be a complicated task...
Subclassing Context can be very beneficial as it allows you to set custom Context methods that can be used in your code. Some applications and examples are provided below.
Where will this link go?
GitHub Actions run 2039328070 succeeded.
GitHub Actions run 2039329416 succeeded.
GitHub Actions run 2039331487 succeeded.
GitHub Actions run 2039337927 failed.
I put a comment of key word arguments there in the init with the intention of increasing the need to go over the subclassing_bot article to understand how to subclass bot. If I were to add the key word arguments, in my opinion people are more likely to just copy paste without fully understanding (in line 12, I wanted to link the subclassing_bot file). But if this isn't a good reasoning I can change it.
GitHub Actions run 2039519219 failed.
This looks great to me, thanks for the PR! I have one small comment regarding headers if you'd like to implement that, but overall this looks great. Thanks once again!
Perhaps make this a header rather than free text, so it shows what the next section is about and you can bookmark it?
# Free hosts
GitHub Actions run 2041522406 succeeded.
GitHub Actions run 2042258684 succeeded.
Hi Xithrius! Unfortunately I've been pretty busy with school lately. I'd love to continue working on it though but I can't guarantee when I'll have time for it, hopefully before the end of April by the latest.
GitHub Actions run 2042921866 succeeded.
[python-discord/bot] Pull request review submitted: #2111 Remove modlog ignore for voice verifcation
Changing my position to block this PR until we also remove the modlog ignore for invocations of !voiceverify
My justification is that when users contact the moderation team claiming they meet the requirements but still aren't able to pass voice gate, the first thing a moderator thinks to check is the message logs to see if they've correctly attempted the comma...
Changing my position to block this PR until we also remove the modlog ignore for invocations of !voiceverify
My justification is that when users contact the moderation team claiming they meet the requirements but still aren't able to pass voice gate, the first thing a moderator thinks to check is the message logs to see if they've correctly attempted the...
[python-discord/bot] Pull request review submitted: #2111 Remove modlog ignore for voice verifcation
So long as #2076 is not closed, then this is fine
c2d6e6f Remove mod_log.ignore of invocations of the voi... - minalike
[python-discord/bot] New branch created: log\-voiceverify\-messages
GitHub Actions run 2044940925 succeeded.
i would like to implement this when this is approved.
GitHub Actions run 2046442113 succeeded.
GitHub Actions run 2046643144 succeeded.
[python-discord/site] Pull request review submitted: #699 Contrib walk\-through and improving guides
Thanks for all your work on this so far. It looks really good and in my opinion is already a big improvement to the current state of our docs, so much so that I'd be happy to merge this as is and have all the subsequent work you've outlined be done in separate PRs.
d33ad58 Patch Sir Robin to use a task to load in extens... - D0rs4n
[python-discord/sir-robin] New branch created: pr/extloadtask
Just a tiny PR to make extension loading compatible with Cogs that call wait_until.. by themselves.
I blindly copied this from bot and it isn't actually used by anything anymore. I'm tempted to remove it entirely.
It seems like it should be possible by using Attributes in the class/init docstring, adding a docstring after the attr, or using #: on the line before it.
However all of these methods result in the follow error when building the docs Handler <function doctree_read at 0x0000026AE96A80D0> for event 'doctree-read' threw an exception (exception: type object 'BotBase' has no attribute 'all_extensions') I've spent about an hour googling around trying to figure out why this happens but ha...
Possibly after the definition we check if statsd is loaded, if not we redefine it as MISSING?
I think exported the module with an __all__ is better here, otherwise the documentation loses the namespace and gets put directly under botcore. If we start doing that a lot it'll get quite busy.
Will do the same for the comment below
Yeah, that sounds good. It's nice to be able to consistently check using x is Missing rather than worrying about whether isinstance has to be used sometimes.
Thank you so much for your PR! I really appreciate it. I just have a few comments, mostly regarding the style used in the code examples, so apologies in advance for the nitpicky comments haha
see comment above
def __init__(self, *args, **kwargs): # the key-word arguments are not specified here, unlike the example above
consistency with other comments
# other kwargs can be put here
see comment above
# as shown in this example below
Please document somewhere that redis and statsd are optional as well as how to check if something is missing. A stray thought is whether an import error should be raised if imports are attempted (except from within botcore).
This can be addressed later if there are concerns of holding up this PR.
Only thing I can remember using it was the redis cog. I don't quite remember what the problem even was at this point, but there are comments on the PR that have info.
Doing a naive git log --grep closing_tasks I found these two:
- https://github.com/python-discord/bot/commit/429cc865309242f0cf37147f9c3f05036972eb8c - Reddit cog to revoke the access token on unload, which has since been moved to lance (without this feature).
- https://github.com/python-discord/bot/commit/f4004d814c1babfb5906afb8cd9944ceef90a2a3 - Silence cog, which has been removed since.
Looks very good, yes, quite. Getting my name on this PR Well done.
[python-discord/site] branch deleted: fix\-image\-link
GitHub Actions run 2048749793 succeeded.
a7562e7 Remove resource suggestion template from site - minalike
[python-discord/site] New branch created: remove\-resource\-suggestion\-template
We will keep the resource suggestion issue template currently present on meta:
https://github.com/python-discord/meta/blob/main/.github/ISSUE_TEMPLATE/resource-request.yaml
GitHub Actions run 2048757612 succeeded.
GitHub Actions run 2050307875 succeeded.
GitHub Actions run 2050308434 succeeded.
GitHub Actions run 2050308407 succeeded.
GitHub Actions run 2050309086 succeeded.
GitHub Actions run 2050309394 succeeded.
GitHub Actions run 2050309877 succeeded.
GitHub Actions run 2050310341 succeeded.
GitHub Actions run 2050312192 succeeded.
GitHub Actions run 2050314676 succeeded.
GitHub Actions run 2050318915 succeeded.
Nice, we will certainly need this functionality as the bot grows, and this will be a more robust solution.
@Bluenix2 - could you open the issue for creating an API to handle the scraping? It would be really exciting to have your guidance as I work through my first experience with APIs.
Connected!
GitHub Actions run 2059328525 succeeded.
I would like to see the message time stamp in the body of the embed below the message ID, and using a Discord timestamp
Message timestamp: March 29, 2022 11:00AM
close issue #2120.
[this issue have been approved by a core dev but since they can't add the approve label, they said on discord that feel free to treat it as approved. click me for more info.](#dev-contrib message)
i would like to implement this when this is approved.
As mentioned here, swapping from this usage of discord.errors namespace to exact imports would keep the consistency of how the discord package is used across this file.
f1894e5 Remove unnecessary config constant - MarkKoz
af3c145 Add util function to send an infraction using a... - MarkKoz
780074f Add command to resend infraction embed - MarkKoz
fa797ce Fix superstarify reason displaying the incorrec... - MarkKoz
44451dc Disallow resending hidden infractions - MarkKoz
GitHub Actions run 2064692145 failed.
[python-discord/bot] Pull request review submitted: #2111 Remove modlog ignore for voice verifcation
as per the gh actions you should remove event import
[bot] Branch log\-voice\-role\-assignments was force-pushed to `bdd26fe`
[python-discord/bot] branch deleted: log\-voice\-role\-assignments
GitHub Actions run 2064711177 succeeded.
Connected!
GitHub Actions run 2064737661 succeeded.
[python-discord/forms-backend] Checks Failed on PR: #156 Bump flake8-annotations from 2.7.0 to 2.8.0
GitHub Actions run 2067413647 failed.
Thank you for this, I tried it out and it's working as expected! Very nice work here.
I do have one comment that would allow us to simplify the code.
We can actually simplify this and repeat less code:
resource_url = "https://www.pythondiscord.com/resources/"
if resource_topic:
# Capture everything prior to the new line allowing users to add messages below the command then prep for url
resource_topic = resource_topic.splitlines()[0].lower().replace(" ", "-")
resource_url = f"{resource_url}?topics={quote(resource_topic)}"
embed = Embed(
title="Reso...
Note that I think that resource_url could be changed to RESOURCE_URL and be a constant at the top, then we define the same variable in the function (url = RESOURCE_URL and then url = f"{url}?topics={...}")
GitHub Actions run 2067850359 succeeded.
e2ca8b2 add blurple formatter - ShakyaMajumdar
[python-discord/sir-robin] New branch created: feat/formatter
Oh hi my name is ๐ and I approve of these changes.
[python-discord/sir-robin] branch deleted: pr/extloadtask
Connected!
With the recent implementation of PEP 676 the canonical URL for PEPs has changed from, for example:
https://www.python.org/dev/peps/pep-0008/
to:
https://peps.python.org/pep-0008/
Redirects are in place so the old links still work, but let's update to use the new canonical form.
See also:
GitHub Actions run 2070223396 succeeded.
[python-discord/sir-robin] New branch created: feat/pep\-command
Port the pep command from python-discord/bot, original source
With this, I have added an aiohttp client session to the bot instance. this can be used in future cogs/exts too.
Additionally, I implemented it as bare-bones as possible for review speed. In the actual python-discord/bot we are creating a resolver and connector, this would req...
This all looks very sense, which makes sense since the exact same code has already passed code review on our other bot.
I don't see the connector thing creating any kind of critical problem for this, either.
Since you've already tested it and provided proof of successful tests, and since we're under some time pressure, I'm happy to approve.
Connected!
close as #dev-contrib.