#dev-log
1 messages ยท Page 1 of 1 (latest)
ce8e838 Add cj add command and add_flow to the CJ e... - D0rs4n
e38d433 Update move flow to add user to the database if... - D0rs4n
0a4b9f3 Prevent adding team leader role to members if s... - D0rs4n
9bed4c5 Adjust the comment wording in the CJ extension - D0rs4n
e1a3856 Make is_leader an optional parameter in cj add - D0rs4n
[python-discord/sir-robin] branch deleted: add\-cj\-add
Connected!
The current code jam events page does not have the theme of code jam 9 listed yet, as shown here: 
I could fix this really quickly, as it's just a small change.
[python-discord/site] branch deleted: clarify\-websocketrule
0ed9322 Clarify WebSocket restriction rule's impact on ... - Bluenix2
1d0b576 Remove unnecessary "also" in new exception to c... - Bluenix2
b1d9468 Strike out beginning of code jam date - Bluenix2
fadda91 Update codejams sidebar about cj9 theme announc... - Bluenix2
1e7756c Merge pull request #748 from python-discord/cla... - ChrisLovering
Closes #749
Sorry, I didn't know this was already being done ๐
GitHub Actions run 2720614883 succeeded.
cd5d5cf Relax rule about usage of non-WebSocket communi... - Bluenix2
[python-discord/site] New branch created: relax\-websocket\-rule
As discussed internally, and later announced in #code-jam-announcements, this PR updates the wording of the rule to reflect how strict it is now enforced.
GitHub Actions run 2721528688 succeeded.
For example, serving static files for a website cannot be done over WebSockets and it does not pose as a significant portion of a project, so it is allowed.
Just to make it crystal clear
Seem to be a few words that shouldn't be there :P
<p>If you're unsure about your use of non-WebSocket communication, please reach out to the events team.</p>
Having it as a statement feels a little strange, but then again I wouldn't want people to hesitate to get in touch so I'd also be fine with your wording but fixed.
<p>This rule does not apply to databases and files when used for <i>storage purposes</i> even though that may be a significant portion of your project. Working with subprocesses (through stdin/stdout or <code>multiprocessing.Pool()</code>/<code>concurrent.futures.ProcessPoolExecutor()</code>) is also exempt from this rule.</p>
GitHub Actions run 2721915209 succeeded.
I see now, I must have stared at this for so long that it didn't occur to me.
bf753d1 Rework sentence urging reaching out to the even... - Bluenix2
0a46210 Be explicit about example in rule being an allo... - Bluenix2
Have tested and everything works as expected:

As such, this is now ready for review :smile:
Have confirmed that the new !modpings off command message works as intended:

This PR is now ready for review :smile:
GitHub Actions run 2722936947 succeeded.
This has now been tested and it works :+1:
Sample code usage:

Result of said sample:

