#dev-log
1 messages ยท Page 99 of 1
Connected!
GitHub Actions run 2585985000 succeeded.
9d224c2 Add Selectable Styles To Code Field (#469) - HassanAbouelela
[python-discord/forms-frontend] branch deleted: make\-code\-selectable
[python-discord/site] New branch created: cj9\-qualifier
This pull request updates the now outdated information about the qualifier for Python Discord's 2022 Summer Code Jam.
GitHub Actions run 2586125446 succeeded.
fef6b3e Limit the ext cog to 1 action at a time - ChrisLovering
[python-discord/bot] New branch created: limit\-ext\-cog\-to\-1\-actionn\-at\-a\-time
Now that cog loading actually has lots of logic in it, rather than spawning tasks to do the actual load work, loading cogs can take time.
Previously we gave no feedback to the caller that something was actually happening. This could mean the caller would try to run the command again, possibly getting the cogs into a bad state.
This change both enforces only 1 action at a time, and gives the caller feedback that their action is in progress.
GitHub Actions run 2586146690 succeeded.
[bot] Branch limit\-ext\-cog\-to\-1\-actionn\-at\-a\-time was force-pushed to `2a32bc1`
GitHub Actions run 2586156766 succeeded.
This will block any extensions from loading/unloading while one is going, do we care? We could make the lock unique to each extension.
I'm not sure we care, the majority of these will take <5s, so the chance of an accidental overlap by 2 callers is very small.
If a single caller wanted to load.unload multiple exts then they could pass a list to the cog and it would work just fine.
I'm not sure it's worth the complexity.
GitHub Actions run 2586194710 succeeded.
GitHub Actions run 2586205293 succeeded.
GitHub Actions run 2586246504 succeeded.
GitHub Actions run 2586264720 succeeded.
GitHub Actions run 2586343615 succeeded.
Unfortunately, it appears that Netlify was ratelimited which caused the deploy and check to fail.
## Changing presence after logging in
Please look over the headers again, I have commented suggestions for the issues I found.
## Changing activity after a certain period of time
## Where should I change my bot's presence and when?
GitHub Actions run 2586653379 failed.
GitHub Actions run 2586654095 failed.
GitHub Actions run 2586656837 failed.
GitHub Actions run 2586658161 failed.
GitHub Actions run 2586659047 failed.
GitHub Actions run 2586659271 failed.
GitHub Actions run 2586659695 failed.
GitHub Actions run 2586699404 succeeded.
It took me for staff, but it's still stuck on thinking it needs an admin
That is because kosayoda made a commit to the PR, which nullifies their approval.
๐คฆ๐ปโโ๏ธ
You're correct we're just dumb, thanks
I am unresolving this because you still need to download the image and move it to the correct place. We cannot use Discord as a CDN.
Again, no need to prefix with an underscore
async def ping(self, interaction: discord.Interaction):
Forgetting to sync is a common mistake
- Then in the `setup_hook`, `self.tree.copy_global_to(...)` adds the slash command to the guild of which the ID is provided as a `discord.Object` object. Further up, `self.tree.sync()` updates the API with any changes to the slash commands. **Without calling this method, your changes will only be saved locally and will NOT show up on Discord!**
We also want to explain why we're binding it to self
- Next up `super().__init__(...)` runs the `__init__` function of the **Client** class, this is equivalent to `discord.Client(...)`. Then, `self.tree = discord.app_commands.CommandTree(self)` creates a CommandTree which acts as the container for slash commands, and binds it to the `discord.Client` subclass instance, so wherever you have access to it, you will also have access to the command tree.
@app_commands.checks.cooldown(1, 30)
Could we also add one section for changing presence on command? I see people trying this a lot and having a quick snippet would be useful
Sentry Issue: BOT-33V
ResponseCodeError: Status: 400 Response: {'deletedmessage_set': [{'embeds': {'0': ["Tag embed must contain one of the fields {'title', 'description', 'video', 'image', 'fields'}."]}}, {'embeds': {'0': ["Tag embed must contain one of the fields {'title', 'description', 'video', 'image', 'fields'}."]}}, {'embeds': {'0': ["Tag embed must contain one of the fields {'title', ...
faa51a3 Update Embed required fields to include url - ChrisLovering
[python-discord/site] New branch created: embed\-required\-fields
Sentry Issue: BOT-33V
ResponseCodeError: Status: 400 Response: {'deletedmessage_set': [{'embeds': {'0': ["Tag embed must contain one of the fields {'title', 'description', 'video', 'image', 'fields'}."]}}, {'embeds': {'0': ["Tag embed must contain one of the fields {'title', 'description', 'video', 'image', 'fields'}."]}}, {'embeds': {'0': ["Tag embed must contain one of the fields {'title', ...
Discord Embeds are now valid with just a URL, as seen by the linked sentry issue.
Closes #736 Closes BOT-33V
[python-discord/site] branch deleted: cj9\-qualifier
GitHub Actions run 2588693713 failed.
Django Channels adds WebSocket-support to Django - built on ASGI like other web frameworks.
Looks good, other than the floating tag.
Updated screenshot below. All links work as expected.

GitHub Actions run 2589073474 failed.
This is supposed to be a paragraph tag that is supposed to be closed below. It appears that I accidentally also removed the p.
7bedaeb add typing-extensions to snekbox - dawnofmidnight
[python-discord/snekbox] New branch created: dawnofmidnight/typing\-extensions
What the title says. I hope I did this right.
[python-discord/snekbox] branch deleted: dawnofmidnight/typing\-extensions
GitHub Actions run 2590705483 succeeded.
Looks almost as good as the author.
2de1d10 Fix help embed views - mbaruh
3d828f8 filter out headerlinks for descriptions - Numerlor
f14aa5c filter out source code tags, remove unnecessary... - Numerlor
b94f84b Merge pull request #2199 from Numerlor/doc-desc... - ChrisLovering
538f984 Merge branch 'main' into fix_return_button - ChrisLovering
adac8e8 Always prepend guild name to guild invite filters. - ChrisLovering
19f67db Include the list type when telling mods a new a... - ChrisLovering
111db69 Don't ping mods for autoban filters - ChrisLovering
af4339e Improved output format of guild autoban notific... - ChrisLovering
11f329f Rename filtering send log kwarg for consistency... - ChrisLovering
[python-discord/bot] branch deleted: always\-prepend\-guild\-name\-to\-guild\-invite\-filters
GitHub Actions run 2591621119 succeeded.
Connected!
GitHub Actions run 2591647082 succeeded.
GitHub Actions run 2591839254 succeeded.
9352ccf Don't try to connect to statsd_url if it's None - ChrisLovering
[python-discord/bot-core] New branch created: dont\-connect\-statsd\-if\-none
Going to approve this as the bug fixes are good, and the only outstanding points are type hint related.
The bug fixes are currently blocking Sir lance & metricity from using BotBase, so the we should raise an issue to fix the typehints in another PR.
[python-discord/bot-core] branch deleted: misc\-bug\-fixes
[bot-core] Branch dont\-connect\-statsd\-if\-none was force-pushed to `c5d3f41`
[bot-core] Branch dont\-connect\-statsd\-if\-none was force-pushed to `c5a561b`
[bot-core] Branch dont\-connect\-statsd\-if\-none was force-pushed to `6fb4b8c`
[python-discord/bot-core] branch deleted: dont\-connect\-statsd\-if\-none
[python-discord/bot-core] New tag created: v7\.2\.1
05c88f9 Add role creation to the Code Jam creation flow - D0rs4n
[python-discord/sir-robin] New branch created: cj\-add\-role\-creation
[python-discord/forms-frontend] branch deleted: snekbox\-results\-feedback
[forms-frontend] Branch display\-test\-failures was force-pushed to `1818426`
[forms-frontend] Branch display\-test\-failures was force-pushed to `016bce4`
This PR includes a few things:
- An update to the error message component (see 34d57f2). This is mostly standalone, but it's useful for another change
- Unittest failures now display the reason of failure. This was included in this PR, as the restructuring of formpage made it easier to accomplish
- Refactoring of formpage. This is where the bulk of the changes are, but it's mostly just a straight copy-paste of old code into new files. It does contain a few changes - which should hopefully ...
bf6bc0b Update CODEOWNERS - HassanAbouelela
[python-discord/forms-frontend] New branch created: cleanup\-codeowners
The braces here are inconsistent with the ones two lines above, but that's a style thing that doesn't really matter I don't think. It does seem to be consistent with a lot of the rest of the codebase (or at least, what I can see in this diff).
I think a common naming convention is to use PascalCase for types, and it'd be consistent with the below interface, but probably not a huge deal, or maybe there's some reasoning I don't understand.
4cdfb02 Update CODEOWNERS - HassanAbouelela
[sir-lancebot] Branch bot\-core\-migration was force-pushed to `39fb312`
f63f663 Cleanup Code Owners Comments (#475) - HassanAbouelela
[python-discord/forms-frontend] branch deleted: cleanup\-codeowners
[forms-frontend] Branch display\-test\-failures was force-pushed to `acb7df2`
Yeah that sounds like a fine change. acb7df25
b6718f6 Move startup checks and logs to their own cog - ChrisLovering
Why is this included if it's never used?
Is the idea that in the future, this function should just set a state, and something consuming that state will be responsible for doing showUnitTestFailures?
message and innerElement seem mutually exclusive, so this seems wrong. Not sure what a better design would be.
There's always the option to combine them into one ORed field, and then add instance checks in the code. I can do that.
It's always a string right now, but there's no way to legally assert that unless you add a type check.
Since we're setting the error variable based on this, another check will need to be added to handle the case where the error variable was not set. This never happens though, so it would be a bunch of fun error handling for an impossibility.
The larger issue here is that state is a map with no hard defined rules on type. The same is true of many things around the codebase, such as setting t...
I initially included some serialization and deserialization for the refresh button, and just didn't get around to removing it. I'll do that
That's one option, but mainly this is going to be important once we're switching between the sending state, and some other state. Some state change is going to be necessary.
Validation error can be merged into the initial state, but I set it to its own type here in case it proves useful for something else (such as moving the validation logic, or rewriting the scroll logic).
9696f52 Improve ErrorMessage Interface - HassanAbouelela
b83dff7 Remove Unused Prop From ErrorPage - HassanAbouelela
09f25be Codify Question State Type - HassanAbouelela
This took a lot more work than expected, but it's done now. 09f25bed
GitHub Actions run 2597442033 failed.
GitHub Actions run 2597441442 succeeded.
GitHub Actions run 2597449832 failed.
GitHub Actions run 2597453836 failed.
That's a separate topic and this guide only focuses on slash commands. I wouldn't be agreeing on that idea but I leave the rest to your judgement
GitHub Actions run 2597463998 failed.
GitHub Actions run 2597465939 failed.
GitHub Actions run 2597467972 failed.
GitHub Actions run 2597475445 failed.
GitHub Actions run 2597521320 failed.
GitHub Actions run 2597542179 failed.
GitHub Actions run 2597569537 failed.
GitHub Actions run 2597907159 succeeded.
GitHub Actions run 2598513222 succeeded.
One small thing, otherwise LGTM
This specification documents how the frameworks should interact with ASGI servers.
This reads better to me personally, thoughts?
GitHub Actions run 2599116343 succeeded.
Do with these what you want, in general it looks good tho ๐ง
Is the strip necessary here? Aliases shouldn't differ by leading/trailing whitespace unless someone intentionally modifies them, and you seem to subscribe to that idea given the content = snippets[name] which grabs an unstripped version (ie if the differences mattered we would be stripping that one too).
Working with that added strip yields:
names_by_content = defaultdict(set)
for name, content in snippets.items():
names_by_content[content.strip()].add(name)
...
Looks like the enumerate is to ensure tuple sorting is done properly in the case of equal scores, idk how much it matters particularly tho
Could replace 89-99 with:
for i, (names, content) in enumerate(grouped_snippets):
group_score = max(score(query, name, content) for name in names)
#or score(query, names, content) if modifying score
if group_score >= THRESHOLD: #saves sorting time?
scored_groups.append((group_scor...
The common_word_count function is being called multiple times redundantly. Perhaps modify to take a list of names: typing.Iterable[str], eg
return (
max(
common_word_count(query, name)
for name in names
)
+ common_word_count(query, content)
) / len(words(query))
If we're being even more pedantic, would try to minimise calls to words but i guess we don't necessarily care about the efficiency that much. I just kept this as the heuristic functi...
Any reason you casefold after using words instead of s1.casefold()? Would also result in the word pattern only needing lowercase but thats an aside.
Looks good, other than the floating tag.
Updated screenshot below. All links work as expected.

[python-discord/site] branch deleted: cj9\-frameworks\-reorder
9f275f1 Reorder frameworks after recommended use - Bluenix2
d4e9847 Reword CJ9 frameworks explanations - Bluenix2
9792dbc Add ASGI specification to list of approved CJ9 ... - Bluenix2
05cbea4 Add ASGI-card footer with link to specification - Bluenix2
1edf868 Remove italics from CJ9 framework cards - Bluenix2
This pull request adds a basic guide to hikari library for discord bots development.
deb9640 Base refresh timeout on diff from current time - ChrisLovering
[python-discord/forms-frontend] New branch created: update\-refresh\-timeout\-logic
Previously the logic was using the expiry date's unix timestamp as if it was a number of ms until it expired. This caused the timeout to be far after the actual token expiry.
GitHub Actions run 2602669836 failed.
[python-discord/forms-frontend] branch deleted: update\-refresh\-timeout\-logic
GitHub Actions run 2602697218 failed.
[python-discord/sir-robin] New branch created: pr\-integrate\-cj\-mgmt
[python-discord/sir-robin] branch deleted: cj\-add\-role\-creation
GitHub Actions run 2603859491 failed.
which punk wrote this?

9f275f1 Reorder frameworks after recommended use - Bluenix2
d4e9847 Reword CJ9 frameworks explanations - Bluenix2
9792dbc Add ASGI specification to list of approved CJ9 ... - Bluenix2
05cbea4 Add ASGI-card footer with link to specification - Bluenix2
1edf868 Remove italics from CJ9 framework cards - Bluenix2
GitHub Actions run 2605309027 succeeded.
The only thing I could think this might affect is displaying of deletion logs, but the template there doesn't seem to assume much about the data already, so I think this is all good ๐
[python-discord/site] branch deleted: embed\-required\-fields
GitHub Actions run 2605424740 succeeded.
GitHub Actions run 2605762290 succeeded.
Connected!
[snekbox] Branch feat/nsjail/101/create\-all\-cgroups was force-pushed to `e83e0d7`
84d5bac Capitalize the "D" in "Discord" - shenanigansd
[python-discord/bot] New branch created: shenanigansd\-patch\-1
"Discord" is a proper noun, and should be capitalized.
Signed-off-by: Bradley Reynolds
GitHub Actions run 2612273108 succeeded.
This PR is a masterpiece. There is no praise in any language that can describe the excellence of this PR and the importance of it to be included in the human history. This by itself has started a new era, An Era of Utopias ; A Golden Age. This PR is truly historical and has inspired me to drop all my professions, talents and job to observe this masterpiece repeatedly. The sheer knowledge of this PR has prevented my inevitable demise and has kept me from decaying out of the fabric of reality. ...
[python-discord/bot] branch deleted: shenanigansd\-patch\-1
Connected!
GitHub Actions run 2612290513 succeeded.
[snekbox] Branch feat/nsjail/101/create\-all\-cgroups was force-pushed to `5d841db`
Resolves #101
NsJail puts subprocess cgroups under parent cgroups. However, it does not create the parents automatically. Thus, snekbox has to do this. Previously, for v1, only the memory and pids cgroup parents were being created. Now, all four controllers supported by NsJail are also supported by snekbox.
It looks at the NsJail config to determine if a cgroup parent needs to be created. Basically, if a value is non-default, then NsJail will create a cgroup and thus will rely on a ...
60d00e0 Add test ignore to .flake8, enhance code consis... - D0rs4n
[python-discord/sir-robin] New branch created: redis\-debug
4efb257 Integrate Code Jam Management into the cj info ... - D0rs4n
GitHub Actions run 2619318802 succeeded.
GitHub Actions run 2625647142 succeeded.
9cb3e5f Add relevant test for bulk delete of channels, ... - D0rs4n
18fc747 Add test ignore to .flake8, enhance code consis... - D0rs4n
d90560c Integrate Code Jam Management into the cj info ... - D0rs4n
28fdacc Integrate Code Jam Management into the CJ remov... - D0rs4n
dfcdf89 Integrate Code Jam management into CJ move comm... - D0rs4n
[python-discord/sir-robin] New branch created: feat\-integrate\-code\-jam\-management
GitHub Actions run 2625764123 succeeded.
Okay, so Code Jam Management has been integrated into Sir Robin's CJ extension..but What changed?
First and foremost.. Roles!
I have added back team roles, and have updated the flows (later on those) accordingly!
Flows:
Creation flow:
So, cj create behaves a tiny bit differently. From now on, when you issue the command with a csv, you'll be sent a prompt to confirm, whether we actually want all that.. ๐ , you'll see how many channels, and roles will be created. Upon confir...
[sir-robin] Branch feat\-integrate\-code\-jam\-management was force-pushed to `f4ba2f1`
85f7625 Patch an interaction response in CJ to be ephem... - D0rs4n
move and remove commands need confirmation step.
ceaa135 Refactor CJ views to use partial when calling... - D0rs4n
d26924f Add JamConfirmation view, and refactor the CJ... - D0rs4n
37a023a Add confirmation message to cj move and `cj r... - D0rs4n
moveandremovecommands need confirmation step.
Done in 37a023a
we can move the startup greeting to bot-core too, since all our bots do the same thing, but in different ways
https://github.com/python-discord/bot/blob/main/bot/exts/backend/logging.py#L20
GitHub Actions run 2632360832 succeeded.
The test is failing intentionally at the moment because there's a placeholder for a thread that doesn't exist yet. You can test locally by simply defining it in your .env, and I'll commit the thread ID when we create it.
Everything works as expected, and I've tested that the limits do in fact get applied correctly. The PR looks good to me, with the exception of my comment.
This binding only works if the installed python version matches what you're expecting (/usr/local/bin/python), but will cause the test to fail if the user defines a non-default mount or exec_bin. Could we load the mounts and exec_bin from the actual config into here?
Something like this seems to do the trick
user_config = NsJail._read_config("./config/snekbox.cfg")
mounts = "\n".join((f"mount {{{mount}}}" for mount in user_config.mount))
config_base = dedent(
f"""
{mounts}\n
exec_bin {{{user_config.exec_bin}}}
"""
).strip()
Description
I think it would be great that if you replied to a message with .uwu and no other text, that lancebot would uwu-ify the replied-to message. Alternatively, add support for .uwu in a context menu!
Reasoning
We must allow .uwu in all its forms. But I think it would be a fun feature to implement and a good way to get familiar with our code base.
Proposed Implementation
If there is no message content, check if there is a message that has been replied to, and if ...
Issue approved. Iโll leave whichever implementation method desired up to the PR author. I donโt think context menus are great for discoverability but it might not hurt to have them.
The goal of this test is to ensure NsJail does not crash when each of the cgroups is configured. If the parent cgroup is not created properly, then NsJail will crash. Which process actually runs is of no concern for this test; I just had to specify something so NsJail can run. The tests run in the image, and we know the image contains Python, so using Python is a safe bet.
This is only true for users using the provided docker image, but on local installations, or on modified versions (which is my use-case), it will error. If we don't care about the specific command being python, let's use something else that's likely to exist in all environments. Perhaps something like ls could be a good choice.
[python-discord/bot] New branch created: tag\-dashmpip
625ea0f Add tag to use python -m pip to install packages - janine9vn
In the wild west of #python-general, we see a lot of issues where folks will use pip to install a package. Unfortunately, the pip they're using to install the package is not in the same version of Python that's used to actually run their code (we're going to specifically not talk about cases where a venv is created automatically for them and they don't realize for this PR and tag). This could be for a variety of reasons and will often lead down a rabbit hole of altering what's on PATH. ...
GitHub Actions run 2639191539 succeeded.
Connected!
GitHub Actions run 2639279191 succeeded.
d5f082e update .uwu to work with replies - shenanigansd
[python-discord/sir-lancebot] New branch created: gh1069
Relevant Issues
Fixes #1069
Description
Updates .uwu to check for content in a replied to message if the current message is empty.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and agree to the contributing guidelines?
GitHub Actions run 2639326009 failed.
GitHub Actions run 2639333644 succeeded.
[metricity] Branch message\-sync\-command was force-pushed to `404314d`
I'm going to implement bot-core into this repo and then rebase this PR on top of that, since it will make the addition of commands "cleaner".
[python-discord/metricity] branch deleted: remove\-opt\-out
Shouldn't we make this an optional clean_content as it was originally, or call the converter in the body of the function?
Seeing what we do below with the replies, we should probably call it in the body itself after getting the final text we'll be working with.
GitHub Actions run 2641480489 succeeded.
GitHub Actions run 2641513974 succeeded.
fa5c359e7b4adc36d963d951c5ae79908c82afa5
1cd363e Update .uwu to work with replies (#1070) - shenanigansd
[python-discord/sir-lancebot] branch deleted: gh1069
Connected!
GitHub Actions run 2641546573 succeeded.
Cloudflare Workers
A suggestion from Chris and Dorsan was to use cloudflare workers. There are two flavors to this suggestion:
- Upload the build output from actions to durable storage. This is a variation on
Intermediary Build Server, which means it has the same problems that would have. - Use a worker for the
GitHub Appidea. T...
7a43f23 Only close stats._transport if BotBase.stats wa... - ChrisLovering
[python-discord/bot-core] New branch created: fix\-stats\-close
[python-discord/bot-core] branch deleted: fix\-stats\-close
[python-discord/bot-core] New tag created: v7\.2\.2
c7051d0 Use more common binary for testing v1 cgroups - MarkKoz
GitHub Actions run 2642157146 succeeded.
GitHub Actions run 2642162044 succeeded.
Greetings @Diabolical5777,
What's your status on this PR, and the others you've put up? Will you be finishing them?
Please see this page on making commits with great messages, to increase users' knowledge of the update history.
Thanks!
84d5bac Capitalize the "D" in "Discord" - shenanigansd
3f83c7a Merge pull request #2207 from python-discord/sh... - ChrisLovering
625ea0f Add tag to use python -m pip to install packages - janine9vn
6372618 Merge pull request #2209 from python-discord/ta... - D0rs4n
a24142c Merge branch 'main' into dependabot/pip/request... - Xithrius
734f26b Bump requests from 2.15.1 to 2.20.0 (#2202) - dependabot[bot]
GitHub Actions run 2642203096 succeeded.
I feel like it is unnecessary to add an annotation here.
self.action_in_progress = False
Besides this, looks good.
Connected!
GitHub Actions run 2642217048 succeeded.
GitHub Actions run 2642223373 succeeded.
Connected!
GitHub Actions run 2642240701 succeeded.
GitHub Actions run 2642242270 succeeded.
GitHub Actions run 2642247315 succeeded.
a2067f8 Bump urllib3 from 1.24.3 to 1.26.5 (#2210) - dependabot[bot]
b55e643 Bump pycares from 4.1.2 to 4.2.0 (#1067) - dependabot[bot]
Connected!
GitHub Actions run 2642267381 succeeded.
Connected!
Connected!
GitHub Actions run 2642274920 succeeded.
Missing Optional or | None typing.
self, arg: str, possible_matches: list[str] | None = None, *, parent_command: Command | None = None
Looks good, just a slight type hint that could catch somebody out.
I will be creating another PR to solve this issue.
0b28019 Install botcore and bump deps - ChrisLovering
b0589b9 Move TZDateTime to avoid circular import - ChrisLovering
d3470a9 Migrate metricity to use BotBase from botcore - ChrisLovering
21212e5 Move all event listener logic to extensions - ChrisLovering
e9c7b7a Add a simple error handler cog - ChrisLovering
[python-discord/metricity] New branch created: botcore\-migration
[python-discord/snekbox] branch deleted: feat/nsjail/101/create\-all\-cgroups
[metricity] Branch message\-sync\-command was force-pushed to `a697f10`
[python-discord/sir-lancebot] New branch created: fix\-928
e4491be Update lint workflow to use python 3.9 - ChrisLovering
93bbed1 Update lint workflow to use python 3.9 - ChrisLovering
[metricity] Branch message\-sync\-command was force-pushed to `48860f8`
31fda77 Add github cache to flake8 ignore list - ChrisLovering
[metricity] Branch message\-sync\-command was force-pushed to `a49d54f`
8487592 Check If User Exists Before Sending Webhook - HassanAbouelela
[python-discord/forms-backend] New branch created: verify\-webhook\-user\-exists
GitHub Actions run 2642477261 succeeded.
GitHub Actions run 2642483357 succeeded.
There are 1 failures, 0 warnings, and 0 notices.
5f66288 Avoidance of malformed GitHub data. - Xithrius
Closes #928
Moved FetchError handling to fetch_data function, so no placeholder variables in returns need to be used.
FetchError is no longer a data class, but an actual error which inherets from Exception.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and agree to the [contributing guidelines](h...
Looks good, just a couple minor things
if isinstance(e, SUPPRESSED_ERRORS):
This will say Command None invoked by ... since we're catching CommandNotFound. For that case, we can use ctx.invoked_with.
GitHub Actions run 2642596414 succeeded.
9e3b819 Remove superfluous guards - ChrisLovering
0b28019 Install botcore and bump deps - ChrisLovering
b0589b9 Move TZDateTime to avoid circular import - ChrisLovering
d3470a9 Migrate metricity to use BotBase from botcore - ChrisLovering
21212e5 Move all event listener logic to extensions - ChrisLovering
e9c7b7a Add a simple error handler cog - ChrisLovering
[python-discord/metricity] branch deleted: botcore\-migration
[metricity] Branch message\-sync\-command was force-pushed to `2aa21cb`
da2ce49 Better logging practices are without f-strings. - Xithrius
GitHub Actions run 2642624450 succeeded.
Next, we need to add a cog error handler so raised FetchErrors are displayed to the users in a neatly formatted embed.
https://docs.python.org/3/howto/logging.html#optimization
and the ability to aggregate logs by arguments without having to do string matching (may not matter based on impl)
I'm in the middle of a review (sorry for taking so long!) but I ran out of time to finish it today :/ I'll submit my review tomorrow.
Hi @Xithrius
TBH I'm sorry, It completely slipped my mind.
But I'm willing to continue to work on this.
[python-discord/metricity] New branch created: dependabot
[sir-lancebot] Branch bookmark\-enhancements was force-pushed to `ec90fb8`
I've gone ahead and applied @wookie184's suggested fix and rebased onto main.
GitHub Actions run 2644517307 succeeded.
[bot] Branch limit\-ext\-cog\-to\-1\-actionn\-at\-a\-time was force-pushed to `0d19113`
Removed, and I rebased onto main.
GitHub Actions run 2644841919 succeeded.
9714f81 Add starlite and sanic to cj9 frameworks - mbaruh
[python-discord/site] New branch created: more\_frameworks
GitHub Actions run 2644908562 succeeded.
GitHub Actions run 2645230930 succeeded.
GitHub Actions run 2645283465 succeeded.
GitHub Actions run 2645284210 succeeded.
GitHub Actions run 2645285227 succeeded.
GitHub Actions run 2645494422 succeeded.
Code looks good, not sure about some grammar/content. I'll test soon.
Let's change it "does not exist in current jam". It's not actually correct currently, because it may exist in DB under another jam.
This comma after "teams" doesn't seem to fit here for me.
For me "Your team members:" sound better, but not 100% sure.
[python-discord/bot] branch deleted: limit\-ext\-cog\-to\-1\-actionn\-at\-a\-time
6e4b958 Limit the ext cog to 1 action at a time (#2205) - ChrisLovering
Connected!
GitHub Actions run 2645593608 succeeded.
You're right, maybe "teammates?"
49be850 Enhance wording in the CJ extension - D0rs4n
@python-discord/devops Can you advise on a reasonable output limit? Compressing responses is also an option (https://github.com/willnewton/falcon-compression), but not sure if it's necessary. What do you think?
Anywhere 5-10MB seems reasonable to me
744c221 Update Move flow, to handle same team correctly. - D0rs4n
We have more CPU resources than we can use so if you think it'll prove useful, compression sounds fine.
Description
We'd love to trial people having the ability to create threads within topical channels to have more focused and less disruptive help sessions.
In some of the busier topical channels, you'll often have multiple help chats going on at the same time. This can make it overall difficult to follow, a bit harder to help. It also may not be feasible to shift to a help channel because some of the help may be back and forth over a few hours, depending on availability of the people an...
If anyone would like to give suggestions regarding the wording, please do. I can easily change them, the core part is done, so now the wording the "priority".
[python-discord/metricity] New branch created: update\-staff\-channel\-logic
This allows for channels that are not within a staff category to be labels as staff channels.
I have also updated the list of staff categories & ignore list in the config-default.toml to include newly created categories.
Ensure reasonable default timeouts for threads, and once archived can only be brought back by the thread creator or a staff member/mod
Make sure bringing back a thread also respects the cooldown, re-archiving it if the user is currently on cooldown.
On question I have right now is what wee would expect to happen if the name is found in violation of our filters. Maybe just hard-deleting and notifying mods?
Also as for implementation, I think a redis cache of member_id: cooldown_expiry_ISO_datetime would be good here. making sure that on startup the bot uses await guild.active_threads() to ensure the cache is up to date.
On question I have right now is what wee would expect to happen if the name is found in violation of our filters. Maybe just hard-deleting and notifying mods?
You can delete threads?
I would also notify the user, so they know that it was actually deleted, and not just an error, so they don't keep retrying
[python-discord/site] Pull request review submitted: #722 Resources: Add The Algorithms, remove Atom
I've checked out your PR and ran site locally, everything looks good.
Just not sure how to check what was changed by the change to get_category_icon.py.
Can someone tell me what this does? I am unfamiliar. (Where do I check that this change worked?)
They're the icons at the bottom right in the following example

To confirm it works, find a resource that has the security category and confirm that at the bottom right you see a lock icon next to the security category for that resource.
GitHub Actions run 2646320745 succeeded.
Replaced with fa-solid fa-lock and confirmed it works
<img width="724" alt="image" src="https://user-images.githubusercontent.com/75038675/178166402-a4c8ad8f-1d6f-484d-aacb-c162d5b06723.png">
[python-discord/site] branch deleted: swfarnsworth/resources
GitHub Actions run 2646424544 succeeded.
GitHub Actions run 2646640263 succeeded.
GitHub Actions run 2646664490 succeeded.
Background on 7b40cd8
I've worked on this for a while, so here's a bit more information on why that part of the test suite was dropped. After some debugging, The custom setup for migration tests instantiates a few model instances. Going from django 3.1.14 (what we were on) to 3.2.0 (the version directly after) introduces behavior that breaks this. At some point between the setup and the actual test the (already created) instances' _meta model gets updated to the latest model, whi...
Added the do not merge tag. I think it's best if dev-ops is on hand for this. We should create a DB backup before deploying.
GitHub Actions run 2647156607 succeeded.
Good catch, though we need to use Optional from the typing module since the project is running on 3.9 and not 3.10.
ab9277f Update function type annotations - RohanJnr
GitHub Actions run 2647172148 succeeded.
I'm hoping Sebastiaan could provide some context on why it was added in the first place. If it's still relevant, I'll work on reintroducing it.
It was introduced because we were writing code that would directly affect import production data, namely a data migration that would directly touch all of our infraction records.
This allowed is to test the code that we were writing.
These days, there are a few packages available that basically implement this functionality without having to do it...
Hello,
I have a question about the discord bot function, Can i create the sync function to get messagess from discord? Async function create some troubles on my app.
Looks good, I'll leave the final approval to @ichard26 so it doesn't auto-merge.
Looks good, just a slight type hint that could catch somebody out.
Since you asked for one, I've gone through and reviewed all the language in this PR. It all looks great to me, I have no objections.. and I'm pretty anal when it comes to language.
I think this seems ready to merge.
move and remove commands need confirmation step.
[sir-robin] Branch feat\-integrate\-code\-jam\-management was force-pushed to `c13935f`
Since you asked for one, I've gone through and reviewed all the language in this PR. It all looks great to me, I have no objections.. and I'm pretty anal when it comes to language.
I think this seems ready to merge, once the linter is appeased. Looks like there's some trailing whitespace to sort out.
Shouldn't have happened, I pushed a patch, the linter should work.
05c88f9 Add role creation to the Code Jam creation flow - D0rs4n
6184740 Integrate Code Jam Management into CJ Create, a... - D0rs4n
481cd22 Make compliant and port the code jam tests from... - D0rs4n
515ab15 Integrate Roles, and Code Jam Mgmt into the CJ ... - D0rs4n
ea9de19 Add relevant test for bulk delete of channels, ... - D0rs4n
[python-discord/sir-robin] branch deleted: feat\-integrate\-code\-jam\-management
Connected!
All changes look good
All changes look good
a09130a Update staff category list, and add another ign... - ChrisLovering
9cc928e Update 3.9-style type hints in config.py - ChrisLovering
efb692e Add support for staff channels that are not in ... - ChrisLovering
7a35591 Merge branch 'main' into update-staff-channel-l... - HassanAbouelela
127e0c3 Merge pull request #20 from python-discord/upda... - HassanAbouelela
[python-discord/metricity] branch deleted: update\-staff\-channel\-logic
This PR adds support for adding aliases and alternative names for tags and showcases it with two existing tags.
It uses the metadata functionality and will look for the "aliases" key. It then adds the alias names to the Tags dictionary that gets searched through when trying to match a tag directly.
This doesn't check for duplicate aliases as there wasn't a good way to do that validation ahead of time. It also didn't feel like a good solution to iterate through all TagIdentifiers to find...
GitHub Actions run 2650951941 failed.
f8bb952 Add alias support for tags - janine9vn
85e3728 Add "minusmpip" alias - janine9vn
87a8d36 Add f-string tag aliases - janine9vn
803057e Merge branch 'tag-aliases' of https://github.co... - janine9vn
GitHub Actions run 2651054778 succeeded.
Connected!
GitHub Actions run 2651316488 succeeded.
Is your question about this bot or is it about a Python library for Discord?
GitHub Actions run 2652507121 succeeded.
I'm not happy with the current state of documentation for the API, as it requires looking through docstrings in the source code. I've been considering using an OpenAPI specification and generating a website with documentation using SwaggerUI or ReDoc.
Because snekbox is intended to be hosted by the users, I believe users would find the documentation more convenient and accessible if hosted on GitHub pages. The alternative would be to add a route to Falcon, but this would require users to b...
fef65a6 Add support for viewing and adding CJ Infractio... - D0rs4n
[python-discord/sir-robin] New branch created: pr\-cj\-infr\-notes
- From now on the
cj infocommand has a view attached to it. You can either view all the notes added to the specific participant, or you can add one. Adding a note is accomplished by triggering a modal from the view, which then calls the code jam management api on submission.A new kind of interaction check has been implemented for this view, since from now on, all of the admins can use the view regardless of the original author.
Description
The current .uwu feature does not handle or preserve external emojis
Steps to Reproduce
Example 1

Example 2

Expected Behaviour
Either ignoring external emojis, preserving them in place (may not be possible), or transforming them into emoticons instead of the normal text-transform rules. In my opinion, the emoticon replacement is most suitable.
#...
instead replacing the custom emoji with a random emoticon from the emoticon list.
Since this command is just for fun, I think this approach is fine.
Couldn't we make use of the emojis library, that is already a dependency?
https://github.com/alexandrevicenzi/emojis
Couldn't we make use of the
emojislibrary, that is already a dependency? alexandrevicenzi/emojis
Well, built-in emojis do work right now. And third-party emojis (such as those in python-discord) would work if the bot is in the server.
However third-party emojis wouldn't be able to be sent since SirLanceBot isn't in those servers, and as such doesn't have access to post those emojis. This is what this issue is for.
Connected!
Connected!
Connected!
Connected!
Connected!
bd7e7a8 Run Tests On Non-Durable Database - HassanAbouelela
[python-discord/site] New branch created: speedup\-tests
Runs the test suite on a copy of the database which does not have any durable optimizations to greatly reduce the runtime of the tests. Locally, I've observed a drop from ~5 minutes to 20 seconds.
I've left a reference with more information about the settings we've turned off, but they all boil down to persistence across restarts and crashes, not things we need to worry about for tests.
GitHub Actions run 2653635587 succeeded.
GitHub Actions run 2653666157 succeeded.
Does this mean it's going to run two instances of the db?
What's the point of separate URLs if they're identical anyway? Do we need the flexibility to make them different if we want?
Yes, it does. There's the option of not adding this to the depends-on and letting people manually invoke it if we don't want that.
They're both needed as one is used in the migrations, and one is used in the tests. Making them one environment variable would be annoying as locally and in the compose they aren't going to refer to the same thing.
Well, Docker Compose is intended to only be used for development purposes, right? So why don't we just always disable durability? I don't think anyone would cry over development data being lost in the rare case of power loss or a crash.
That's a fair point, I don't see a good reason not to.
Oh sorry, I see that they are different by default in docker-compose.yml. I confused this file with docker-compose.yml.
I wasn't able to find time to do a full review with manual testing (and I feel bad about delaying the PR even more), so consider this just a read-through review. On that note, it looks good except for a poorly written comment.
# Check if parent command is valid in case subcommand is invalid.
While trying to merge both databases as per Mark's suggestion, I made an interesting discovery. At first, the merge seemed to slow the tests again, despite nothing having really changed. Upon closer inspection, the port I defined on the service, was slightly different from the one we currently have (127.0.0.1:port:port current vs port:port my change).
I can't explain it, and it's possible I have something messed up in my networking, but I can reproducibly demonstrate it makes an order ...
I love it. I love everything about it.
GitHub Actions run 2653884216 succeeded.
For future reference, there isn't really a point in changing this as its deprecated
https://github.com/compose-spec/compose-spec/blob/master/spec.md#version-top-level-element
A Compose implementation SHOULD NOT use this version to select an exact schema to validate the Compose file, but prefer the most recent schema at the time it has been designed.
Maybe there are still some tools that are not respecting this advice?
Would be nice if this ran migrations too.
My compose does use the behavior you described above, so I'd be happy to remove it. The reason I bumped it is because our current compose is using features that weren't even introduced in 3.6, and I wanted to fix the linting issues.
Does docker-compose still rely on it (notice the dash)? Maybe wait until that's completely phased out? I don't really know. It doesn't hurt to leave it for now I guess.
That sounds fine. Would you prefer the initial approach of putting it in the manage.py, or should we do it here?
Doing it in manage.py would be better so it still works without reliance on Poetry's task.
And you could also avoid useless stuff like collecting static files
GitHub Actions run 2653925704 succeeded.
GitHub Actions run 2653940001 succeeded.
GitHub Actions run 2653988504 succeeded.
72d0f1f Make Awaiting Workflow Run A User Responsibility - HassanAbouelela
b6ae16d Fix Status Code Check - HassanAbouelela
[python-discord/bot] New branch created: mbaruh/regex\-tag\-fix
GitHub Actions run 2655981299 succeeded.
Connected!
GitHub Actions run 2656010048 succeeded.
Description
This PR adds an API route, which uses a github app (not to be confused with OAuth apps) to return a download URL for the static preview artifact. This should allow us to get around the rate limiting issues that we've been experiencing in #728.
A bit more info on my approach:
Q. Why a GitHub app?
A. It provides the most granularity in terms of permissions. We can get very specific about ...
GitHub Actions run 2656072574 succeeded.
08ee93b Fix incorrect type hints - shenanigansd
[python-discord/sir-lancebot] New branch created: type\-hint\-fixes
Relevant Issues
Raised by !! Ritik Ranjan [*.*]#9230 in #python-discussion message
Description
Fixed incorrect type hints in two files.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and agree to the [contributing guidelines](https://pytho...
GitHub Actions run 2656724804 succeeded.
Actually, game_over could be called with either discord.ClientUser or discord.Member as far as I can see. In this situation it does not matter so much, but it's something I wanted to note.
15224b0 Add revival of code role to self-assignable - camcaswell
[python-discord/bot] New branch created: revival\-of\-code\-role
GitHub Actions run 2657534964 succeeded.
Connected!
GitHub Actions run 2657627295 succeeded.
Several popular bots have the capabilities for "reaction roles", where a bot will send a message in a channel, with one reaction per role, and when a user reacts with a reaction, they will be assigned the specified role.
Here a couple of examples:
https://dyno.gg/docs/en/modules/reactionroles
https://mee6.xyz/tutorials/allow-users-to-self-assign-roles-in-discord-with-the-mee6-bot-reaction-roles
Replacing !subscribe with reaction roles will greatly reduce the amount of spam and confu...
The idea to support a persistent message to self-assign role is a good idea. Maybe a message in #roles or something.
I would suggest we use a persistent view with buttons, rather than reaction based roles though.
This is something I remember suggesting before but it was denied I'm pretty sure but I can't remember the reason...
Oh lmao, Chris beat me ๐
A benefit of using a persistent view/slash command is that we can send the user an ephemeral message telling them whether the role was assigned or removed.
The idea to support a persistent message to self-assign role is a good idea. Maybe a message in #roles or something.
I would suggest we use a persistent view with buttons, rather than reaction based roles though.
We could even make this a slash command.
Yeah I agree, although I would prefer a persistent view, as it's much more consistent than having a slash command.
Description
Allow .uwu to work on replied messages whenever no text argument is provided.
Reasoning
Pretty self-explanatory; means you can just reply to a message instead of having to manually copy-paste the content as the command argument.
Proposed Implementation
A simple if statement checking whether a text argument was provided, and if not whether a message was replied to.
Would you like to implement this yourself?
- [x] I'd like to implement this fea...
AFAIK this already exists?
Sorry, I said the wrong command. I meant .randomcase ๐ฐ
Ah I see now.
Since this in a few places now, I think we should make a custom converter that has the behavior, rather than duplicating code
Since this in a few places now, I think we should make a custom converter that has the behavior, rather than duplicating code
Yeah, I'd agree with that. Should I replace the existing implementations too?
What would be a good converter name? Perhaps something along the lines of TextOrReply?
Yea, we should replace existing implementations of this.
maybe TextOrReplyCleaned, to indicate we run clean_content over it too, but that sounds good.
Would this be better in bot-core so that we can use it in bot too? (Does bot even need this?)
Yea, that could work. We should start adding converters to bot core more often.
As per sir-lancebot#1074, we should add a CleanedTextOrReply converter which will allow an argument to be provided either by text, or by replying to a message (if an invocation has both then use the text).
There's currently no file for converters, so we'd need a new file -- either botcore/converters.py as per bot structure or botcore/utils/converters.py as per sir-lancebot structure.
I'd like to implement this myself.
[python-discord/sir-lancebot] Issue opened: #1075 \`\.uwu\` doesn't work when replying to an embed\.
Description
Using .uwu when replying to an embed doesn't work, but it does work if you pass a message link to an embed.
Steps to Reproduce
Run .uwu while replying to an embed.

Expected Behaviour
Return an embed with its contents uwuified.

#...
Description
When Sir Lancebot creates an embed listing multiple GitHub issues, the issues are not in the same order that they were in in the orginal message
Would you like to implement this yourself?
- [ ] I'd like to implement this feature myself
- [x] Anyone can implement this feature
7a5e4b7 don't use a set for issues to preserve order - shenanigansd
[python-discord/sir-lancebot] New branch created: gh1076
Relevant Issues
Fixes #1076
Description
Now using a list instead of a set to preserve the order.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [X] Read and agree to the contributing guidelines?
[python-discord/sir-lancebot] Checks Successful on PR: #1077 Preserve order for GitHub issues embeds
GitHub Actions run 2659758096 succeeded.
I'd consider using more_itertools.unique_everseen here if the library can be added as it should be clearer than the dict. Adding the issue number before the issue title should also help with matching up the issue numbers to their issues, as it is more tasking to match them up yourself even when ordered
seems to be a duplicate of #743
seems to be a duplicate of #743
My mistake, closing in favor of #743
5651786 display repo name and issue number in issues embed - shenanigansd
[python-discord/sir-lancebot] Checks Successful on PR: #1077 Preserve order for GitHub issues embeds
GitHub Actions run 2659836264 succeeded.
Relevant Issues
Fixes #1072
Description
6db84b38568d3f53c1b1bec4c66c1c8f2ee7b1ac
- Added pattern
RE_EMOJIto capture emoji markdowns - Implemented
Emojidata class for emoji information and displayability inferencing - Added function
_ext_emoji_replaceto replace external undisplayable emojis with random emoticons - Added call to
_ext_emoji_replaceat the end of_uwuify
Fixes / formatting
202d53b3f7ebe4d6041a2e5a4c1419bc16b27e11
- Added type checking annotatio...
@AbooMinister25 Would you like me to assign you, or do you wish to wait for someone else first?
GitHub Actions run 2659956925 succeeded.
GitHub Actions run 2659975634 succeeded.
issues = list(unique_everseen(issues))
The function returns an iterator which does not have a length that is checked below
60a92e8 use list() to pull iterable into list - shenanigansd
GitHub Actions run 2660142303 succeeded.
Haven't set up the bot to try this out but here is a code review for now.
Who does "team" refer to in this case? Maybe it's better to state it like this
await interaction.response.send_message(":x: Something went wrong! Full details have been logged.")
This goes against our style guidelines, and it's inconsistent with other code in this bot. In fact, it's inconsistent with other code in this PR's diff.
Actually, it uses a slightly different endpoint. As for viewing a note, we need the participation history, which contains infraction related data from all the previous jams, whereas the endpoint what we call in on_submit is another endpoint that returns data regarding the current jam, as we're going to add infraction in regards of the current jam.
Poorly formatted, must have accidentally formatted it with PyCharm. I'll patch it immediately.
If the endpoints are different, the endpoint could be an argument for the new function this is moved to. The error handling is the same and that's the bulk of the code.
01ff98c Enhance code consistency in the CJ extensions - D0rs4n
Description
Infraction messages (such as temp-mute) currently display a time that is almost always 1 least-significant unit less than the requested time.
Examples
1 hour -> 59 minutes 59 seconds

1 day -> 23 hours 59 minutes

Possible solutions
Option 1. Keep track of the original requested time duration as part of the infractions data, and return a read...
Right! More specifically the annotation should be Union[ClientUser, Member]
once linting is sorted we can merge this PR
@ChrisLovering sorry for the long wait since I thought this PR was done, but the linting seems to be fine now.
2cb8c19 Fix f-strings, parenthesized expression whitesp... - thatbirdguythatuknownot
Connected!
GitHub Actions run 2664541186 succeeded.
GitHub Actions run 2664809438 succeeded.
GitHub Actions run 2665274947 succeeded.
GitHub Actions run 2666331839 succeeded.
[python-discord/bot] New branch created: 3\.11\-snekbox
This PR updates the snekbox cog to run using Python 3.11 by default, and send a button with the code output response:

Clicking this button allows the use to re-run their same code, but under 3.10.

Clicking this button deletes the previous response and sends a new r...
GitHub Actions run 2666407514 failed.
GitHub Actions run 2666504333 succeeded.
It's not an "alternative language"; just a different version of the same language.
I would rather use the lock decorator for this. Would result in less state to manually manage. For a custom error message you can use a custom command error handler.
Related to: https://github.com/python-discord/bot/issues/2130
To echo @mbaruh in the other issue, I'm also in favor of removing the redundancy here. It would simplify the overall process to use the discord timestamp. There might be an edge case for having duration (in N hours/days) for visual cues on the rare cases !mute ... 15M becomes !mute ... 15m. Beyond that, the timestamp rendered in Discord serves the purpose well.
[python-discord/site] New branch created: cj9\-changes
This PR makes some last changes to the code jam 9 approved frameworks and rules which have been discussed these last days. See the commit history for a detailed list of changes.
GitHub Actions run 2667235844 succeeded.
The capitalization here looks weird, IO is an abbreviation that should also be capitalized. But looking through the docs, only the title of the main page had AIOHTTP capitalized while all other uses are lowercase
<p class="subtitle">aiohttp</p>
<p>aiohttp provides both a client and server WebSocket implementation, while avoiding callback-hell.
https://github.com/python-discord/site/blob/7511c6d4aff6f3ad31ccb43c00226a9187d7ece1/pydis_site/templates/events/pages/code-jams/9/_index.html#L27-L28 is also currently missing strike through for dates that have passed
3c4fd7299995769a6c691ab977a516f005fb3f08
GitHub Actions run 2667301422 failed.
GitHub Actions run 2667312900 succeeded.
GitHub Actions run 2667413854 succeeded.
GitHub Actions run 2667452423 succeeded.
Thank you for bringing that up, I was considering opening another PR for those changes, but I might as well include that here on second consideration. I have now commited that
GitHub Actions run 2667505143 succeeded.
should have a port configuration
GitHub Actions run 2668957003 succeeded.
[python-discord/bot] New comment on pull request #2218: Allow snekbox to run in both 3\.10 and 3\.11
Being able to run in 3.11 sounds good.
I'm not sure that the button to change versions is worth the added clutter given that in the vast majority of cases of eval commands the version wouldn't make a difference.
Was having a separate command like !eval3.10, or an optional argument like !eval 3.10 considered?
[python-discord/bot] New comment on pull request #2218: Allow snekbox to run in both 3\.10 and 3\.11
Being able to run in 3.11 sounds good.
I'm not sure that the button to change versions is worth the added clutter given that in the vast majority of cases of eval commands the version wouldn't make a difference.
Was having a separate command like
!eval3.10, or an optional argument like!eval 3.10considered?
This PR does add optional argument to the commands too.
The thoughts behind the button is if the user runs into a 3.11 problem, they can easily switch to 3.10 an...
[python-discord/bot] New comment on pull request #2218: Allow snekbox to run in both 3\.10 and 3\.11
Something that could reduce the clutter would be making the delete action a button too, so it's inn line, rather an emoji below.
GitHub Actions run 2671692670 succeeded.
Lastly, working with subprocesses (through stdin/stdout or <code>multiprocessing.Pool()</code>/<code>concurrent.futures.ProcessPoolExecutor()</code>) is also exempted from this rule.
Everything else looks great!
GitHub Actions run 2671991371 succeeded.
As per discussion with @minalike in dev-contrib, I'll be working on this :)
d228dff Update !modpings off confirmation to use a di... - TizzySaurus
[python-discord/bot] New branch created: fix\-bot\-2168
Closes #2168.
The embed confirmation in !modpings off has been removed in favour of a standard message using the new discord timestamp feature to show both the date and time.
NB: Currently untested as on holiday, but everything should be good. I've added the "do not merge" tag until this is verified.
Pending discussion on the server, this wording feels a little clumsy. Would this be better?
An exception to this rule is that communication with databases and files is allowed for accessing resources or for storage purposes.
For example, you may use PostgreSQL as a database but not its `NOTIFY` command.
Working with subprocesses (through stdin/stdout or <code>multiprocessing.Pool()</code>/<code>concurrent.futures.ProcessPoolExecutor()</co...
GitHub Actions run 2672628453 succeeded.
[python-discord/bot] New review comment on pull request #2089: Feat: add ability to snooze reminders
I don't see any potential moderation issues, and Zig is okay either way so I'll go ahead and make this ephemeral :+1:
[python-discord/bot] New review comment on pull request #2089: Feat: add ability to snooze reminders
Would I have to create a new view to achieve this?
[python-discord/bot] New review comment on pull request #2089: Feat: add ability to snooze reminders
Yep, I've fixed this by doing datetime.now(timezone.utc), as per the docs' recommended way.
NB: This is stalled by python-discord/bot-core#100
Upon further discussion in dev-contrib, Zig and I have realised this will actually need to be a util function and not a converter, as converters require an argument to passed which won't always happen here.
1be1343 Add clean_text_or_reply util. - TizzySaurus
[python-discord/bot-core] New branch created: bot\-core\-100
Closes #100.
Does what the title says.
This util function will clean text if provided, else try and clean the referenced message, or if text isn't provided and was unable to get a reference message will return None.
This is useful for commands such as lancebot's .uwu and .randomcase where users can either provide a text argument, or reply to a message and have the bot use the replied message's content.
[python-discord/bot] New review comment on pull request #2089: Feat: add ability to snooze reminders
Upon further inspection, I don't see this? self.select_snooze_duration is a method, so doesn't give us the Select menu.
[python-discord/bot] New review comment on pull request #2089: Feat: add ability to snooze reminders
Unless anyone else has any issues with this, I think I'll just leave it. From what I can tell there's no harm in having this safety net.
3a40b20 Make clean_text_or_reply async - TizzySaurus
I believe I did it to be able to customise the format (add extra words between date and time) but in hindsight it's rather unnecessary, so have change to use the DATETIME option.
b7e0361 Address Reviews - TizzySaurus
GitHub Actions run 2673210689 failed.
This latest commit is untested as I'm on holiday, so have added the "do not merge" tag to make sure it doesn't get merged before confirming it all works as planned.
Hey @mtkumar123, were you able to resolve this, and are you still looking to work on the issue?
I was kind of going back- and forth- on something like this, but couldn't quite formulate it like you just did. I'll apply that.
974c554 Reword new codejam rule exception clause - Bluenix2
GitHub Actions run 2673708705 failed.
GitHub Actions run 2673728084 failed.
GitHub Actions run 2673933275 succeeded.
GitHub Actions run 2673979064 succeeded.
As of python 3.10 I believe, matchcase is supported in python. It would make sense to create a tag command for it outlining the purpose and an example on how to use it.
I think the feature is fairly complex; it has 7 different patterns, for example. What aspects do you expect to be covered that would still fit within the scope of a tag?
Connected!
GitHub Actions run 2674690093 succeeded.
It should have a short summary such as
"Match case is a 3.10+ feature that allows you to execute statements based on the result of an operation"
`resp_code = requests.get('https://pythondiscord.com')
match int(str(resp_code)[0]): # get the first letter of the response
case 2: # resp_code started with 2
print('Request was successful!')
case 3: # resp_code started with 3
print('You are being redirected.')
case 4: # resp_code started with 4
print('Cl...
Listing all of the patterns is not practical for a tag, basic usage of match seems more reasonable.
That is a poor example because it's using it as a switch statement. It does disservice to how powerful it actually is. Its point is to match patterns, not just be a replacement for if/else.
Move the feature that displays the lines of code from GitHub when a link with line numbers is sent from Python to Sir Lancebot
Approved by @Xithrius here: #dev-contrib message
Connected!
GitHub Actions run 2679372641 succeeded.
[python-discord/sir-lancebot] New comment on issue #1079: Port GitHub code display embed from Python
For reference, this is the location of said feature.
[python-discord/sir-lancebot] New comment on issue #1079: Port GitHub code display embed from Python
@shenanigansd has stated in #dev-contrib that they're not wishing to implement this themselves, so I'd like to claim this. Can I please be assigned?
Connected!
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
[python-discord/site] branch deleted: cj9\-changes
GitHub Actions run 2680067494 succeeded.
GitHub Actions run 2681374731 succeeded.
It wasn't, it must have been a sentinel value previously and I thought it was used somewhere. removed in https://github.com/python-discord/bot/pull/2218/commits/0817398c8d05a16d9a0d1ab272e66ef9858f35c8
You're correct, it only needs to be a invokation:response mapping https://github.com/python-discord/bot/pull/2218/commits/0817398c8d05a16d9a0d1ab272e66ef9858f35c8
GitHub Actions run 2682285803 failed.
c7d364d Exapln why job check is required when continuin... - ChrisLovering
Attempted to do this in https://github.com/python-discord/bot/pull/2218/commits/43c6abaeb6047d3566c31db2e0df6f5b42171289 isn't working for some reason though, investigating...
GitHub Actions run 2682298554 failed.
Unfortunately, it seems like Discord doesn't support sending videos in embeds.
Trying to call the Embed.set_image with a video URL results in the embed just showing a loading animation.
Since the point of this feature was to add support for images and videos, we'll have to go with the other approach of adding a new command instead.
Would it be a good idea to rework the tags command to send a media lin...
GitHub Actions run 2682435038 succeeded.
To include all of that in a single, quick tag would be difficult. Maybe it's best to leave it be.
GitHub Actions run 2682497863 succeeded.
We discussed some of the general plans and attribution for this feature [on discord](#dev-contrib message), and I think we have a decent idea. Issue is approved.
GitHub Actions run 2682573643 succeeded.
GitHub Actions run 2682608524 succeeded.
9278758 Add a generic view and button - ChrisLovering
[python-discord/bot-core] New branch created: add\-interaction\-utils
The view implements an interaction check for allowed_users and allowed_roles.
The button deleted the message attached the the parent view on click.
[bot-core] Branch add\-interaction\-utils was force-pushed to `dcac08c`
[bot-core] Branch add\-interaction\-utils was force-pushed to `c20c19c`
Lucky for you, bot-core is an efficient machine.
I wonder what happens if these refs are removed eventually. 404s?
[python-discord/bot-core] branch deleted: add\-interaction\-utils
[python-discord/bot-core] New tag created: v7\.3\.0
fc7e828 Use generic views from botcore for snekbox - ChrisLovering
The name of this file should be lowercase.
"""Return a view that allows the user to change what version of Python their code is run on."""
# This can happen when a button is pressed and then original code is edited and re-run.
GitHub Actions run 2682980086 succeeded.
Yea, blocking here causing the discord UI to say the interaction failed. Discord only acks after the callback finishes.
Because the eval command defaults to 3.11, it would make more sense for the 3.11 service to start by default and for the 3.10 service to be opt-in.
This file has been deleted and moved to bot-core.
This has been moved to bot-core with slightly different wording.
https://github.com/python-discord/bot-core/blob/main/botcore/utils/interactions.py#L65
GitHub Actions run 2683016807 succeeded.
Hmm I donโt quite like this solution. The 3.11 image is ~2x the size because of the dependencies. Could we make the default an environment setting?
Yea, we could make it default to 3.10 in dev to avoid contribs having to clone the hug image, and then have it be 3.11 in prod.
Alternatively, we could build and push a 3.11 image without deps.
[python-discord/bot] New comment on pull request #2218: Allow snekbox to run in both 3\.10 and 3\.11
I get the following error when trying to use the delete button
2022-07-16 13:56:31 | discord.ui.view | ERROR | Ignoring exception in view <ViewWithUserAndRoleCheck timeout=180.0 children=2> for item <DeleteMessageButton style=<ButtonStyle.secondary: 2> url=None disabled=False label='Delete' emoji=None row=None>
Traceback (most recent call last):
File "/home/mark/repos/python/bot-pydis/.venv/lib/python3.9/site-packages/discord/ui/view.py", line 412, in _scheduled_task
await it...
f99b395 Fix interactions.DeleteMessageButton not workin... - ChrisLovering
[python-discord/bot-core] New branch created: fix\-delete\-button
[python-discord/bot] New comment on pull request #2218: Allow snekbox to run in both 3\.10 and 3\.11
I get the following error when trying to use the delete button
2022-07-16 13:56:31 | discord.ui.view | ERROR | Ignoring exception in view <ViewWithUserAndRoleCheck timeout=180.0 children=2> for item <DeleteMessageButton style=<ButtonStyle.secondary: 2> url=None disabled=False label='Delete' emoji=None row=None> Traceback (most recent call last): File "/home/mark/repos/python/bot-pydis/.venv/lib/python3.9/site-packages/discord/ui/view.py", line 412, in _scheduled_task
...
Works. But why are we allowing features to get merged without performing even a basic test? This bug was not difficult to catch.
[python-discord/bot] New comment on pull request #2218: Allow snekbox to run in both 3\.10 and 3\.11
Error
2022-07-16 14:17:41 | botcore.utils.scheduling | ERROR | Error in task Task-674 139899212692800!
Traceback (most recent call last):
File "/home/mark/repos/python/bot-pydis/bot/exts/utils/snekbox.py", line 466, in run_job
response = await self.send_job(ctx, python_version, code, args=args, job_name=job_name)
File "/home/mark/repos/python/bot-pydis/bot/utils/lock.py", line 112, in wrapper
raise LockedResourceError(str(namespace), id_)
bot.errors.LockedResourceErr...
Works. But why are we allowing features to get merged without performing even a basic test? This bug was not difficult to catch.
Yea agreed, for things like this we should probably make pre-release tags to test these in PRs on the bot.
[python-discord/bot] New comment on pull request #2218: Allow snekbox to run in both 3\.10 and 3\.11
Hmm, it seems the cog_command_error isn't hit when the function is being called from thee interaction.
It's an easy fix, we just need to move the error handling from there to instead be a try/except around send_job inside run_job.
[python-discord/bot-core] branch deleted: fix\-delete\-button
[python-discord/bot-core] New tag created: v7\.3\.1
[python-discord/bot] New comment on pull request #2218: Allow snekbox to run in both 3\.10 and 3\.11
Will squash some of these commits before merging.
Updated to use the 3.11 dev image in this commit https://github.com/python-discord/bot/pull/2218/commits/faea2027414beebf5d1ee75c0b0c8af4a0c94cf3 this reduces the image size down to the normal snekbox image.
GitHub Actions run 2683283463 succeeded.
You haven't provided any steps for setting this up or testing this. So far, I managed to figure out the config and get the bot running. However, I don't have any test CSV data to create a code jam. Do you have data you can share for testing?
0c8f933 Use interaction.defer for snekbox version switc... - ChrisLovering
Doesn't hurt to have this but in my attempts the UI wouldn't let me click another button once one has been clicked.
GitHub Actions run 2683368961 succeeded.
This was to cover when you edit the code and click the re-run emoji, then the Run in X button very quickly after. The timing window i pretty small though.
You haven't provided any steps for setting this up or testing this. So far, I managed to figure out the config and get the bot running. However, I don't have any test CSV data to create a code jam. Do you have data you can share for testing?
My apologies, but yes it's only a few env vars. I'll provide you the structure of the CSV I used.
Not really important but...
@lock_arg("snekbox.send_job", "ctx", attrgetter("author.id"), raise_error=True)
GitHub Actions run 2683447836 succeeded.
GitHub Actions run 2683460970 succeeded.
[python-discord/bot] branch deleted: 3\.11\-snekbox
3ad7cd9 Add required config and constants for snekbox 3.11 - ChrisLovering
234bd00 Allow users to eval code in either 3.11 or 3.10 - ChrisLovering
32d44d1 Update snekbox tests to reflect current behaviour - ChrisLovering
c4a7722 Use generic views from bot0core for snekbox - ChrisLovering
b20b72a Infer the snekbox invoker from context - ChrisLovering
Connected!
GitHub Actions run 2683475794 succeeded.
924e67b Add info about working with snekbox 3.11 and me... - ChrisLovering
[python-discord/site] New branch created: snekbox\-311\-and\-metricity
[site] Branch snekbox\-311\-and\-metricity was force-pushed to `ff1a181`
As we discussed, the create command should abort if the category name conflicts. You could do that in a separate PR if you prefer.
I think this needs to include the events lead too, since they can also use the info command.
It might be better to just allow the interaction owner and admins.
Owners are admins as well, aren't they?
This works for creation and is probably good enough for now. However, it would ideally also prevent deletion. There is this method used when a jam ends, which is virtually the same as this method https://github.com/python-discord/sir-robin/blob/2cb8c191a0ac28d98e2f7c9ce0ba035ef9c40a12/bot/exts/code_jams/_cog.py#L186-L188
Currently, the buttons aren't getting removed and so on timeout it just gives interaction failed
It would be better if they were removed.
Closes: #80
In some cases, the origin module of symbols as seen by sphinx doesn't correspond to the actual module they are defined in, this PR makes sure we grab the module where the object is defined in if it's an object we can determine that for.
e3de10c Add an optional message attr to ViewWithUserAnd... - ChrisLovering
[python-discord/bot-core] New branch created: remove\-view\-on\-timeout
[python-discord/bot-core] New tag created: v7\.4\.0\-beta1
On view timeout, this message has it's view removed if set.
46b771b feat(tags): add print-return tag - sid-maddy
[python-discord/bot] New branch created: sid/feature/tags/print\-return
Since we already create the tag embed from the embed object in the metadata, we already have the
support to add images in embeds, albeit a bit more verbose than if we had added a media property
in the metadata containing only the URL.
[bot-core] Branch remove\-view\-on\-timeout was force-pushed to `77f21bf`
GitHub Actions run 2685420334 succeeded.
[python-discord/bot] New branch created: snekbox\-snags
This will mean the buttons will be cleared from the response on interaction timeout.
This PR also adds the Python version to the output from snekbox.
Closes #2223
Marking as do not merge as the version of bot-core it uses will need to be updated to not be a beta release once https://github.com/python-discord/bot-core/pull/106 is merged.
GitHub Actions run 2685429499 failed.
92765ca Update snekbox tests to expect new output - ChrisLovering
Should we be using discord's cdn for the gif instead of hosting it somewhere ourselves?
---
embed:
title: "Print and Return"
image:
url: https://cdn.discordapp.com/attachments/267659945086812160/998198889154879558/print-return.gif
---
I think a proper title looks better; it's a bit more distinct and doesn't add the big spacing https://i.imgur.com/BRR78id.png
feab11c Start 3.11 snekbox container by default - ChrisLovering
GitHub Actions run 2685446997 was cancelled.
[site] Branch snekbox\-311\-and\-metricity was force-pushed to `e0e0bf3`
Should we be using discord's cdn for the gif instead of hosting it somewhere ourselves?
Do we have our own CDN to host images?
If not, is there any benefit to hosting on a different host?
GitHub Actions run 2685658084 succeeded.
You can upload the GIF to this repo and then reference the github raw URL for it in the embed.
The benefit is that this embed won't stop working if the original message is delete from within Discord.
9ac1bda chore(tags/print-return): add the GIF to the repo - sid-maddy
GitHub Actions run 2685871307 succeeded.
GitHub Actions run 2685888365 succeeded.
e6d49b5 Remove the ephemeral trigger from the Confirmat... - D0rs4n
77134f6 Copy over qualifier description from codejam 8 - Bluenix2
[python-discord/site] New branch created: cj9\-changes
Works like a charm and I enjoy the usage of buttons to view and add notes!
Since we have a full CJ system up and running now, we should document the required .env vars for testing out the functionality, but that's very out of scope for this PR.
I think from a running-this-event perspective it might be nice to have the viewing of a note and the relay of a note being added to not be ephemeral. We often discuss notes and the like with other event team members, so it'll be helpful if eve...
1a47cc9 Copy over qualifier description from codejam 8 - Bluenix2
[python-discord/site] New branch created: cj9\-qualifier\-desc
As requested in Discord, this copies over the generalized description of the qualifier from codejam 8.
Note how ahref is still the same, I was hoping this would mean that old links still work correctly.
GitHub Actions run 2686162053 succeeded.
GitHub Actions run 2686174680 succeeded.
Description
We want a way to notify admins when helper votes are 2 weeks old, so that they can step in and get it over the line.
This should be done via a call to GitHub API to create an issue. The github org name, repo name, and the auth token should be constants to allow the to be different in dev & prod.
Suggested implementation
Have a discord.py task that runs daily to check if there are any votes that meet the stale threshold, if so create the issue and add an emoji to th...
Relevant Issues
Closes #1075
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
In uwu_command, if command was invoked referring to a replied message, store the message's embeds in an embeds variable, otherwise set it to None.
Add an else statement in uwu_command after if embed is not None to fallback to embeds which was defined earlier.
Add a check in uwu_command to avoid adding a leading >>> if the uwuifi...
GitHub Actions run 2687711499 failed.
GitHub Actions run 2687783908 succeeded.
Was able to test on Windows, works great. Ran into some errors testing on Mac that we can attempt to figure out at a later date.
- [x] 3.11 by default
- [x] buttons go away after a few minutes
- [x] message indicates what version of Python is being used
I forgot to mention in the PR, but the timeout is defaulted to 180 seconds.
https://github.com/python-discord/bot-core/blob/main/botcore/utils/interactions.py#L26
3aaa9cf Add support for viewing and adding CJ Infractio... - D0rs4n
01ff98c Enhance code consistency in the CJ extensions - D0rs4n
f6f2e22 Add a utility function to fetch a CJ user durin... - D0rs4n
4ec3d59 Limit CJ info view interactions to admins and i... - D0rs4n
b649b3c Abort Code Jam interaction upon category name c... - D0rs4n
[python-discord/sir-robin] branch deleted: pr\-cj\-infr\-notes
Connected!