This is now ready for review :smile:
c20c19c Add a generic view and button - ChrisLovering
9c0e5a6 Merge pull request #103 from python-discord/add... - HassanAbouelela
f99b395 Fix interactions.DeleteMessageButton not workin... - ChrisLovering
c448b69 Merge pull request #104 from python-discord/fix... - ChrisLovering
603fc83 Add an optional message attr to ViewWithUserAnd... - ChrisLovering
Please include a description for the paramaters and return in the docstring. If you aren't familiar, refer to the readme section on writing docstrings
Should we return None here? If we throw an error, it saves having to include validation logic in the caller. If the caller wants to do non-standard behavior, they can catch the exception.
[python-discord/bot-core] New branch created: better\-development
This PR works on the developer experience for bot-core by adding better infrastructure and boilerplate to help developers test out their changes. This is achieved by adding prominent documentation which explains how to test features in sample and real projects, adding a sample project which contains all the boilerplate for rapid prototyping, and a fixed docker configuration which should work better for this project.
I also added aiodns as an explicit dependency. Our downstream projects alr...
The documentation was built successfully, and the sources all look correct on a quick glance. LGTM
7f8d2ab Merge PR #105: Correctly determine source modul... - Numerlor
65410a9 Add clean_text_or_reply util. - TizzySaurus
d1ec5b0 Add commands.py to init.py - TizzySaurus
fb682c3 Merge branch 'main' into bot-core-100 - TizzySaurus
85063ab Reformat docstring to use Google's style & rais... - TizzySaurus
4e43f3c Raise error when referenced message has no content - TizzySaurus
[python-discord/bot-core] branch deleted: bot\-core\-100
python-discord/bot-core#101 has just been merged so I'll be working on this soon:tm:
[python-discord/bot-core] New tag created: v7\.5\.0
7a5a524 Bump pep8-naming from 0.13.0 to 0.13.1 (#102) - dependabot[bot]
@dependabot rebase
Watch and learn Chris
1. Copy the :repo-file:`bot template folder <dev/bot>` to the root of the bot-core project.
- The path provided to install should be the root directory of this project on your machine.
Should we document these required env vars? Same goes for "TOKEN" below.
ALLOWED_ROLES & PREFIX could be documented too, even though optional.
69ae0b0 Document Sample Project Environment Variables - HassanAbouelela
6d7ffcc Mark aiodns As An Explicit Dependency - HassanAbouelela
afa46c4 Add Sample Project With Boilerplate - HassanAbouelela
16804aa Clean Up Docker Configuration - HassanAbouelela
0e0b893 Document Sample Project Environment Variables - HassanAbouelela
94c4b40 Merge pull request #107 from python-discord/bet... - HassanAbouelela
[python-discord/bot-core] branch deleted: better\-development
Reviewed and tested,
LGTM :star2: .
cd5d5cf Relax rule about usage of non-WebSocket communi... - Bluenix2
a796945 Fix past-tense "exempt" typo - Bluenix2
bf753d1 Rework sentence urging reaching out to the even... - Bluenix2
0a46210 Be explicit about example in rule being an allo... - Bluenix2
e60a684 Merge pull request #750 from python-discord/rel... - wookie184
[python-discord/site] branch deleted: relax\-websocket\-rule
c199668 Add Aliases for Tags Support (#2213) - janine9vn
7e6c80f Fix wrong var name in regex tag - mbaruh
e9c7d6e Merge pull request #2214 from python-discord/mb... - HassanAbouelela
15224b0 Add revival of code role to self-assignable - camcaswell
38b6fca Merge pull request #2215 from python-discord/re... - ChrisLovering
[python-discord/bot] branch deleted: fix\-bot\-2168
Connected!
GitHub Actions run 2724392525 succeeded.
[python-discord/bot-core] New branch created: py3\.10\-rediscache
[python-discord/bot-core] New tag created: v8\.0\.0\-beta\.1
This bumps Python up to 3.10 and async-rediscache up to 1.0.0-rc1.
The async-rediscache change is marked as breaking due to the underlying aioredis changes, so this will be version 8.
We should hold of on releasing v8.0.0 until a full release is cut for async-rediscache.
Would it be a good idea to dataclass/namedtuple for this run arg? Just so that we can know what to expect in the data, and maybe error at creation time if it's missing a field we expect?
From your testing it clearly works, the tests seem to cover quite a bit too.
Just have a question, that could be a nice to have/not needed, but shouldn't block this PR.
480603d Use new connected attr on RedisSession - ChrisLovering
[python-discord/bot-core] New tag created: v8\.0\.0\-beta\.2
[python-discord/bot] New branch created: py3\.10\-rediscache
This PR does the following things related to the PR description:
- Bumps the Python version up to 3.10, ensuring CI is updated too.
- Bumps the version of bot-core used to v8.0.0 and removes pinned dependencies that are now pinned within bot-core
- Fixes breaking changes from the aioredis bump in async...
GitHub Actions run 2725150159 succeeded.
GitHub Actions run 2725259549 succeeded.
GitHub Actions run 2725312640 failed.
GitHub Actions run 2725344059 succeeded.
[python-discord/bot] New review comment on pull request #2089: Feat: add ability to snooze reminders
Managed to figure it out with @D0rs4n's help. This has been added :+1:
GitHub Actions run 2725416818 succeeded.
[python-discord/bot] New review comment on pull request #2089: Feat: add ability to snooze reminders
It is decorated with the discord.ui.select decorator which converts it into a Select.
I think that sounds reasonable, though the class would be pretty bare bones because the documentation is too. I'd probably just include the fields we do use because it's also a very large model.
f6d7afc Remove flask-socketio from approved frameworks - Bluenix2
bb29def Move Starlite and Sanic above wsproto - Bluenix2
8d20f84 Add aiohttp to approved frameworks - Bluenix2
2d8520a Add rule about forced usage of WebSockets - Bluenix2
2d353e9 De-capitalize aiohttp in codejam frameworks - Bluenix2
GitHub Actions run 2726303702 succeeded.
GitHub Actions run 2726551430 succeeded.
GitHub Actions run 2726589221 succeeded.
GitHub Actions run 2726590908 succeeded.
Not sure how could we. "Working directory" is a widely used term not only in Docker, if people really need an explanation about it they can just google it. There's even a wikipedia page about it https://en.wikipedia.org/wiki/Working_directory
GitHub Actions run 2726688397 succeeded.
GitHub Actions run 2726700448 failed.
GitHub Actions run 2726704425 succeeded.
There's a pretty explicit statement
https://github.com/Exenifix/site/blob/main/pydis_site/apps/content/resources/guides/python-guides/docker-hosting-guide.md?plain=1#L195
I fixed most of the issues, thanks for the review
Please can we just change all our tags into animated gifs? Holy shit this is so cool. I wish I could approve this more than once. โ โ โ โ โ โ โ โ โ โ
[python-discord/bot] branch deleted: sid/feature/tags/print\-return
25675a1 feat(tags): add print-return tag - sid-maddy
b1313b6 style(tags/print-return): set the title prope... - sid-maddy
9ac1bda chore(tags/print-return): add the GIF to the repo - sid-maddy
41f6e4d fix(tags/print-return): use the raw GitHub URL ... - sid-maddy
4d68f4b Merge branch 'main' into sid/feature/tags/print... - ChrisLovering
Connected!
Currently running &cj note on a non-participant fails. We need to be able to both see existing code jam notes and add new ones to users who are not currently a participant (or even on the server).
We need this for adding a note after removing someone from a team, or when they leave the server, but also to see existing notes before the code jam starts.
Fixes python-discord/meta#189
GitHub Actions run 2731876187 succeeded.
Hey I'll reassign this issue to Tizzy now. Feel free to reach out if you want to discuss this, or pick up another issue from the tracker.
GitHub Actions run 2734488505 succeeded.
Further to discussion with @HassanAbouelela in #dev-contrib, I'm creating this issue to outline some potential changes to the !remind command that can be made.
Bugs:
!remind editdoesn't validate that the reminder was actually changed before sending the API call and sending success message.
Resolving this would mean having toGETthe reminder being edited so that the appropriate fields can be compared.!remind edit contentdoesn't support using a referenced message, b...
Doing the enhancements together sounds fine ๐
I have a couple concerns wrt the implementation of the other two.
Bug 1. I don't know if it's worth it to do a second API call, when the current behavior doesn't seem to be a problem. I don't mind either way though
Bug 2. Not sure this is a bug, more of a new feature. Off the top of my head, I don't believe there's a one-to-one relationship between a message and a reminder. You can create multiple reminders to one message, and you can ha...
Bug 1. I don't know if it's worth it to do a second API call, when the current behavior doesn't seem to be a problem. I don't mind either way though
It's not really a "problem", more a QOL thing. It just seems weird to have an edit command that doesn't actually verify if it was edited. If we decide it's not worth due to the API call then that's fine with me.
How would replying to a message tie it to the reminder?
The same way it does for!remind new, i.e. use the referenced messa...
I had Tizzy explain to me on discord. The proposed command in bug 2 is remind edit content <reminder ID>, then have the body of the reply become the new body of the reminder. I don't think this is intuitive behavior, but we do use it in other places in our bots so it could become expected I suppose. I won't stop it, I'm mostly indifferent.
@TizzySaurus I think you accidental resolved this without fixing it.
[python-discord/bot-core] New branch created: 8\.0\.0\-beta
e88ef3c Bump Python To 3.10 (#108) - ChrisLovering
[python-discord/bot-core] branch deleted: py3\.10\-rediscache
1f309b6 Bump sphinx from 5.0.2 to 5.1.0 (#109) - dependabot[bot]
[python-discord/bot] New branch created: bot\-2231\-enhancements
Delete Multiple Reminders
This has been tested with the help of @ichard26 (thanks!).
The behaviour behind the deletion is still the exact same (you can't delete others' reminders unless you're an admin), just has been reformatted to account for the fact that a lock needs to be applied to each individual id.
There's also some changes to prevent a message being sent for each deletion fail -- we instead send one message after processing all ids.
_All reminders successfully deleted...
GitHub Actions run 2735441485 succeeded.
2650e24 Use self._select_snooze_duration instead of `... - TizzySaurus
It is decorated with the
discord.ui.selectdecorator which converts it into a Select.
Right, yes, I missed that. Have fixed :+1:
[python-discord/bot-core] New branch created: async\-rediscache\-bump
GitHub Actions run 2735543671 succeeded.
[python-discord/bot-core] branch deleted: async\-rediscache\-bump
[python-discord/bot-core] New tag created: v8\.0\.0\-beta\.3
40ab60f Allow referencing message as argument to `!remi... - TizzySaurus
[python-discord/bot] New branch created: bot\-2231\-bug
Part two of #2231.
Users can now reference a message to use its content as the reminder's new content when editing a reminder, as is already the case when creating a reminder.
Text argument

Referenced message has a content

*Referenced message has no conte...
GitHub Actions run 2735658216 succeeded.
After further discussion on discord, I've decided that Bug #1 is fine as-is, and not really a big deal.
The two enhancements have been implemented in #2232, and Bug #2 has been implemented in #2233. Once both of these have been merged, this can be closed.
GitHub Actions run 2735721993 failed.
3180870 Bind loop variables in function definitions - ChrisLovering
251d624 Remove explicit cleanup of the redis session - ChrisLovering
[python-discord/bot-core] New branch created: remove\-redis\-cleanup
This is now handled by the lib implicitly.
GitHub Actions run 2735793216 succeeded.
9c36ea8 Remove explicit cleanup of the redis session (#... - ChrisLovering
[python-discord/bot-core] branch deleted: remove\-redis\-cleanup
[python-discord/bot-core] New tag created: v8\.0\.0\-beta\.4
GitHub Actions run 2735936737 succeeded.
GitHub Actions run 2736066669 succeeded.
This is a well polished PR. I like the test changes, and I didn't find any issues while testing. Signing off on the docker changes on behalf of dev-ops.
The previous type hint expected a tuple with a single exception type
instead of a variable length tuple of exception types
Could I be assigned to this issue please?
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Did you:
- [ ] Join the Python Discord Community?
- [ ] Read all the comments in this template?
- [ ] Ensure there is an issue open, or link relevant discord discussions?
- [ ] Read and agree to the contributing guidelines?
If you add Literal to the things being imported from typing, then you can do this for the category arg.
async def joke(self, ctx: commands.Context, category: Literal["neutral", "chuck", "all"] = "all") -> None:
Doing so means that you don't need to have self.JOKE_CATEGORIES at all, as Discord.py will do all the checking.
How do I check and handle if the user input is not one of what is expected, if I do the Literal?
You don't need to. Discord.py will do that for you.
What this type hint is saying is that the category arg needs to be one of those 3 values. If it isn't then Discord.py will raise an error.
Description
Add a command to play a number guessing game (a random number is generated and the user guesses it, the bot says whether it's higher or lower or if they won.
Reasoning
It can be a fun game to play, perhaps more if there are different modes: easy, medium, hard.
Proposed Implementation
A game where the user can input easy, medium, or hard to increase the range of which the random number is generated from. They have 5 tries to guess the number, if they fail to do ...
To whoever merged this, please squash & merge.
Connected!
Connected!
[python-discord/bot-core] New branch created: release\-8\.0\.0
This updated bot-core to a full 8.0.0 release.
Changelog looks like:

[python-discord/bot-core] branch deleted: release\-8\.0\.0
Iโve already approved all this before Chris. Why are you making me review it all again Chris.
[python-discord/bot-core] branch deleted: 8\.0\.0\-beta
[python-discord/bot-core] New tag created: v8\.0\.0
7331a17 Bump bot-core to full 8.0.0 release - ChrisLovering
GitHub Actions run 2748563627 succeeded.
dfc32e2 Add a field to track the time an infraction was... - ChrisLovering
[python-discord/site] New branch created: add\-infraction\-last\-applied
A default is set for backwards compatibility with bot version that don't explicitly give a value.
GitHub Actions run 2749480602 succeeded.
[python-discord/bot] Checks Cancelled on PR: #2229 Update to Python 3.10 and async-rediscache v1.0.0
GitHub Actions run 2749539949 was cancelled.
GitHub Actions run 2749545269 succeeded.
GitHub Actions run 2749802010 succeeded.
[python-discord/bot] New branch created: infraction\-durations
The migration has been tested against prod, it worked at took <1s locally.
Just to confirm, the suggestion is simply to replace the current reaction for others receiving the bookmark to a button, right?
0be3332 Added DurationOrExpiry type union - ionite34
0921838 Refactoring for DurationOrExpiry - ionite34
Closes #2217 and #2130
Implements new infraction duration calculations, including the addition of the last_updated model attribute in https://github.com/python-discord/site/pull/751
GitHub Actions run 2752447473 failed.
GitHub Actions run 2752456121 failed.
I'm not sure adding more_itertools just for this is worth it, when the below uses only built-ins, and is faster.
issues = list(dict.fromkeys(issues))
GitHub Actions run 2752552990 failed.
What is the purpose of this?
Sorry, I left out a lot of context as we were discussing in #dev-contrib. I've updated the PR description with some of that context.
GitHub Actions run 2752614001 failed.
GitHub Actions run 2753008813 succeeded.
GitHub Actions run 2754842180 failed.
GitHub Actions run 2756739178 succeeded.
GitHub Actions run 2756761703 succeeded.
GitHub Actions run 2756762001 succeeded.
GitHub Actions run 2756762046 succeeded.
GitHub Actions run 2756755214 succeeded.
GitHub Actions run 2756765504 succeeded.
GitHub Actions run 2756842233 succeeded.
GitHub Actions run 2756889787 succeeded.
GitHub Actions run 2756892439 succeeded.
GitHub Actions run 2756987027 succeeded.
GitHub Actions run 2756992678 succeeded.
78640f5 GitHub issues embeds: preserve order and displa... - shenanigansd
[python-discord/sir-lancebot] branch deleted: gh1076
Connected!
GitHub Actions run 2757055173 succeeded.
GitHub Actions run 2757236825 succeeded.
This seems wrong because asyncio.run creates a new event loop. Presumably this will be separate from the event loop the rest of the tests use, unless unittest accounts for that somehow.
For the implementation of the button, I would ideally add the multiple arguments to the init of the view class and call the button with the arguments how it's being called currently, right?
Current problems
The current design has some limitations. It cannot store a separate actor, timestamp, or reason for pardoning infractions. For the reason field, the current workaround used by Big Brother is to prepend the reason with 'Watched: ' or 'Unwatched: ' to distinguish them. Furthermore, the design cannot keep track of edits made to infractions.
New Design
Action table
Create a new table to store "action" records. Actions can include making an infraction act...
When using !rule 6, the embed contains the string #python-general as a reference to the channel. Let's make it a link.
In #rules, it's already a link.
Sometimes an infraction may need to be voided due to a mistake. A good example would be if the infraction was mistakenly added to the wrong member (Discord's mentions aren't exactly dependable). The infraction should not be kept on the member's history in this case, but we only currently have the ability to make an infraction inactive.
This would also allow us to be able to easily undo an infraction, supporting the features mentioned here:
https://github.com/python-discord/bot/issues/240
I think the API may support it, but we never added bot support for it. It comes up every now and then, but Iโve generally been against it, and I think a few other dev ops members have been too.
The reason is I think thereโs the potential for a lot more harm from removing infractions, than there is in keeping one marked as invalid. This is already implemented so Iโll close the issue, but we can still discuss it here or open a bot issue.
The reason is I think thereโs the potential for a lot more harm from removing infractions, than there is in keeping one marked as invalid.
This issue was not about deleting infractions. It was about having a way to mark them as invalid. I don't understand what your point is because it seems to be in agreement with this issue already.
The issue description says:
The infraction should not be kept on the member's history in this case, but we only currently have the ability to make an infraction inactive.
I think this is asking for a way to delete infractions (which we already do). We also already have a way to mark them invalid (on the site) as the issue says.
[python-discord/bot] New comment on issue #240: Moderation undo reaction, infraction void subcommand
Refer to [this discussion](#dev-contrib message) in dev-contrib.
Doc item doc_item.symbol_id='disnake.on_group_join' present in loaded documentation inventories not found on site, inventories may need to be refreshed.
There isn't a running loop when redis_loop was created, nor is there one during module setup, so the asyncio.get_event_loop() call was raising a deprecation error.
I think the alternative to this is to create the session within each test class as an asyncSetUp, rather than at the module level.
I've pushed both 1b6b76f (#2229) and b5797ff (#2229) to show what this alternative would look like.
GitHub Actions run 2766770817 succeeded.
GitHub Actions run 2768461167 succeeded.
Added field appears correct for supporting new duration calculations, and does not affect current API.
A tag explaining typing.TypedDict and what it's useful for.
As the title specifies, the database should be updated when a user edits their message to ensure accuracy of content.
We donโt record message content, only message metadata (who sent it, where was it sent, is it deleted, etc)
Thanks for the contribution, but were these approved or discussed? If so, please link the issue or discussion here. Generally we separate different features (tags in this case) in different PRs so itโs easier to review and track.
GitHub Actions run 2770572361 succeeded.
@Shom770 Could you resolve the review here and fix the lint error so we can get this merged?
Thanks!
Hey @Bluenix2, what's your status on this PR?
Thanks!
@iamericfletcher Hey! What's your status on resolving these reviews?
Thanks!
@Okimii Greetings. How's resolving the reviews going? Be sure to ask if you need any help.
Thanks!
When user argument is not provided to the !purge command, the greedy convertor returns an empty list. This results in the bot deleting messages of ALL users in the last 10 minutes.
Some kind of a check should be added to prevent this from happening.
Also applicable to the !clean users command.
This issue may or may not be inspired by real life events.
The issue was discussed in dev-contrib. The current suggestion is to add another field to mark issues as invalid. There are multiple opinions on the exact implementation on the bot side, but generally it's viewed as acceptable to have another Boolean field here.
Due to the contention on the bot side, it's not clear if this is something that will be pursued, so I'll leave this issue closed. If we decided to do it, we can reopen it.
Is this not intentional behavior? Sometimes you want to clean up a channel, especially when it goes off the rails.
You can't specify a single channel when using the purge command. Only users and age of the messages to be purged.
That's some good stuff right there.
branches: [ main ]
"master" is no longer considered correct or standard for the primary branch of a repository on Github, we should use "main" here instead. Perhaps include a note that their install may still default to "master"
- `-d` flag tells Docker to run the container in detached mode, meaning it will run the container in the background of your terminal and not give us
Thanks for the contribution, but were these approved or discussed? If so, please link the issue or discussion here. Generally we separate different features (tags in this case) in different PRs so itโs easier to review and track.
No, apologies, I was not aware that I had to create an issue. Should I close the pr and make an issue?
We donโt record message content, only message metadata (who sent it, where was it sent, is it deleted, etc)
Oops I probably should've read the source code a bit better.
No itโs alright, weโll keep this open. I do however recommend opening issues for them on the meta repo and linking this PR to get peopleโs eyes on them.
I do not have any other changes - this is ready for review! The preview failed because of ratelimits, I am not sure whether I can re-run them.
Lots of users have issues with installing python, sometimes not checking correct options or installing from correct sources. A tag would be simple and fix this issue. It could, for example say ```
Install python for your OS at https://python.org (installing from other sources such as Microsoft store is not recommended.)
Select the "Install for all users" and "add python to PATH" options.
If you installed python without adding it to PATH, you will have to reinstall your version and select "...
I think this is a neat idea. I think !install would be a good name for the tag. +1
GitHub Actions run 2772384137 succeeded.
GitHub Actions run 2772949172 succeeded.
GitHub Actions run 2773008742 succeeded.
GitHub Actions run 2773022092 succeeded.
In my opinion, the installation process seems pretty self explanatory. What information would the tag give that the installation guide doesn't have? Perhaps a note mentioning that python should be added to path.
FYI, we do have a !windows-path tag.
It looks like so:

The text can be found at https://github.com/python-discord/bot/blob/main/bot/resources/tags/windows-path.md
@wookie184 how about using embed_url in gif object, its given in documentation,
they must serve the purpose rightly here if i am not wrong ?

GitHub Actions run 2777899993 succeeded.
What about for different OS's
I have a couple suggested changes but no blockers.
Tested the following things:
- Starting and stopping event
- Permission role lock
- Force-posting a question
- Setting a custom scheduled post-time other than UTC midnight
screenshots
Forced post
Scheduled post at 3AM UTC (11PM my time)
logs if you are interested
sir-robin | 2022-08-02 02:46:52,538 | async_rediscache.types.base | DEBUG | Released for RedisCache.update
sir-r...
Include the year that we are doing as well, yes/no?
More verbose help text, if you like.
To specify a starting day other than `1`, use the `force` command.
`year` must be an integer at least 2015.
`day_interval` must be an integer at least 1.
`post_time` must be an integer between 0 and 23.
To receive notifications when new puzzles are released, run `!subscribe` in <#{bot_commands}> and assign yourself the Revival of Code role.
Actually rather than putting the year in the thread title, how about in the post's hyperlink?
<img width="447" alt="image" src="https://user-images.githubusercontent.com/75038675/182284763-a1f44e69-873b-46c2-b86b-281ef83c0a66.png">
What about for different OS's
Windows seems to be the most problematic with python management
I don't understand the warnings fix here. setup is a coroutine function rather than a coroutine itself, so there should be no warnings from it just being imported, only if it is called and the coroutine returned not awaited (which doesn't seem to happen).
Changing the cog to be shared across different tests in ErrorHandlerTests doesn't seem ideal, as some of the tests patch methods meaning they could affect each other. I cant see any obvious places it would actually make a difference h...
@wookie184 how about using
embed_urlin gif object, its given in documentation, they must serve the purpose rightly here if i am not wrong ?
It does look like it should work although I think I tried it a while back and it didn't seem to. Would be fine if it does work, although any solution would need testing.
I don't think this is possible to do with a custom Converter, so we should just check that the list of users isn't empty in the function. Maybe we could suggest the user might want !clean instead in the error response.
The command is defined here: https://github.com/python-discord/bot/blob/2a825b234e0f23a901bb78343b1ff36ce85eaa5d/bot/exts/moderation/clean.py#L627-L636
I don't have nitro so there was a limit to what I could test, but this seems good, thanks!
GitHub Actions run 2783863670 succeeded.
Connected!
GitHub Actions run 2783870122 succeeded.
I thought it was more confusing than helpful, and since they have to go to AoC website anyway it'd be kind of redundant.
GitHub Actions run 2785221118 succeeded.
Summary
- Add the package
numba
Rationale
- ๐ +
@njit= ๐
Two big things:
-
Required change in
pyproject.tomlso this doesn't break locally and we can test it. We'll have to take a look into our redis cache code to adopt to the the async_rediscache breaking changes when it was migrated to aioredis v2. -
There's a bug I can't quite hunt down but it might be in
utils/next_time_occurrence(), but if I start RoC there's an issue with the timestamp generation for when the next puzzle will be posted. It'll say the next puzzle will be posted at th...
This is not a tight enough specification with the recent breaking changes pushed to async_rediscache. It's just spitting errors trying to test locally.
fakeredis = "=1.7.4"
What is loop_task_active telling me? When it is actively posting?
is_running and wait_task_active seem obvious, but I'm not sure what loop_task is supposed to tell me.
We can change the current day with the &roc force command, but we can't change the day interval. Is this something we'd like to add later on?
Closes #2238
Summary
- Added raising of
BadArgumentwhen the greedy match of users returns an empty list - Updated help message
Demo

GitHub Actions run 2791421583 failed.
GitHub Actions run 2791430963 succeeded.
I don't think this would really matter in practice. A message being exactly n seconds long is unlikely given snowflakes have millisecond precision (which I assume is being used?).
Also note that in the help command everything is in italics already, so "exclusive" is actually excluded from being in italics.
nvm that was there already ๐
I could also remove that original last line? I agree that it's kind of not needed as it's unlikely that kind of precision matters in a typed command.
Also in the demo image you can see the * * causing the weird italic font behavior.
Updated in 87de12c
- The `age` is *exclusive*, meaning that `10s` won't delete a message exactly 10 seconds old.
+ `age` can be a duration or an ISO 8601 timestamp.
GitHub Actions run 2791642036 succeeded.
GitHub Actions run 2791870876 succeeded.
I don't understand the warnings fix here.
setupis a coroutine function rather than a coroutine itself, so there should be no warnings from it just being imported, only if it is called and the coroutine returned not awaited (which doesn't seem to happen).
By importing the coro directly, the below warnings are raised (malloc enabled to see object allocation)```
tests/bot/exts/backend/test_error_handler.py::ErrorHandlerTests::test_error_handler_already_handled
tests/bot/exts/backend/te...
@Xithrius Fixed the issues!
Thanks!
Tested, thanks for the PR! This will prevent many happy (but bad) accidents ๐
[python-discord/bot] branch deleted: 2238\-purge\-cmd
Connected!
GitHub Actions run 2792192127 succeeded.
I don't understand the warnings fix here.
setupis a coroutine function rather than a coroutine itself, so there should be no warnings from it just being imported, only if it is called and the coroutine returned not awaited (which doesn't seem to happen).By importing the coro directly, the below warnings are raised (malloc enabled to see object allocation)
tests/bot/exts/backend/test_error_handler.py::ErrorHandlerTests::test_error_handler_already_handled tests/bot/exts/b...
The added last_applied attribute in #751 currently is not in the API response.
[python-discord/site] New branch created: api\-last\_applied
The check for setup seems to be behind a check for the nose plugin in pytest (https://github.com/pytest-dev/pytest/blob/f43ddd8acd74a2c3242a3874420072836e0614aa/src/_pytest/python.py#L881), so the only thing I'm not sure about is why that would trigger since we don't use nose.
You aren't quite looking at the right line:
https://github.com/pytest-dev/pytest/blob/7.1.x/src/_pytest/python.py#L561-L568
This doesn't use nose, and it's what's called for us. Refer to TB:
Fil...
GitHub Actions run 2792460482 succeeded.
Fixes #757
Required for python-discord/bot/pull/2234
Summary
- Added
last_appliedtoserializers
model = Infraction
fields = (
'id',
'inserted_at',
+ 'last_applied',
'expires_at',
'active',
'user',
'actor',
'type',
'reason',
'hidden',
'dm_sent'
)
Testing
- Verified API Response for infractions now includes
last_applied
http://localhost:8000/api/bot/infractions?active=true?type=mute?user...
[python-discord/forms-frontend] New branch created: bump\-dependencies
This PR bumps all dependencies up to latest versions, with no noteworthy changes.
It also makes some metadata changes to our package.json. The first change is making the package private, since this is not intended to be used by other projects, and there are no intentions to publish it.
The second is explicitly defining the node versions. The project currently doesn't use any special features which limit us too much. Our dependencies are only compatible with the 16 LTS and the latest 18 ...
[python-discord/forms-frontend] branch deleted: bump\-dependencies
b036d2f Remove HassanAbouelela From Code Owners - HassanAbouelela
[python-discord/forms-frontend] New branch created: update\-codeowners
[python-discord/forms-frontend] branch deleted: update\-codeowners
e351a2f Remove HassanAbouelela From Code Owners - HassanAbouelela
GitHub Actions run 2794418763 succeeded.
This markdownify bump breaks the doc command (see https://github.com/python-discord/bot/pull/2156)
We should probably add a comment mentioning that it needs to be kept at it's current version.
One thing, other than that all seems good, nice work ๐ฏ
0f4bc18 Disable nose plugin in pytest - wookie184
[python-discord/bot] New branch created: disable\-pytest\-nose\-plugin
eca5597 revert bump to markdownify version - ChrisLovering
This fixes an issue with pytest running functions called setup in test files when they shouldn't be run.
The current case is also fixed by https://github.com/python-discord/bot/pull/2229/commits/6217513d7bc5a97afc595af1966dfd722db0084c, but this fix should help prevent future cases.
For more information see https://github.com/python-discord/bot/pull/2229#issuecomment-1204436420.
[python-discord/bot] New branch created: fix\-not\-awaited\-coroutine\-warning
Fixes this warning in the tests:
tests/bot/exts/moderation/infraction/test_infractions.py::VoiceMuteTests::test_voice_mute_truncate_reason
c:\users\wookie\appdata\local\programs\python\python39\lib\enum.py:384: RuntimeWarning: coroutine 'Infractions.apply_voice_mute..action' was never awaited
Coroutine created at (most recent call last)
File "c:\users\wookie\appdata\local\programs\python\python39\lib\unittest\async_case.py", line 87, in _callMaybeAsync
return self._asy...
GitHub Actions run 2798225073 succeeded.
I was investigating a fix for this as well, all looks good.
@ichard26 if you're still interested in this feel free to assign yourself, otherwise this can be marked as up for grabs.
- A series of toggles to choose how the form works (whether it's visible, open, etc.)
- Ability to add a new question, choose its type, its title.
- Additional options depending on the question type.
- Ability to insert unit tests if it's a code field.
Once #507 is complete, we'd like a UI to patch an existing form.
The UI should load the form's current configurations, the same way as they would appear in the form creation UI, and then allowing to edit them and save.
The font is currently very bulky. Font suggestions are welcome.
We want a way to view responses on the app. It can look something like this:

Except instead of input fields, the field will contain the response from the user, and it will be locked.
Additionally, there should be arrows to move forward and backward between responses.
The admin panel should give access to a panel of all responses of a specific form. Pressing one of the responders will access their response as per #510.
There should be an admin panel, from which we will be able to access form responses, as well as being able to create/edit/delete forms.
This is just to get the idea:
https://www.figma.com/file/sYBxfzxNPpXhLV0qyi2vGZ/Admin-Dashboard?node-id=0%3A1
Whoever ends up working on this is welcome to suggest their own design.
- [ ] There should be an area on every page (including home page) to login/logout via the Discord Auth.
- [ ] The area should display the user's username and profile picture, to make it clear who they're logged in as.
GitHub Actions run 2799236243 succeeded.
Currently the code evaluation suffers from possible exploits. These stem from how code evaluation currently works on the forms app:
- The user's code, as well as the pre-supplied unit tests, are sent to snekbox.
- The unit tests are run on the user's code inside snekbox.
- The result of the tests are supplied back from snekbox through stdout.
This means that if the user manages to control the stdout, they are able to control the output of the tests, as far as the forms app can unders...
GitHub Actions run 2799635108 succeeded.
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Added the ds&a channel to the whitelisted channels for the latex command.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant di...
GitHub Actions run 2799819112 succeeded.
Connected!
GitHub Actions run 2799859042 succeeded.
Adding a Rickroll Detection command
Possible forms:
1. Command
Syntax: .rolldet
- Can also reply to a link instead of providing as argument
2. Continuous link monitoring
- Monitors all links posted in public channels
- Replies with a warning message when a rickroll link is detected
Reasoning
Would be fun for rickroll attempts to be detected
Proposed Implementation
It is quite straightforward to accurately support the detection of all links hosted on yo...
Would love all the feedback!
GitHub Actions run 2801417387 succeeded.
I propose a slight modification to Solution 1.
To make Forms's unittesting as general as possible, the API could accept python code in a setup field for each unittest form field. Forms evaluates<sup>[1]</sup> this setup code with the form submitter's response, and then sends this result to snekbox. snekbox sends back stdout, forms matches it with some output field.
The test template currently in forms is then moved to Code Jam backend, which sends a request like
{
...
This seems problematic, generators don't have to be functions. You can create a generator class by implementing methods defined in collections.abc.Generator
A few notes on Generators not being bound to functions, and fixing the inheritance explanation for Iterator -> Generator, instead of the other way around
This is incorrect. Merely implementing __iter__ does not create a Generator, you can test it as such:
import typing
class Foo:
def __iter__(self):
return self
print(isinstance(Foo(), typing.Generator))
>> False
All Generators are Iterators, the abstract base class for a Generator actually inherits Iterator. Generator actually requires 2 methods to be implemented over an Iterator's __next__ and __iter__, which are send, throw, and the ...
Running any user code directly on the backend is a no-go. The part I donโt understand about your proposal is what it ends up achieving. You still canโt check state the way you described because the same issue of not being able to safely communicate between the unit test suite and the backend remains.
Also to touch on Zigโs last point: the discussion yesterday was that this issue is currently sitting on low priority, and adding support for things that arenโt the code jam isnโt something weโ...
what it ends up achieving
It removes the possibility of exploiting stdout in tests where we directly match the user's prints, while letting you keep the current behaviour of code jams where you check prints by unittest
That is to say, you can decide on a per-event (or even per-test) basis whether you want (unexploitable stdout + no unittests) or (exploitable eval + unittests)
This tag feels like it's trying to compare generators and iterators, which I don't think makes sense. Since a generator (function) returns an iterator, this feels a bit like comparing e.g. a BMW to a Car. Would two separate tags on the topics make more sense?
Tags should be concise and answer a common question. If someone wants to know what a generator is, at a high-enough level that it can be answered concisely, I don't think many of the details here are relevant.
I would rather see a tag that gives an example of a generator created through a function, and an explanation of how the generator maintains its own state between yields (but preferably without the word "state").
OMG that is actually a brilliant idea. Would love to see this approved and implemented.
I've contacted the site stuff and although code of conduct say nothing about it they don't really like scrapping and they are also planning an API, so I'll just close the issue. Might ask for it to be reopened if the API releases.
This pattern of making a task and awaiting it in functions isn't needed anymore, since d.py added async cog_load loading. As it guarantees that the cog_load function is finished before the cog accepts any command/events.
So this task, an all usages of it can be safely deleted.
I can take on this issue if needed
No, not really anymore. I'll put it up for grabs.
Isnโt that just suggestion 1?
Current Auth System
Currently, the authorization system on forms is broken into two portions, Discord OAuth, and a stateless JWT user token. The log-in process starts on the frontend, where:
- Users click login
- They get sent to discord to authenticate
- The frontend callback URL is called with a discord access token, which is
- Sent to the backend, to fetch discord data, and create the JWT.
- The JWT is returned to the frontend, in a Set-Cookie header, which creates a cookie th...
You don't get to keep code jam's unit tests with suggestion 1
GitHub Actions run 2805522407 succeeded.
This tag feels like it's trying to compare generators and iterators, which I don't think makes sense. Since a generator (function) returns an iterator, this feels a bit like comparing e.g. a BMW to a Car. Would two separate tags on the topics make more sense?
Well, maybe the wording in the file may lead you to think that its trying to compare an iterator and a generator, im not aiming to, im aiming to explain both concepts, if you have any suggestions especially about the wording, plea...
GitHub Actions run 2805649678 succeeded.
Thank you, this mostly looks good. There will be a few lines of conflicts due to #1078, could you pull the latest changes and update this?
GitHub Actions run 2806245349 succeeded.
GitHub Actions run 2806291167 succeeded.
GitHub Actions run 2806285277 succeeded.
GitHub Actions run 2806294341 succeeded.
Summary
This is a proposal to extend the AntiMalware cog to submit file links and attachments to the VirusTotal API for testing.
https://developers.virustotal.com/reference/overview
The public API allows up to 500 requests per day, which, after excluding image links and possibly some additional whitelisted domains, would be fairly sufficient for use.
A new command could possibly also be implemented for directed scanning of URLs / file attachments.
Rationale
On more t...
Iโve never had good experiences with VT, Iโve always had it flag everything as safe. Is there a specific instance/site this is trying to protect against which can not be achieved with normal blacklists.
I think a few previous incidents involved Mediafire / custom file hosts. Which were removed after some users submitted virus total results. I'm not sure how much additional coverage there would be but it would at least offer some additional protection.
In addition, this addresses the binary/text dual format preview vulnerability, as discord CDN files offer a direct link that Virus Total is able to download and analyze.
Out of curiosity, why use collections.abc rather than typing which is already imported
I'd like to see comments here or elsewhere saying why we're not passing around coroutines, otherwise in the future someone might look at it and think this should be refactored.
149e67b Remove IP From Compose Ports - HassanAbouelela
98fa159 Run Migrations For Tests - HassanAbouelela
1122f5a Merge branch 'main' into speedup-tests - ChrisLovering
86af979 Merge pull request #741 from python-discord/spe... - ChrisLovering
154bba3 Merge branch 'main' into api-last_applied - mbaruh
[python-discord/site] branch deleted: api\-last\_applied
if the DB migration assigned values to this field then I don't think we need to account for this. Otherwise our code base will quickly become cluttered with such edge cases.
Since arrow is already imported you might as well just use arrow.utcnow() as is done elsewhere in this file. I believe everything else in this function should work as-is. Not a big deal either way.
Can you put this in italics? to better separate it from a message's content.
Because of PEP 585, typing.Callable is deprecated.
We could probably do a PR to switch over everything at some point, but there's no real rush. From the PEP:
The deprecated functionality will be removed from the typing module in the first Python version released 5 years after the release of Python 3.9.0.
GitHub Actions run 2809294145 succeeded.
Currently, the site is setting inserted_at when the entry is inserted. The goal of the new attribute last_applied is to provide a datetime that is calculated on command run at the bot side, which should remove some of the server / network latency issues. In addition, the last_applied time is actually calculated together with the delta, meaning that the absolute delta of last_applied and expires_at is exactly equal to the infraction (for example 1 hour) down to the microsecond.
So that was the rationale for this change, since the minimum accuracy of our humanize_delta is 1 second, the rounding will trim off microseconds via rounding.
The original issue was that the humanize_delta call matches time units until the last unit is exhausted, which, in the case of infractions, due to code and network latency, the delta between inserted_at (calculated at entry insertion server side) and expires_at (calculated at original command invocation) will at least be so...
GitHub Actions run 2809668574 failed.
GitHub Actions run 2809763440 succeeded.
1eff1d8 Add note to docstring, fix type-hints, and upda... - wookie184
Added a note to the functions docstrings
GitHub Actions run 2809778917 succeeded.
GitHub Actions run 2809786365 succeeded.
I'm going to work on a slightly simplified version of this.
I feel like the proposed tag would be better focused on explanations of the creation of generators and generator expressions instead of custom Iterator classes, proposed a couple of changes in line with this.
---
aliases: ["generators", "iterators", "yield"]
embed:
title: "Generators and Iterators"
---
Aliases for either element might be appropriate here since some people will definitely try to call individual ones.
**Generator Expressions**
Generators can also be created by `for` clauses inside [expressions](https://docs.python.org/3/glossary.html#term-generator-expression). This is similar to creating a list comprehension but using `()` instead of `[]`. You can use `if` `else` ternary operators as you would in other comprehension forms.
I feel it's slightly out of scope to give examples of implementing Iterators as beginners are unlikely to need this level of extensions. Expla...
**More Information**
โข Generators and Iterators can also be created as custom classes by implementing their required [methods](https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes-1). The preferred way to do this is by extending the respective Abstract Base Classes within `collections.abc`.
โข Check out the [Real python article](https://realpython.com/introduction-to-python-generators/) for a more in-depth view of Generators and their us...
GitHub Actions run 2810173388 was cancelled.
GitHub Actions run 2810180984 failed.
GitHub Actions run 2810194303 succeeded.
Your understanding of Python's internals is impressive, but I feel that this tag focuses on the wrong details, and tags of this length are not likely to be read in their entirety. Consider the target audience (novice Python developers) and the context in which this is intended to be read (likely during a help session where said novice is focused mainly on solving a specific problem). As insightful as it is, I would like to see all discussion of classes and dunder methods removed.
Perhaps y...
Reduced some details on generator internal states and classes to be more beginner-friendly.
Removed detailed discussion of generator states.
foo = (x * 2 for x in range(5))
for num in foo:
print(num)
Instead of using sum, used print example which might be easier to understand.
โข Generators and Iterators can also be created as custom classes by implementing their required [abstract methods](https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes-1).
Made ABC link more concise
Well, our target should be intermediate and beginners. I wouldnt really remove the examples as its better to have more information about such a topic so users dont need to search e.g on Google on how a to make a generator or how yield works, yes i do agree its allot of info but its better to have info in depth over explaining concepts and not their implementation.I would agree the tag is long, but @ionite34 did a good job explaining and wording it better than i did and in my eyes nothing real...
GitHub Actions run 2810303802 was cancelled.
@ionite34 well done especially on the implementation of examples!
GitHub Actions run 2810314988 was cancelled.
GitHub Actions run 2810315763 succeeded.
d33d585 fix: don't include replied mentions in mention ... - onerandomusername
719860d chore: compare user objects directly - onerandomusername
5e2a12c fix: remove extra assignment and add check that... - onerandomusername
5ca6be0 chore: address rare case of missing cache and d... - onerandomusername
c2bbb9c chore: touch up docstrings - onerandomusername
[python-discord/bot] New branch created: fix\-issue\-2015
Reduced some details on generator internal states and classes to be more beginner-friendly.
The logic here isn't quite correct, as this will currently subtract 1 from the total even if the reply was to a bot or themself, in which case it wasn't counted in the first place.
This has been fixed (I took over the PR) :+1:
GitHub Actions run 2810396424 failed.
There's a random . in a docstring, and more discussion about the sum()
The logic here isn't quite correct, as this will currently subtract 1 from the total even if the reply was to a bot or themself, in which case it wasn't counted in the first place.
[python-discord/bot] branch deleted: fix\-issue\-2015
For an additional note, the \ marks on lines 14, 26, 32, 37 need to be removed for the markdown to be valid.
[python-discord/bot] New branch created: update\-autoreview\-system
Not sure if i'm fully done yet so marking as draft, but I don't mind if anyone has any general feedback.
GitHub Actions run 2810501085 succeeded.
My thinking is that we can use the force command either as a one-time thing or by stopping the event and starting a new one with a different post-time.
The discord.py tasks module provides a special task for a recurring wait task, which is what we use to wait between posts during the event. To get allow the command to be used before the post-time, a normal async wait is used before the loop starts. So a running event can either be in a state of waiting to make the first post or waiting between posts (wait_task or loop_task).
Ideally the user wouldn't have to know any of that, but I included them in the info embed out of an abundance of ca...
Same reasoning as below. Basically, changing those parameters is considered to be a different event by the code and is easy enough to accomplish by stopping the current one and starting a new one.
GitHub Actions run 2811034570 succeeded.
Summary
This proposes an enhancement to the existing !eval command that will allow !eval to evaluate code from a replied message.
This functionality could be implemented similar to commands like .uwu in lancebot. The command itself would use any given text, and if nothing was provided, use the text from a replied message.
GitHub Actions run 2812819854 succeeded.
I +1 this idea.
There's often times that I wrote out code, and then find myself copy-pasting it so that I can run it on !e because I forgot to do that in the original message.
Thanks to python-discord/bot-core#101 it'll be pretty easy to implement too should this be approved.
GitHub Actions run 2813181346 failed.
GitHub Actions run 2813201827 succeeded.
Hi @CaedenPH, could I ask you to review this PR which I believe covers at least one of your suggested tag contents? https://github.com/python-discord/bot/pull/2230
this is such a cool trick
This looks good. But shouldn't the endpoint have some authorization / whitelisting / ratelimiting?
is that why the addition of *.pem in .gitignore?
This is also how it's done further below
We discussed during today's staff meeting, we would like to see this tag revamped/pivoted to a narrower scope, which also leverages and links to the Real Python article on generators.
Please let us know if you'd be interested in doing that @Okimii.
We will also work on better defining what criteria we feel a tag should meet to best serve as a teaching tool for a real-time communication platform such as Discord, and also make it a bit clearer that a PR for a tag should not be opened wit...
I've fixed the next puzzle time bug and the bug I mentioned on discord by recording the date of the first post as a reference to calculate the date of the next post.
I also removed the async task info from the embed.
@jchristgit I wanted to add auth, but because we are running a file hosted in the repo, the build is not a trusted environment. If someone wanted to be malicious, they can print out environment vars and get the key.
I suppose we could still do auth and accept that it can be leaked and we'll have to regenerate it sometimes. How would rate limiting look?
The client only needs to be closed if we encounter an error. If we donโt, the client is returned to the caller to be used for all further interactions. The close below is what closes it in case of success.
Yeah private key encoding is mandated for GitHub apps. In prod, we can deploy it as an environment variable, but this is more convenient for local testing.
netlify is not a trusted environment. If someone wanted to be malicious, they can print out environment vars and get the key.
Great! That sounds very sane and secure.
I suppose we could still do auth and accept that it can be leaked and we'll have to regenerate it sometimes. How would rate limiting look?
Hm, not much value in case it can be leaked. Rate limiting - Maybe this? https://www.django-rest-framework.org/api-guide/throttling/ It's overkill though. We don't need it.
Explains well in detail about the module not found and how to fix but doesn't necessarily mention about what a module actually is. Seems more like a temporary fix rather than teaching the reader what exactly a module is and how to avoid module not found.
This is slightly ambiguous and may confuse the reader
Hi @CaedenPH, could I ask you to review this PR which I believe covers at least one of your suggested tag contents? https://github.com/python-discord/bot/pull/2230
Done, perhaps the information of that tag could be included/merged into my tags.
@minalike I wouldn't mind revamping the tag, I would love for the staff of pydis to make it better and more defined in the context of details for a better tag for beginners, I can also help with the structure of the tag but im not quite good with wording so I would really need help on that part, either way there's allot of talented people in pydis staff, e.g @ionite34 which has helped allot especially wording wise and the tags structure, so even if my wording isn't the best it can also be cor...
I'd like to see this shortened down dramatically.
- I don't think we should explain iterators and generators in the same tag. Let's make this one solely about generators.
- Tags should not be articles, and generators is a big topic which will not be sufficiently explained in a tag. In this case, it would be better to explain (in only a handful of words) what it is, how it's commonly used, and then link to a good resource for learning about it.
- The RealPython article is a fantastic resou...
Connected!
GitHub Actions run 2818936505 succeeded.
Currently, automutes by the bot ping the Moderators role in a mod-alerts channel, and also sends a public message indicating the user has been muted:

Well-meaning bystanders then ping moderators to have them unmuted, which is usually redundant. (If the user wasn't already unmuted, then that means either a moderator decided to leave the mute, extend it, or, there is no moderator ...
if embeds:
# If reply embeds are present, convert the first embed
embed = fun_cog._convert_embed(self._uwuify, embeds[0])
else:
# Parse potential message links in text
text, embed = await fun_cog._get_text_and_embed(ctx, text)
embed = fun_cog._convert_embed(self._uwuify, embed)
I would consider moving lines 197 198:
converted_text = self._uwuify(text)
converted_text = helpers.suppress_links(converted_text)
to be within the if text: block as well, no point running those if we aren't going to use the result.
Currently this also causes the line for await fun_cog._get_text_and_embed(ctx, text) to log this due to text being empty:
| bot.exts.fun.fun | DEBUG | Input '...' is not a valid Discord Message
It might be better to not run the await fun_cog._get_text_and_embed(ctx, text) at all if an embed is already available via embeds (see suggestions below)
Note that @AbooMinister25 has said on Discord that they'd like to implement this themselves, so if approved they should be assigned.
GitHub Actions run 2820989463 succeeded.
GitHub Actions run 2821187709 succeeded.
GitHub Actions run 2821291577 succeeded.
So, in regards to your last tag (Multiple-python), we already have a dashmpip tag which covers installing packages with python -m pip, and its relation to multiple python versions.
Remove the type checking import as we're no longer it
No longer need this type hint as we're not using fun_cog anymore
# Grabs the text from the embed for uwuification
if embeds:
embed = messages.convert_embed(self._uwuify, embeds[0])
else:
# Parse potential message links in text
text, embed = await messages.get_text_and_embed(ctx, text)
# If an embed is found, grab and uwuify its text
if embed:
embed = messages.convert_embed(self._uwuify, embed)
We no longer need fun_cog and re...
try:
return await MessageConverter().convert(ctx, text)
except commands.BadArgument:
return text
The logging here seems not necessary and is a bit spammy considering it will go off on every non-link invocation of .uwu, it's perfectly normal for the exception to occur and to be caught for messages without a valid message link.
GitHub Actions run 2821940608 succeeded.
I think you still need the try-catch here. Otherwise, this will raise an actual exception on every message without a parsable link. Just without logging was my original suggestion. Either return text in the except block or pass.
Doc item doc_item.symbol_id='nextcord.AuditLogAction.auto_moderation_rule_deleted' present in loaded documentation inventories not found on site, inventories may need to be refreshed.
GitHub Actions run 2825012704 failed.
So are you saying there should be that additional message appended to the original message?
I've just fixed the tests for this PR, but am looking to also add a new test that ensures this PR actually works (pings from replies don't work).
This means creating a new MockReferencedMessage class which I don't have the time to look into today, but will hopefully be done over the upcoming days.
GitHub Actions run 2827441547 succeeded.
All my blocker comments are resolved and it works nicely~
Connected!
GitHub Actions run 2828321632 succeeded.
GitHub Actions run 2828478577 succeeded.
149e67b Remove IP From Compose Ports - HassanAbouelela
98fa159 Run Migrations For Tests - HassanAbouelela
dfc32e2 Add a field to track the time an infraction was... - ChrisLovering
163201d Backdate last_applied dates to use value of ins... - ChrisLovering
1ca8b4d Merge pull request #751 from python-discord/add... - Xithrius
GitHub Actions run 2828493258 succeeded.
GitHub Actions run 2828802952 succeeded.
This is a very cool idea, Mark. Thank you for creating it.
I realise this has to be done in Django, but I would like to enforce more constraints on the database level where possible so I wrote some rough SQL here. Will also need a partial unique index to ensure only one active and inactive action per infraction. There's some thi...
This is a great idea, Lemon. But should we extend the base off topic name model? I think creating a new "linked otnames" table with three foreign key fields may be more intuitive, as we don't duplicate the information then.
If someone claims a help channel but then deletes the message that claimed the channel the help channel stays claimed but there isn't anything useful going on, the bot should detect when this happens and automatically make the channel dormant.
The message(embed) saying that the channel is dormant can also be changed to tell users to edit the message instead if the message was deleted to fix a typo or otherwise change it instead.
This should only happen within a short period of time afte...
This already exists, it's currently set to 5 minutes.
So if no one else sends a message inside a channel where the opening message was deleted, the channel will close after 5 minutes.
It's set to 5 minutes as there is a valid case where someone deletes their original message to re-word it, so closing it while they are rewording their question would be very annoying.
Doc item doc_item.symbol_id='discord.app_commands.TranslationContext.choice_name' present in loaded documentation inventories not found on site, inventories may need to be refreshed.
GitHub Actions run 2841012506 succeeded.
In the site's code jam page, the two dates shown below should be crossed as their time period is over but they are not. If possible I would like to work on this issue myself.

GitHub Actions run 2847431023 succeeded.
GitHub Actions run 2847449823 succeeded.
PR Author
Workflow Run
Source Branch
github-app-secrets
The necessary environment variables have been deployed to site and netlify, this PR should now be good to merge.
fe4def7 Add GitHub Artifact API View - HassanAbouelela
0404e00 Update Netlify Build Script - HassanAbouelela
26a3c19 Make Awaiting Workflow Run A User Responsibility - HassanAbouelela
124c84b Clean Up Artifact Tests - HassanAbouelela
5be5cf2 Merge branch 'main' into github-artifacts - HassanAbouelela
[python-discord/site] branch deleted: github\-artifacts
f4cab18 Use New Static Build Site API - HassanAbouelela
[python-discord/bot-core] New branch created: update\-static
Updates the build the script to use the new API provided by the site to fetch and download artifacts.
ff9633d Raise Static Build After Waiting - HassanAbouelela
[python-discord/site] New branch created: raise\-static\-builds
This is a small bugfix to #742, for scenarios where the build action bypasses the maximum deadline specified by the API. This PR adds the missing raise_for_status which should display a better error message in that scenario.
GitHub Actions run 2847849308 succeeded.
e804e69 Change base Python version to 3.11 - ChrisLovering
[python-discord/snekbox] New branch created: 3\.11
This is failing because the multiversion build takes more than 3 minutes currently. There are a few options:
- Limit the number of versions built. This is possible, but making it dynamic is hard since we can only specify a regex to match each tag name against. One way to make it work is to grab all tag names ourselves and combine all the allowed ones in a simple regex. Besides technical challenges, it's also an arbitrary limitation that reduces the benefit of having access to historical doc...
cc @ChrisLovering if you have any thoughts
I like the idea of not building multi-version for PRs. Having long CI in PRs is annoying anyway, so only building the new stuff sounds good.
Maybe we could even go as far as storing/caching the "old" versions of sphinx-mutliversion, and pulling form that, rather than building each time.
That's likely something we can look into in the future though, as it doesn't sound trivial.
We'd also still want a way toe force re-build all old versions too, in case we changing theming or something.
It looks like none of the solutions I proposed will actually work since both doc builds are under the same action, so it will still be marked pending, even once the latest version is built. If we disable the multiversion build in PRs, that'll resolve the issue in PRs, but will still fail on the main branch. I'll look into caching now.
GitHub Actions run 2849342652 succeeded.
690bcf2 Delete Metadata Files After Build - HassanAbouelela
Well, I've stumbled upon an interesting discovery. Each build contains metadata used to speed-up rebuilds, but it contains a bunch of binary data that increases the build size. Deleting those files from 75 MB to 22MB, which had the added benefit of reducing the upload time from 1m19s to 40s (total 2:51 to 2:11). There's further possible gain from removing the duplicated _static folder (~700Kb/version), but I'm not sure how that'll work between different versions, and it would require rewritin...
Do we want to wait 10 minutes here as well?
The wait here is only for the download, so it should in theory only take a few seconds. 10 minutes might be a little over the top, but we've got plenty of build minutes to spare, so I don't mind either way.
[python-discord/site] branch deleted: raise\-static\-builds
GitHub Actions run 2849570560 succeeded.
[python-discord/site] New branch created: bot\-tags
Closes #687
Still needs tests
GitHub Actions run 2850688351 failed.
GitHub Actions run 2850701959 failed.
GitHub Actions run 2850712165 failed.
GitHub Actions run 2851076440 failed.
GitHub Actions run 2851097101 succeeded.
Description
Reasoning
Proposed Implementation
Additional Details
Would you like to implement this yourself?
- [ ] I'd like to implement this feature myself
- [ ] Anyone can implement this feature
Closes #687.
I implemented this feature in the most efficient way (in terms of network requests) possible. We download the entire bot project as a tarfile, extract all the tags from it, and cache them to the database.
Ideally, I'd also like to add a bit more flavor-info to the pages, such as when they were last updated, and the authors that have worked on them, but the only way to get that data from the API is to request data for a specific commit, which means making ~100 requ...
What about the tag "rule <#>"
Those aren't tags, they're a command in and of themselves. Also, the rules are already listed in our website (it's what the rules command links to).
GitHub Actions run 2852996731 succeeded.
Just a couple a comments here.
Another observation is that this list is very long. A paginated and/or searchable list could go a long way here.
I don't think this should be a blocker on this PR directly, but it should be something we look into in future.
Would a re.finditer be more readable here? Rather than managing the iteration ourselves with match.end().
I think we can get away with more than 100 chars in the preview.
Also, if the start of tags include a long hyperlink, the link length is counted towards this 100 character limit. This leads to some tags looking far shorter than other (example below). I wonder if there is anything we can do about this?

content = content[:100] + "โฆ"
๐ก
Hahaha, I'm actually working on making the cropping here better, just keep your eyes peeled.
Yes, that's what I originally did, but how do you do the substitution? Substituting by index would not work after the first match since the index would've moved, and substituting with something like re.sub wouldn't work either since the substitution still matches, so you'll end up on the first URL again.
It's not easy to fix this, at least in python, without effectively writing a full markdown interpreter. What I'm doing instead is re-writing this to do the splitting in javascript, where the text is already separated out in a convenient manner.
I made this suggestion without even looking at what this was doing. re.sub could be used here afaik, if you make the replacement a func rather than a string.
def linkify_tag_ref(match: re.Match) -> str:
link = reverse("content:tag", kwargs={"name": match.group("name")})
return f"[{match.group()}]({link})"
...
content = COMMAND_REGEX.search(linkify_tag_ref, content):
It looks like this is currently missing proper support for tag groups (tags in directories under tags/), as there can be multiple tags with the same name under different dirs, and the github url template skips groups completely.
does this need to be its own field instead of using the name and a configured github url?
It's a remnant from when I was still using the API and it'd return the URL. If we leave things as is, I'll drop it, but it might come in handy for the groups.
@Numerlor I was not aware of the tag groups, is there an example of them currently?
@Numerlor I was not aware of the tag groups, is there an example of them currently?
I don't think any are currently used or that there are any real examples, but they're created through the directories I mentioned:
tags/
โโโ tag_group1/
โ โโโ tag.md
โโโ tag_group2/
โ โโโ another_tag.md
โโโ plain_tag_without_group.md
this structure would create two tag groups tag_group1 and tag_group2 with tag.md and another_tag.md in them respectively
GitHub Actions run 2853177224 failed.
GitHub Actions run 2853191233 succeeded.
GitHub Actions run 2853349054 failed.
GitHub Actions run 2853363482 succeeded.
Tag groups added in 2d65612. Due to the way tags are loaded in static previews, it was pretty easy to add in some under a fake group. Look for "very-cool-group" (these are sorted alphabetically like all the other tags, but we can place tag groups at the top of the list if we want to).
GitHub Actions run 2854325907 failed.
GitHub Actions run 2854342372 failed.
GitHub Actions run 2854352692 failed.
GitHub Actions run 2854575390 succeeded.
25db8f5 Explicitly Specify Infraction Time In Tests - HassanAbouelela
[python-discord/site] New branch created: fix\-infraction\-tests
The infraction tests checked that the route returned infractions in the correct order, which is based on insertion time. This can be fragile however since the insertion time can be very close (or identical) during the tests. I had this scenario happen to me 13 times in a row (before I gave up and investigated ๐). The issue became especially prevalent with PR #741 (commit 149e67b4) which improved database access speed.
This is fixed by explicitly specifying the insertion time, and spacing t...
GitHub Actions run 2854597444 succeeded.
Ended up making it a property in b4911d0
[python-discord/snekbox] New branch created: bump\-deps
This will also trigger snekbox to build on 3.10.6 after merge.
GitHub Actions run 2856219116 succeeded.
GitHub Actions run 2856466231 succeeded.
This PR is now ready for review again ๐
GitHub Actions run 2856800803 succeeded.
25675a1 feat(tags): add print-return tag - sid-maddy
b1313b6 style(tags/print-return): set the title prope... - sid-maddy
9ac1bda chore(tags/print-return): add the GIF to the repo - sid-maddy
41f6e4d fix(tags/print-return): use the raw GitHub URL ... - sid-maddy
4d68f4b Merge branch 'main' into sid/feature/tags/print... - ChrisLovering
Connected!
Description
The latex preamble determines which packages/commands are available to the user when writing .tex input for .latex command. The proposal is to include more packages in the preamble, which appears to be in sir-lancebot/bot/resources/fun/latex_template.txt. In particular, the proposed libraries extend the user-friendliness when writing maths by allowing bold symbols, calligraphic numbers, and creation of TikZ figures.
Reasoning
This update would put more of the commonly...
6193ee2 Globally decode binary responses from redis to ... - ChrisLovering
[python-discord/bot] New branch created: redis\-fix
The latest version of redis returns bytes by default, rather than strings.
This was in the 3.10 PR but must have been removed during a rebase conflict.
GitHub Actions run 2856938783 succeeded.
Appears to work in testing, fixes undecoded byte string regression.
[python-discord/bot] branch deleted: redis\-fix
Connected!
GitHub Actions run 2857008423 succeeded.
fce6ea2 feat: command for banning compromised accounts - dawnofmidnight
[python-discord/bot] New branch created: dawnofmidnight/compban
This PR adds a command to ban compromised users. It is the same as cleanban, but it bans specifically for 4 days and uses the typical ban reason.
Approval was granted [in Discord](#mod-meta message).
GitHub Actions run 2862035953 succeeded.
arrow.utcnow() + AUTO_BAN_DURATION results in an arrow object, which does not match the Expiry type hint.
This doesn't seem like an issue now, but may be broken in a future change, as an arrow object is not marked as supported.
Either we need to add arrow as part of the Expiry union, or change this to instead pass a datetime to cleanban.
Tested, works well. Thank you!
"""Same as cleanban, but specifically for the ban reason and duration used for compromised accounts."""
Oh, I copied that from this the following snippet. Perhaps I misunderstood what that does, I'll change that.
872281e Added mod alerted notice to auto-infractions - ionite34
Closes #2247
Summary
- Added notice that moderators have been alerted to all automated infractions.
Implementation
if reason:
- end_msg = f" (reason: {textwrap.shorten(reason, width=1500, placeholder='...')})"
+ end_msg = (
+ f" (reason: {textwrap.shorten(reason, width=1500, placeholder='...
GitHub Actions run 2862560524 succeeded.
Ah, it's wrong there too then ๐ . Feel free to make the same change there too if you like.
a7234a8 fix: change use of arrow to datetime and change... - dawnofmidnight
GitHub Actions run 2862706008 succeeded.
from datetime import timedelta
If using arrow as per other suggestion then this import would not be needed :)
arrow.utcnow().datetime + AUTO_BAN_DURATION,
Since the usage of datetime.utcnow() without a timezone is not preferred, and arrow is already imported, it might be better to still create an arrow time and pass the datetime property of it.
920096c Correctly initialise redis tests - ChrisLovering
[python-discord/bot] New branch created: Resolve\-silence\-test\-failures
Calling the cog_load from within the setUp function resulted in interaction with a RedisSession before it was initialised.
This wasn't noticed in CI as it only error under certain concurrency timings due to xdist.
GitHub Actions run 2863653394 succeeded.
[bot] Branch Resolve\-silence\-test\-failures was force-pushed to `e0b5933`
GitHub Actions run 2863940970 succeeded.
Appears to fix the current xdist parallel test errors, tested with some worker combinations on x64 Windows and ARM macOS
As part of the migration of the #discord-bots pinned content from discord to the site, this PR migrates the pin regarding on_command_error of the discord.py library "eating" (silencing) unhandled errors.
This PR also adds a few extra items, including:
- General markdown improvements, formatting
- Fixing a few inaccuracies (e.g generic
commands.BagArgumenthas been changed tocommands.MemberNotFound - An
elifstatement handling another error, showing users that they can handle an...
Connected!
GitHub Actions run 2864040137 succeeded.
Thanks for taking this over and fixing it up ๐
I have one comment, other than that seems alright, although I do think there is room for refactoring that could make it a bit cleaner. Given this is quite an old PR now i'd be happy if you'd prefer to leave it as is, although these are my thoughts:
It would be clearer to just have a loop that does all the checks necessary before incrementing the total. The logic to get the replied to message is also quite involved, so could be moved to a s...
What case is and not msg.reference meant to catch here? Should it be an or instead?
Ideally, I'd also like to add a bit more flavor-info to the pages, such as when they were last updated, and the authors that have worked on them, but the only way to get that data from the API is to request data for a specific commit, which means making ~100 requests in total. We can't do that without being rate-limited, but it could be something to consider. I also considered downloading the git repo (as opposed to the content only), but it doesn't seem the API returns that, we'd need to c...
Do we really need a second migration file for un-merged changes?
Probably better to merge the two migrations together, so that there's only 1 migration to run after merge.
The cache solution sounds smart, I'll look into that. In terms of downloading, I'm not sure there's a good way to bulk download files without downloading the entire repo, did you have a solution in mind?
I figured it was easiest to write, and easiest to use for reviewers, but yeah we can merge them.
f" (reason: {textwrap.shorten(reason, width=1500, placeholder='...')})."
Maybe?
Would it be possible to also add the unbanned actor and timestamp?
@Ibrahim2750mi yes, if you'd like to open a PR that would be appreciated!
Can we add 2 line breaks between the 2 lines?
@wookie184 do you know where is/are html file/files related to the issue located, I tried to find but wasn't able to.
@wookie184 do you know where is/are html file/files related to the issue located, I tried to find but wasn't able to.
GitHub Actions run 2868865205 succeeded.
GitHub Actions run 2868913931 succeeded.
The cache solution sounds smart, I'll look into that. In terms of downloading, I'm not sure there's a good way to bulk download files without downloading the entire repo, did you have a solution in mind?
I think the best solution is to just use the raw download urls from the contents api call. I don't believe count into the rate limits either so the only disadvantage is that is needs to be individual requests instead of bulk for the changed files, but that should only be a disadvantage w...
GitHub Actions run 2869853156 failed.
GitHub Actions run 2870009357 failed.
GitHub Actions run 2870113950 failed.
I added in the commit stuff, I think it turned out decently.
f2374900c4c83097c105b56de02ea82d66bd9466
It's alright if I take this issue, yes?
Noticed today that Python is highlighting some syntax that it shouldn't be:

I'm just taking it. Sorry, I really wanna fix it!
The syntax highlighting is done by Discord, rather than this bot.
It is also platform specific, with some platforms behaving weirdly as you describe. For example, here is what it looks like on my Windows machine:

Unfortunately, there isn't anything we can do ourselves, other than remove the syntax highlighting entirely, which we don't want to do.
If we are going to be storing the unban actor and timestamp, those should be added as fields against the infraction in site.
GitHub Actions run 2870657886 succeeded.
e68868e Added newlines and non-mentioned mod role - ionite34
Added period, newlines and non-mentioned moderator role in e68868e

GitHub Actions run 2870891168 succeeded.
GitHub Actions run 2870938978 succeeded.
GitHub Actions run 2871089548 succeeded.
[python-discord/bot] New branch created: invites\-validator\-url
fe5968c Added http/https normalization - ionite34
I'd like to tackle that one.
Closes #1948
Summary
This adds support for normalizing discord server invite links starting with combinations of http:// https:// or www

Implementation
+ RE_STRIP_HTTP = re.compile(r"https?://(www\.)?")
class ValidDiscordServerInvite(Converter):
async def convert(self, ctx: Context, server_invite: str) -> dict:
+ server_invite = RE_STRIP_HTTP.sub("", server_invite)
...
Demo

when trying to use stdin with the eval command, the bot breaks and gives an arbitrary response:

maybe there's some way to redirect a discord message to stdin when prompted?
if not, the bot should at least give some sort of nicer error when trying to use stdin rather than the EOFError
I think this is better solved by updating the base guild invite regex in bot-core, so that other bots that need to use it can also benefit from this fix.
https://github.com/python-discord/bot-core/blob/main/botcore/utils/regex.py#L5
Yeah, I eventually traced it to botcore so I couldn't change it without going upstream. Should we move the issue and close this PR ...
I think this is better solved by updating the base guild invite regex in bot-core, so that other bots that need to use it can also benefit from this fix.
https://github.com/python-discord/bot-core/blob/main/botcore/utils/regex.py#L5Yeah, I eventually traced it to botcore so I couldn't change it without going upstream. Should we move the issue and close this...
Currently, when you try to add an invite link to the invites whitelist, it is rejected if the given link begins with https://, http://, etc.
For example:
!whitelist add guild_invite https://discord.gg/aMZJ7NAr R Programming language
This results in a BadArgument error.
Fixing this should just be a matter of adding the prefix to the regex pattern.
Relevant parts of the code:
- the regex
- [the va...
I think this is better solved by updating the base guild invite regex in bot-core, so that other bots that need to use it can also benefit from this fix.
https://github.com/python-discord/bot-core/blob/main/botcore/utils/regex.py#L5Yeah, I eventually traced it to botcore so I couldn't change it without going upstream. Should we move the issue ...
[python-discord/bot] branch deleted: invites\-validator\-url
[python-discord/bot-core] New branch created: invite\-regex
We could check if EOFError is in the result (as well as maybe checking that "input" is on their code and the status code indicated an error), and if so add a message after the codeblock saying that input doesn't work with the bot.
Making input work would be more difficult, it would require changes to snekbox (the service used to run the code), and it's also not obvious how passing the input in discord would work.
perhaps this could be brought up on the snekbox repo then?
