#dev-log
1 messages ยท Page 90 of 1
[python-discord/snekbox] New branch created: cgroupsv2
Cgroupsv2 renamed the limit file structure. This commit should fix that.
736c0c8 Make snekbox url an env var - ChrisLovering
[python-discord/bot] New branch created: snekbox\-api\-url\-env\-var
An issue with snekbox in our cluster has meant that we want to send requests to an external service temporarily while we get this fixed.
Making this an env var means we can change this whenever needed in future without leaking the external service's url.
GitHub Actions run 1548907302 succeeded.
Connected!
GitHub Actions run 1548929581 succeeded.
GitHub Actions run 1549819555 succeeded.
GitHub Actions run 1550016269 succeeded.
I suppose I am late but I'll review this anyway.
Ideally this would use statfs to get the filesystem type, but Python doesn't make it easy to perform this syscall unfortunately.
GitHub Actions run 1551333132 succeeded.
I understand why it's done, but what happens if we have "public" channels that are still locked behind a role such as during codejams.
This PR has been open for quite a while.. if I am gonna be honest I thought it was merged shortly after I approved it a month ago (not to be disrespectful to anyone's available time of course).
I believe this PR needs a core-dev approval (and/or another contributor approval).. let's give this some love 
GitHub Actions run 1553776066 succeeded.
Connected!
GitHub Actions run 1553788324 succeeded.
This is really cool. I do think this could be even better if we were to store the modping schedules in the PostgreSQL database of the site, because then we can query it and inspect there, but that would just be a "nice to have".
log.trace(f"Removing moderator role from mod with ID {mod.id}")
GitHub Actions run 1553797992 was cancelled.
GitHub Actions run 1553802244 succeeded.
05fbc0a Add modpings schedule feature - Shivansh-007
a97f068 (modpings): Cancel the task before scheduling i... - Shivansh-007
547f883 (modpings): Use separate scheduler for modpings... - Shivansh-007
f8fa9ba (modpings): Make flake8 happy! - Shivansh-007
9f53142 Merge branch 'main' into modpings-schedule - Shivansh-007
Connected!
GitHub Actions run 1553886324 succeeded.
GitHub Actions run 1554086930 succeeded.
c301f3e Base functionality of tag fetching with groups ... - Numerlor
605768d Move cooldown handling to the Tag class - Numerlor
48e989f Move tag listing to new design and move it outs... - Numerlor
7cc8925 Add option to list all tags in a group - Numerlor
8216027 Move tag search to new design - Numerlor
Connected!
GitHub Actions run 1554144195 succeeded.
@Numerlor since the tags PR is merged I removed the stalled label.
The participants channel stays public, just not writeable. If we get to the point of cleaning a user from the team leaders channel, I think a more focused action will be made anyway, likely including the disqualification of the participant. Specifying such a channel explicitly in that case seems like an acceptable edge case. And if it stops being acceptable we can consider adding another shortcut for actually-all channels.
GitHub Actions run 1554493155 succeeded.
@Numerlor since the tags PR is merged I removed the stalled label.
should be good to go now
Tested and all works good, bar my one comment.
Setting the URL here won't work in dev for people using Docker, since Discord's API does validation on embed URLs and deems http://web:8000/pages/rules an invalid url.
I wonder if it's just fine to hardcode this particular embed url to the prod site
Don't see an issue with it if it may make using it locally a bit easier, some other places in the code hardcode the urls anyway, pushed in 1f2b603
GitHub Actions run 1554654993 succeeded.
c72d494 Move the rules command to the Information cog - Numerlor
aa5485b Remove the site help command - Numerlor
fc84bcf Move static content site commands to tags and r... - Numerlor
1f2b603 Use hardcoded rules url instead of constructing... - Numerlor
eb9e312 Merge pull request #1539 from Numerlor/site-tags - ChrisLovering
Connected!
GitHub Actions run 1554762311 succeeded.
13e3a30 Reduce threshold before fuzzy matching to 2 - ChrisLovering
[python-discord/bot] New branch created: reduce\-fuzzy\-match\-len
Commands such as !ot, !if, !xy are commonly used as shortcuts to their respective tags. We recently upped the threshold before fuzzy matching to 3 characters, which broke these shortcuts.
This commit reduces that threshold down to 2, so users who are used to those commands can still use them.
GitHub Actions run 1555175438 succeeded.
Should probably change it on L175 too so it also works as a direct invocation without any arguments (words after it)
Should probably change it on L175 too so it also works as a direct invocation without any arguments (words after it)
Ah yea, good point. Didn't notice that one. Updated now.
GitHub Actions run 1555201574 succeeded.
maybe reword this to specify both questions and projects? Otherwise, I think this should be good.
I agree
Connected!
GitHub Actions run 1555442197 succeeded.
[python-discord/bot] branch deleted: new\-filters
[python-discord/bot] New branch created: new\-filters
A way to bypass posting an image is posting an image link, and a problem with that is that people can post image links and since they don't embed in that channel, users may open that link thinking it's code or something like that when in reality it's an inappropriate image and the likes
Hmm, that sounds like a good idea, @Shom770 . But I feel like anyone could post images via CDN discord links in any channel, so I think it might be a good idea to not allow CDN Discord links at all. What do you think?
Also, as far as I remember, CDN Discord links don't embed at all through Discord, not just in our server, and not just in #python-general. But correct me if I'm wrong.
Hmm, that sounds like a good idea, @Shom770 . But I feel like anyone could post images via CDN discord links in any channel, so I think it might be a good idea to not allow CDN Discord links at all. What do you think?
I don't like that idea personally, since that makes it harder to copy an image from one server to another (especially on mobile), which does happen rather often. Imo, this is really only a problem in channels where embedding permissions are not enabled.
Also, as far as...
Hmm, that sounds like a good idea, @Shom770 . But I feel like anyone could post images via CDN discord links in any channel, so I think it might be a good idea to not allow CDN Discord links at all. What do you think?
I don't like that idea personally, since that makes it harder to copy an image from one server to another (especially on mobile), which does happen rather often. Imo, this is really only a problem in channels where embedding permissions are not enabled.
I'm not for...
The dash is supposed to be there because:
"but no one - not even his _____ - ever imagined..."
Does that make sense? @Bluenix2
Description
2048 is a single-player game in which you must slide around tiles labelled with powers of 2 in four directions. When two tiles of the same value combine, they get added together, creating a new tile with double the value. After each successful move, a random tile either 2 or 4 is generated. The goal, as one might guess, is to reach a tile with a value of 2048. If at any point the user is unable to slide any tiles (the board ...
Description
Since we have migrated to discord v2.0a we have the new button interactions support, and since they allow making a 3*3 block (3 buttons per row in 3 rows) they would be a perfect fit in the tic toe game, using buttons would not only enrich the user experience, but it would also make them more efficient, currently, we need to wait for the emojis to be slowly added :(
Contributor Reference: https://www.reddit.com/r/discordapp/comments/nn733r/tic_tac_toe_using_discords_new_com...
Ah, well look how you added spaces around the dash.
GitHub Actions run 1558110608 succeeded.
Yes, I did notice. Will fix.
I'd like to work on this issue.
Don't assign me yet though because I still haven't completely finished my 2 currently open PR's. If nobody else beats me, I'll let you know when I can be assigned.
The lock needs to be held while .get()ing the points as well.
You can still get the points, then context switch and another task updates the points, and then write over this with the wrong amount.
Just a quick comment:
This PR was made to improve the URL filter by removing false positives, like delicious-cookies.com being deleted for triggering cookies.com in the blacklist. As this continued, we added support to remove subdomains from any sent URLs to prevent circumvention. For any wondering why this exists, here you go :smile:
What happens if use_cgroupv2 is already in the NsJail config?
This doesn't even need to be a function. Just do self.cgroups_version = 2 if CGROUPV2_PROBE_PATH.exists() else 1.
This also needs to be adjusted, since v2 doesn't have subdirectories for each controller. NsJail doesn't even use cgroup_pids_mount and cgroup_mem_mount for v2. Instead, it's simply https://github.com/google/nsjail/blob/bf93e8a25d1b521797a319bc1f6182e894597224/cgroup2.cc#L42-L44
This description is for v1's behaviour. Does memory.swap.max in v2 also behave the same way?
Discord's current model for voice regions is setting it per server. Hence, the "Voice region" section in the server info tag will always display as "deprecated". This pull request removes it.
22d0429 Adjust FilterList Schema to group settings into... - D0rs4n
GitHub Actions run 1560441545 succeeded.
I approve, the voice server info is deprecated.
Thanks!
also rip Mr. Hemlock for getting beat by Chris in approval, lol
Connected!
GitHub Actions run 1560469590 succeeded.
This pull request adds a strip-gotcha tag, which represents the "gotcha" that a lot of people face with strip where they might expect it to remove a suffix/prefix and that it interprets its argument like a substring when it interprets it like a set of characters.
An example:
>>> "Monty Python".strip(" Python")
"M"
GitHub Actions run 1561053777 succeeded.
Connected!
Changes:
- Add a better datetime converter that allows passing time in 12/24 hour format, the previous method of parsing
startandendtime is removed (8h,16h, etc). - If your modpings schedule is over and you even had a modpings off which got over in modpings off time period, the role won't be added to you as your schedule is over.
- Make
modpings schedulemessage more verbose.
Fixes:
- Make
16hours as the max off time i.e. make8hours the minimum on time....
GitHub Actions run 1562468999 succeeded.
GitHub Actions run 1562544927 succeeded.
Note: The DayTime converter added in #2001 may be of use here (would need to be extended to support day/month/year though).
[python-discord/bot] Issue opened: #2002 AttributeError: 'User' object has no attribute 'add\_roles'
Sentry Issue: BOT-1RG
AttributeError: 'User' object has no attribute 'add_roles'
File "bot/utils/scheduling.py", line 117, in _await_later
await asyncio.shield(coroutine)
File "bot/exts/moderation/modpings.py", line 119, in add_role_schedule
await mod.add_roles(self.moderators_role, reason="Moderator scheduled time started!")
Error in task #512354988157173763 140600535200432!
@mbaruh do we still want the 8h limit?
Sentry Issue: BOT-1RD
TypeError: can't subtract offset-naive and offset-aware datetimes
File "arrow/arrow.py", line 1576, in __rsub__
return other - self._datetime
File "bot/utils/time.py", line 71, in discord_timestamp
timestamp = (timestamp - arrow.get(0)).total_seconds()
File "bot/exts/moderation/modpings.py", line 236, in schedule_modpings
f"{discord_timestamp(start, Tim...
Sentry Issue: BOT-1RE
We should be adding HTTPException to the contextlib.suppress just above the thread.join() call.
HTTPException: 400 Bad Request (error code: 50083): Thread is archived
File "discord/http.py", line 335, in request
raise HTTPException(response, data)
File "discord/threads.py", line 607, in join
await self._state.http.join_thread(self.id)
File "bot/exts/u...
GitHub Actions run 1563280045 succeeded.
GitHub Actions run 1563436466 succeeded.
GitHub Actions run 1563452155 succeeded.
GitHub Actions run 1563462224 succeeded.
GitHub Actions run 1563459011 succeeded.
GitHub Actions run 1563465059 succeeded.
GitHub Actions run 1563490430 succeeded.
GitHub Actions run 1563881593 succeeded.
Connected!
GitHub Actions run 1564365995 succeeded.
Connected!
Relevant Issues
Closes #947
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Added user's score to Candy command by adding one additional function/variable, and including verbose to the candy commands message. Invoker of candy command will now see their candy score.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there...
Cool and good tag. Ran into this a bunch of times myself.
The hours and minutes would be combined with UTC day, if no 'am' or 'pm' is passed with
f"I tried to get moderator with ID `{mod_id}`, but they don't appear to be on the server ๐"
The following formats are accepted:
Can someone supply more details about this? I don't have authorization to view the issue in Sentry. It would be helpful to have a steps-to-reproduce or something similar. Thanks!
Can someone supply more details about this? I don't have authorization to view the issue in Sentry. It would be helpful to have a steps-to-reproduce or something similar. Thanks!
Looking at the error, it mentions File "bot/exts/utilities/issues.py", line 142, in fetch_issues.
That leads me to this line
https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/utilities/issues.py#L142
So it seems pull_data here is the response from GitHub converted to a dict using `.jso...
There really isnโt much else to this. The command ran was pr 919, which does not currently produce an error. The original triggering message has been deleted, but it doesnโt add any useful context here.
I can only assume the API returned something unexpected, so letโs just add a check for that.
@ChrisLovering Thank you! Could you assign me and @evgriff to this?
@ChrisLovering Thank you! Could you assign me and @evgriff to this?
I've assigned you to the issue. I can't assign the other person, as I can only assign people who have commented.
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #928
Description
Added a key check to the if statement in L142 so that pull_data["draft"] will only be checked if the key exists in the parsed json
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?
-...
this would be fixed as part of #968, if not fixed as part of #778 (which is waiting on one approval)
May be worth noting that removesuffix is a fairly recent addition
May be worth noting that removesuffix/removeprefix is a fairly recent addition
How about under the doc links it says "Note: str.removeprefix and str.removesuffix were added in Python 3.9 and are fairly new"
2116bc4 Patch Filter and FilterList Serializer validati... - D0rs4n
GitHub Actions run 1565717528 succeeded.
GitHub Actions run 1565796184 succeeded.
[python-discord/workers] branch deleted: feature/9/hastebin\-filter
3116955 Update serve-robots/README.md - jb3
[python-discord/workers] branch deleted: experiments/akarys/robots\.txt
this regex was taken from a message in ddevs, listing the regex used by the client to detect tokens
Closes issue mentioned in #dev-contrib message
looks good, minor suggestion
Code looks good overall. Review comments aside, can you add unit tests for the DayDuration converter?
I think this is a typo, you probably want either accepts or expects here:
The command accepts two arguments `start` and `end` which represent hour and minute of a day,
or
The command expects two arguments `start` and `end` which represent hour and minute of a day,
Can we add what you're calculating here to a separate variable outside of the condition so it's more clear what this is doing?
Closing this in coordination with Joe per us sunsetting this project.
Closing this per us sunsetting this project.
[python-discord/api] New comment on pull request #14: Fallback to the old API for undefined routes\.
Closing this per us sunsetting this project.
Closing this per us sunsetting this project.
953f232 Use new approx message count view - ChrisLovering
[python-discord/site] New branch created: use\-new\-message\-view
We have added a new view to metricity that will keep track of an approximate message count, updating every 10 seconds.
By doing this, we avoid running a query against the whole message table every time we want to get a user's messages.
marking this as needs devops, as we are working out a way to refresh this materialised view on a schedule.
GitHub Actions run 1567193659 succeeded.
How about using pull_data.get("draft") instead?
Same review as 979
hm, this commit shouldn't even be on this pr.
@evgriff this change is out of scope of this pr, so you'll need to remove it. you can do it with either resetting your HEAD and then forcepushing, or making a commit which will revert this commit.
0150b4b Bump django from 3.0.14 to 3.1.13 - dependabot[bot]
3f4adf3 Migrate to generic JSONField - jchristgit
73bbd79 Update django-filter for new Django version - jchristgit
22f7e88 Merge branch 'main' into dependabot/pip/django-... - ChrisLovering
63c6c45 Merge pull request #630 from python-discord/dep... - jchristgit
GitHub Actions run 1567243355 succeeded.
I just started on this project, AFAIK, __all__ is used for wrapping classes under constants.py.
If true, we can remove PYTHON_PREFIX from __all__
might not need a new variable as rot, we can use as
snowflake = snowflake.rotate(randint(0,90))
Good suggestion, I agree. Will fix.
GitHub Actions run 1567621391 succeeded.
PR Author
Workflow Run
Source Branch
add-pg_cron-config
@RohanJnr thanks for the docstring update.
There's currently an error in CI due to conflicting migrations:
CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0070_auto_20210519_0545, 0071_increase_message_content_4000 in api). 20 To fix them run 'python manage.py makemigrations --merge'Could you look into fixing this?
It also seems the branch needs to be updated.
The fix for this was the 0072_merge migration I see co...
GitHub Actions run 1567685456 succeeded.
How would they send the files with their code? (Not related to NsJail, I just see it as another issue that would need to be addressed)
0150b4b Bump django from 3.0.14 to 3.1.13 - dependabot[bot]
3f4adf3 Migrate to generic JSONField - jchristgit
73bbd79 Update django-filter for new Django version - jchristgit
22f7e88 Merge branch 'main' into dependabot/pip/django-... - ChrisLovering
63c6c45 Merge pull request #630 from python-discord/dep... - jchristgit
[python-discord/site] branch deleted: use\-new\-message\-view
That's not a big concern on this end (maybe that's what you were trying to state with "not related to NsJail"). Files would be sent by adding a list of key-value pairs to the request format, where the key is the file path and the value is the content. Since the request is in JSON, I suppose file content has to be encoded e.g. in base64. If anyone has better ideas, feel free to share.
That being said, I would be okay with something narrower in scope that doesn't even support sending files. Users could still write new files through their Python code.
Awesome work the past two months! This is great, thanks DMFriends!
Awesome work the past two months! This is great, thanks DMFriends!
Thank you for all your help @Bluenix2 and @Shom770! This is my first time contributing and I really enjoyed working on this. You guys are the best!
Awesome work the past two months! This is great, thanks DMFriends!
Thank you for all your help @Bluenix2 and @Shom770! This is my first time contributing and I really enjoyed working on this. You guys are the best!
No problem!
We don't need to fetch the user here, we are using the user object to get the id/mention which can be done on ctx.author also, the two are the same objects.
Use user.mention instead of manually writing the user mention and double quotes :)
We are including the user' name/mention twice here, which kinda feels redundant, I think we can just add a single line here in the top candy records field saying (You) {user.mention}: {score}
Or we can change it Your Score
e.add_field(
name="Your Candy Score",
value=get_user_candy_score(),
inline=False
)
I'm making some changes and found the regex that discord themselves use for the above feature, but since that is only used on desktop, I could implement it.
Approval: #dev-contrib message
Enhances the regex of the token remover to use the same regex that discord itself uses, with a slight modification. The mfa section was removed, but depending on an updated #1421, may be implemented. Additionally, the sections were grouped to keep working with the current code.
I kept the existing validation to keep false positives at a minimum. The current code checks the user resol...
GitHub Actions run 1568468071 succeeded.
Why is it a 400 bad request? What happened to cause it?
I'd rather fix the root of the problem if possible than use contextlib.suppress
Description
There are no checks if a user is still a mod when reassigning the mod role.
If a moderator is demoted, the modpings cog will still readd the moderator role, if the user had it scheduled to be readded later.

Proposed Solution(s)
1: Check if the user has the modteam role immediately before reassigning the ping role.
2: Sync the mod pings on all role...
As approved on [discord](#dev-contrib message) by @jb3 I'll be implementing this in #2006
GitHub Actions run 1568748286 succeeded.
GitHub Actions run 1568826650 succeeded.
Hi @RohanJnr, just checking in to see whether you need any help with this?
The fix for this was the 0072_merge migration I see correct?
Yes
Do want to give 0070_auto_20210519_0545 a more meaningful name?
I think due to the dependencies of the other migrations on this migration this will get a bit hairy, unfortunately :(
@ChrisLovering hi, just checking in to see whether you've found out anything new about the permissions issue?
When running python -m snekbox 'print("hello world!")' --time_limit 0 (documented here) I get this error:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/snekbox/snekbox/__main__.py", line 28, ...
Other than a bit of time the evening that you posted this I haven't had a chance to look at this no.
Between my limited knowledge of linux permissions, and lack of time to learn, I'm tempted to mark this PR up for grabs.
I'll be fixing this commit history tonight
Connected!
do we want to try and handle setting py_args from the command line too?
I'd like to, but I cannot think of a good way to do it. The only options I can think of are:
- Specify all the arguments as a quoted string
- Have some delimiter word/character between the nsjail and py arguments, then use that to split the unknown arguments list.
GitHub Actions run 1570392588 succeeded.
Connected!
GitHub Actions run 1570394831 succeeded.
do we want to try and handle setting py_args from the command line too?
I'd like to, but I cannot think of a good way to do it. The only options I can think of are:
- Specify all the arguments as a quoted string
- Have some delimiter word/character between the nsjail and py arguments, then use that to split the unknown arguments list.
I think 1 seems a bit more intuitive and would be alright. We could add --time_limit as a separate shorthand argument if it's used most com...
I think 1 seems a bit more intuitive and would be alright.
Better than nothing.
We could add --time_limit as a separate shorthand argument if it's used most commonly (not sure if it is)
I don't think it's necessary. The current approach for NsJail args seems fine.
GitHub Actions run 1570515575 succeeded.
PR Author
Workflow Run
Source Branch
bump-psql-work_mem
GitHub Actions run 1570529652 succeeded.
PR Author
Workflow Run
Source Branch
bump-psql-work_mem
@Akarys42 Are you still interested in working on this?
On second thought, screw that. Complexity of parsing outweighs the minor benefit.
GitHub Actions run 1570804677 succeeded.
@MarkKoz It seems they won't be able to work on this anymore.
because we lost write perms, we also won't be able to continue on this PR
From #dev-contrib, at [this message](#dev-contrib message).
I'm a bit late to updating these PRs, sorry about that.
How would edits be handled? If a user opts in, and then the initial user deletes or modifies it, would it modify it for all users, or create a copy for themselves?
It is possible to implement a custom context class, and overwrite the send method. We could keep all of the methods the same, but add a custom kwarg to send, and default it to be awaited deletable.
await ctx.send('hello user!', not_trashable=True)
I'd like to implement this.
My idea is simple: we already have the codeblock detection for suggesting proper syntax highlighting.
I would build on that, and like to add a total character count and line count, and factor them together somehow, in a way that we can configure them.
I don't know if this issue is still relevant, when was the last time the API went down without the entire server going down? Regardless, the best solution today would probably be something to do with redis, Maybe a redis queue that we try to keep empty and add to if API requests fail. I don't think bypassing the API and going straight for the DB is very wise.
What happens when Redis goes down? Well first contact DevOps because something has gone horribly wrong if both site and redis ...
I may be able to implement this.
@scragly are you still looking to implement this, I could implement this if not.
I could work on this.
Is this still blocked by pydis not receiving typing events?
Currently, the newlines rule triggers a ping to Moderators, deletes the offending message and also mutes the offending user.
This is commonly triggered by people seeking help, often in help channels or topical channels.
Let's discuss whether we can:
- prevent bot from muting the user, instead have it reply with a reason for message deletion and a link to our pastebin service
- not have the user muted
- not ping Moderators
- not relay to #mod-alerts
- possibly still mute ...
GitHub Actions run 1571105412 succeeded.
What's the current new line rule, how many lines are needed to trigger the filter? Perhaps it could be changed slightly, to not trigger so easily?
What's the current new line rule, how many lines are needed to trigger the filter? Perhaps it could be changed slightly, to not trigger so easily?
I don't think that could be done without making the whole filter pointless, or at least less effective, as it's often over 100 newlines already (the times it's triggered that is, I don't know what the limit).
I was able to find this, the limit is already 100 lines, so my point may be invalid. https://github.com/python-discord/bot/blob/a5cfe2ac47077805c205bcaf05eaed5ded5d09f9/config-default.yml#L439-L442
haven't tested much, other than before the asset change.
little more christmasy feel than halloween, please!
I was able to find this, the limit is already 100 lines, so my point may be invalid.
Depending on how the messages trigger it, it may be possible to increase max, but keep max_consecutive the same.
I'd like to implement this if @DMFriends is fine with that
I'd like to implement this if @DMFriends is fine with that
Go right ahead!
Oh yeah lol, I still have a lot to work on as you can see :). Will get there.
GitHub Actions run 1571516095 failed.
GitHub Actions run 1571539572 succeeded.
GitHub Actions run 1571542105 succeeded.
Usually those updates happen for short durations, usually during times that aren't very high activity.
I'm not sure if the solution you're suggesting is different from the one I am or not. I'm not sure what "send what infractions it's taken" means in this context.
I don't see a reason to complicate this. If it's deleted or edited, we just send whatever we have at the time.
GitHub Actions run 1572579551 succeeded.
I'd suggest you hold off for now. Scheduling is one of the first things being ported to bot-core, and I expect a PR within the next couple days.
Sentry Issue: BOT-9M
AttributeError: 'NoneType' object has no attribute 'fetch_message'
File "discord/client.py", line 351, in _run_event
await coro(*args, **kwargs)
File "bot/exts/moderation/modlog.py", line 732, in on_raw_message_edit
message = await channel.fetch_message(event.message_id)
Unhandled exception in on_raw_message_edit.
This is caused by the on_raw_message_edi...
GitHub Actions run 1574346968 succeeded.
Usually those updates happen for short durations, usually during times that aren't very high activity.
I'm not sure if the solution you're suggesting is different from the one I am or not. I'm not sure what "send what infractions it's taken" means in this context.
Ah, I was thinking about an edge case where the bot is rebooted while the database is unreachable, meaning that if a moderator used a tempban, the user would not have it scheduled anywhere to unban, for example.
That's what redis is for. We keep the task in redis till we get confirmation from site.
[python-discord/site] New branch created: bump\-drf
This is to add support for Django 3.1's database-agnositic JSONField.
GitHub Actions run 1574482382 succeeded.
I just pushed a change @onerandomusername, are you satisfied now? :)
GitHub Actions run 1574902196 succeeded.
I'd like to see this happen too.
I'd also add that this is a good time to edit the feedback message instead of deleting it after the timeout, so you have a trace of the invocation and not just nothing
GitHub Actions run 1575061283 succeeded.
Oh, I thought you were pointing at the colors, mb. I'll fix the title too
@MarkKoz It seems they won't be able to work on this anymore.
because we lost write perms, we also won't be able to continue on this PR
From #dev-contrib, at [this message](#dev-contrib message).
I'm a bit late to updating these PRs, sorry about that.
I'm fine with the PR being re-opened using a different branch if Akarys wants to. Otherwise, I will try to finish the PR.
GitHub Actions run 1575119971 succeeded.
Should only allow a user to invoke the command once at a time.
Easy fix, decorate the command with this: https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.max_concurrency
@commands.max_concurrency(1, per=commands.BucketType.user)
Our !user command currently supports a messageID arg, and returns the user embed for that message's author. This can lead to some confusion when the user running the command doesn't know about this feature, and then tries to use that ID with another command that doesn't support it.
The proposed solution for this is to highlight when the user command is using a messageID, as this goes against expectations, in the embed title.
EG for this embed, the title would be **Chrisjl#2655 (From M...
Title is very misleading. "Bump lxml from 4.6.3 to 4.6.5" when in pyproject.toml it actually bumps from 4.4 to 4.6?
Connected!
GitHub Actions run 1577449511 succeeded.
Title is very misleading. "Bump lxml from 4.6.3 to 4.6.5" when in
pyproject.tomlit actually bumps from 4.4 to 4.6?
The important thing here is the lockfile. There it bumped from 4.6.3 to 4.6.5.
9884b53 Add text indicating when user fetched by message - TizzySaurus
[python-discord/bot] New branch created: user\-improvement
Closes #2012.
!user now highlights in the embed title when the user command is using a message to retrieve the user information.
Also removed a redundant assignment.
GitHub Actions run 1577784764 failed.
Should only allow a user to invoke the command once at a time.
Easy fix, decorate the command with this: https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.max_concurrency
@commands.max_concurrency(1, per=commands.BucketType.user)
Would this go right after line 65?

Should only allow a user to invoke the command once at a time.
Easy fix, decorate the command with this: https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.max_concurrency@commands.max_concurrency(1, per=commands.BucketType.user)Would this go right after line 65?
Yeah.
Ah, gotcha. So where exactly does this go? Right after the
async def madlibs, correct?
Yeah, it can go anywhere in the cog, it's just a special decorator like the on_command_error but for a cog, which would be called whoever there is an error raised in the cog, also error.handled is set so the error handler doesn't handle the error again.
Ah, gotcha. So where exactly does this go? Right after the
async def madlibs, correct?Yeah, it can go anywhere in the cog, it's just a special decorator like the
on_command_errormethod but for a cog, which would be called whenever there is an error raised in the cog, alsoerror.handledis set so the error handler doesn't handle the error again...
Approved, and assigned!
Good luck!
As far as I can see you have no guarantee that self.guild was already set. A possible solution is to set the value in reschedule_modpings_schedule as in reschedule_roles.
The other option is to go with the async init_cog pattern we have in a few other places, where we create a task to init the cog within the cog init and then await that task in all the functions that rely on things like this.
GitHub Actions run 1579010236 succeeded.
f65184b Query message count directly from messages - ChrisLovering
[python-discord/site] New branch created: revert\-metricity\-change
This was changed due to performance reasons, but after some tweaking in the database, such as increasing work memory and adding an index, this query runs much faster now.
To test this, I want to revert this change, so that we can stop the materialised view from refreshing, to see if the act of refreshing is what's causing this query to seem faster when runing against the database.
GitHub Actions run 1579433299 succeeded.
GitHub Actions run 1579508399 succeeded.
GitHub Actions run 1579723051 succeeded.
The embed already says they were added in 3.9 though
GitHub Actions run 1580318074 succeeded.
Might be a nitpick, but this seems like a task that should come before the other two. Also notice that the task is still hanging on cog unload.
I think the task can be hanging? It's not a looping task, it's one and done. Not entire sure how I would solve this.
GitHub Actions run 1580908115 succeeded.
this has been deemed not to be a problem as of #dev-contrib message
After looking into this further, markdownify cannot be updated, as it will nerf the results of the doc command.
โฆrkdownify
as of markdownify 0.7.1 it now converts hr tags natively
however, what it converts to is not supported by discord markdown
to get around this, we just return an empty string, as per current behavior
Current behavior:

Newer version of markdownify

...
Fixed that change in GH-2014 ๐
GitHub Actions run 1581564161 succeeded.
Why is this necessary? The version of markdownify is pinned to exactly 0.6.1
I-
I think it would have been worth noticing that.
Just make this await self.fetch_guild_task
GitHub Actions run 1582336853 succeeded.
GitHub Actions run 1582531038 succeeded.
PR Author
Workflow Run
Source Branch
add-/dev/shm-memo...
Have just realised that the tests on this failed. I'll update the tests (hopefully) tonight.
GitHub Actions run 1582614888 succeeded.
PR Author
Workflow Run
Source Branch
add-/dev/shm-memo...
05fbc0a Add modpings schedule feature - Shivansh-007
a97f068 (modpings): Cancel the task before scheduling i... - Shivansh-007
547f883 (modpings): Use separate scheduler for modpings... - Shivansh-007
f8fa9ba (modpings): Make flake8 happy! - Shivansh-007
9f53142 Merge branch 'main' into modpings-schedule - Shivansh-007
GitHub Actions run 1583043411 succeeded.
Everythings looks good, except for one suggestion.
40631e9 Rename channels.discord_py to discord_bots (#1982) - bsoyka
[python-discord/bot] branch deleted: bsoyka/discordpy\-bots
Connected!
GitHub Actions run 1583100941 succeeded.
7cb5c55 feat: implement moving commands - onerandomusername
c7f62d3 yank lovefest role management commands - onerandomusername
2d07608 chore: remove subcommands entirely - onerandomusername
cfb2cc6 chore: update lovefest docstring to reflect dep... - onerandomusername
3c4c98d Merge branch 'main' into yank-lovefest-sub - Xithrius
GitHub Actions run 1583174102 succeeded.
That's some good stuff right there
Connected!
GitHub Actions run 1583179532 succeeded.
GitHub Actions run 1583191353 succeeded.
7cb5c55 feat: implement moving commands - onerandomusername
c7f62d3 yank lovefest role management commands - onerandomusername
2d07608 chore: remove subcommands entirely - onerandomusername
cfb2cc6 chore: update lovefest docstring to reflect dep... - onerandomusername
3c4c98d Merge branch 'main' into yank-lovefest-sub - Xithrius
GitHub Actions run 1583200929 succeeded.
Connected!
GitHub Actions run 1583210237 succeeded.
Connected!
From what I have collected, draft should always be returned in a valid response from the API. Therefore if draft was missing, it likely means the entire response was something unexpected (perhaps empty). So we could expect each one of these elifs to fail as well. It may be prudent to utilize a try-except here, or explicitly catch a missing key from any if-elif block. From what I can see, the current will just cause the error to occur on the first elif, since that key would probably be m...
Why can this be removed? The code that now handles DM-only checks is in the whitelist decorators, but that isn't applied here.
Connected!
@fisher60 What should the emoji be set to if the pull_data is invalid?
Connected!
This would be fixed as part of #968, although I believe #778 would fix this as I think it moves all requests to a helper method which checks for a 200 response code and whatnot.
So it seems like there are still some modifications, and I do understand this a bit more, but I think that increasing the max newlines a bit might help in the short term.
We could also add a bit more complexity, by calculating the max characters and a percentage of which of those characters were newlines vs whitespace.
I still think a try-except would be a good idea in case the pull data is malformed. #778 still leaves the possibility of a KeyError.
Added @fisher60 and @onerandomusername's suggestions
If its malformed, we shouldn't be doing anything with the pull data. A solution would be to use a helper method to get the data, deal with possible ratelimits, and check for a 200 status code.
Most of the calls are deferred to a helper method with #778, but not all of them, unfortunately.
Additionally, this particular call to the api affecting this bug will be removed as a result of #968, as the data is already there with the initial issues api request.
The solution, if we are to im...
If its malformed, we shouldn't be doing anything with the pull data. A solution would be to use a helper method to get the data, deal with possible ratelimits, and check for a 200 status code.
Most of the calls are deferred to a helper method with #778, but not all of them, unfortunately.
Additionally, this particular call to the api affecting this bug will be removed as a result of #968, as the data is already there with the initial issues api request.
The solution, if we are to im...
55f008e minor: allow color command in dev-media (#944) - onerandomusername
GitHub Actions run 1585070165 succeeded.
Connected!
GitHub Actions run 1585073589 succeeded.
solves issue with adding decorator to the parent
which wouldn't apply to the children
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](https://pythondisc...
GitHub Actions run 1585439964 succeeded.
Rebased onto main to remove the implementation commit, as that was added with #971
GitHub Actions run 1585853320 succeeded.
@ks129 If this code is good, could you approve this PR? @evgriff and I are doing this as a school assignment due tonight and need to have proof of a successful merge.
GitHub Actions run 1589160748 failed.
PR Author
Workflow Run
Source Branch
add-/dev/shm-memo...
GitHub Actions run 1589192037 succeeded.
PR Author
Workflow Run
Source Branch
circumvent-gcr-block
GitHub Actions run 1589201612 succeeded.
@katimoth I agree with Shivnash's comments. Could you quickly make those changes?
GitHub Actions run 1589203323 succeeded.
PR Author
Workflow Run
Source Branch
add-/dev/shm-memo...
GitHub Actions run 1589208974 succeeded.
await self.bot.wait_until_guild_available()
This is the safer check we use throughout the bot (particularly considering that what you need here is for the guild to be set).
Do you think it might be worth converting claimants into a set?
@HassanAbouelela Committed the suggestions
While testing this I can't get the auto-filtering to work..
- Add YouTube with
b!blacklist add domain_name https://youtube.com/ - Log in with my alt and paste
https://tinyurl.com/materialgworlbustdownwhich redirects to YouTube. - Nothing happens even though the domain is blacklisted?
Thanks for your work, and congrats on your first PR here ๐
Thanks for your work, and congrats on your first PR here ๐
Thank you !
Works like a charm! Thanks, this is great.
Tested out locally, works as expected.
Congrats on you first PR ๐
70b9ec7 Added the user's score to Candy Command accordi... - evgriff
879c1a2 Merge branch 'main' of https://github.com/pytho... - evgriff
bcd47e1 added key check - evgriff
770292e Update bot/exts/holidays/halloween/candy_collec... - evgriff
43f1a14 Adding suggestions, removing erroneous commit - evgriff
Connected!
GitHub Actions run 1589327165 succeeded.
@TizzySaurus did you add tinyurl to the unfurl filter list?
From my very limited experience with the clean cog... it works! Great thank you my favourite peppa-pig look-alike. Nice work here

6a4b1df Include message counts in all channels - ChrisLovering
[python-discord/bot] New branch created: include\-message\-in\-user\-embed
The purpose of the mentions rule is to catch people spamming user mentions, but message.mentions shows the user being replied to, if the reply is pinging, which is out of scope for what the rule is trying to catch.
The replies should be subtracted when counting the number of mentions, and messages with only a reply but no mentions should be removed from the logging.
GitHub Actions run 1589394031 failed.
05fbc0a Add modpings schedule feature - Shivansh-007
a97f068 (modpings): Cancel the task before scheduling i... - Shivansh-007
547f883 (modpings): Use separate scheduler for modpings... - Shivansh-007
f8fa9ba (modpings): Make flake8 happy! - Shivansh-007
9f53142 Merge branch 'main' into modpings-schedule - Shivansh-007
[python-discord/bot] branch deleted: clean\_improvements
GitHub Actions run 1589408801 succeeded.
Connected!
[bot] Branch include\-message\-in\-user\-embed was force-pushed to `76174fe`
Works as usual - I can't get access to an MFA token to test though. Thanks for this, I just have one comment that won't affect my review.
We could add a return after this - there's no point in checking for an MFA token.
I am just gonna start handing out high fives to everyone. This is great thank you!

if no one else wants to do this tonight, I can see about taking a look in a few hours.
I think it is worth checking, or I should move checking for an mfa token before checking the other token format.
the reason for checking both was to ensure that a user who happened to share a user and bot token in the same message would not go undetected.
Basically, with an mfa token those are to alert mods that someone sent it, and don't let the user know why their messages was deleted intentionally.
however, I should probably go a little further with the implementation and possibly add some configuration as we may not want to ping moderators for mfa tokens
59e4a5c Always include metricity message blocks - ChrisLovering
[python-discord/site] New branch created: revert\-metricity\-change
Thanks to a recent database maintenance (https://pythondiscord.freshstatus.io/incident/139811) querying out metricity message data is far cheaper. So there is no longer a reason to only fetch blocks if the member has a low message count.
GitHub Actions run 1589716513 succeeded.
[bot] Branch include\-message\-in\-user\-embed was force-pushed to `2a4ef67`
GitHub Actions run 1589727207 succeeded.
GitHub Actions run 1589747327 failed.
[bot] Branch include\-message\-in\-user\-embed was force-pushed to `a0a9bc0`
GitHub Actions run 1589779848 succeeded.
I'd like to add to this.. while there, also don't count the author's own mention, if for some reason they mention themselves.
I can implement this if someone assigns me.
I'd like to implement this.
Was this implemented with #1868?
TBH We can have issue templates and still allow a user to not use the templates, so its very easy to have the best of both worlds.
https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
You can encourage contributors to use issue templates by setting blank_issues_enabled to false. If you set blank_issues_enabled to true, people will have the option to open a blan...
users opted out still have their message posted to the API by the bot, the API manages whether to store them in the DB or not
* This removes the need for any logic in the bot itself
TBH I personally am not a fan of this, would it be that hard to not do any processing with the bot if the user has opted out?
Module "re" in standard library may also be of help here.
I think I'm a fan of the approach where the API checks for opt-out. It's not a major problem.
Both services run in the cluster, all traffic between services on different nodes is encrypted. I'm satisfied that data is safe and so would rather do it the proposed way, it's nice not having to worry about this on bot.
Gotcha, that makes sense.
As the function can return a value, I wanted to make it concretely return None while I was here, rather than implicitly return None.
I am extremely sorry to say but I currently have exams for a month due to which I will not be able to work on this. I had posted this sometime back when I had time but currently, my exams are right around the corner which is why I will not be able to work on this right now.
This can either be assigned to someone else or I can work on it from the 7th of January - whichever works (my exams end on the Jan 7th)
Connected!
Connected!
Connected!
I'm not sure what the priority is for this feature, but I don't think it's too high. Unless someone else comes along wanting to implement it, this will still be here in January.
closes #2015
- no longer counts mention replies
- no longer counts self-mentions
GitHub Actions run 1593124211 failed.
I'll add the up for grabs label, unless someone else takes it, you can go ahead and implement it in January.
Good luck with your exams!
After our debugging with my setup I think we have all of this fleshed out now. Thanks for your help and contribution!
Seems good! :D Tested locally and works well.
Just two optional changes that could make it nicer.
It could be that the user is actually mentioned in the message though.
I may have set you on the wrong direction by saying "subtract", but it might be simpler to find all user mentions with regex.
As discussed on [discord](#dev-contrib message), we're keeping this subtraction
GitHub Actions run 1594098242 succeeded.
[python-discord/bot] New branch created: better\-off\-topic\-tags
I'm going to finish this PR.
Relevant Issues
closes GH-976
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
switched to using interactions for tic tac toe
start of game

in progress

game over
 in staff channels, we are modifying the original !ot embed to only list #ot2, since the tag's primary use is to redirect users to an off-topic channel. By only listing #ot2 the hope is that there will be less interruptions to the very traffic-heavy #ot0 channel.
 which returns None if the key isn't present on the dict object (it doesn't raise a KeyError like pull_data["draft"] does).
Looks good! I would suggest committing Dawn's suggestion because I like the wording of "often", but it's not a blocker so I'm going to go ahead an approve this.
Otherwise, as a note, this does mean that !off-topic will fuzzy-match to the longer embed and not !ot, which may at first seem like inconsistent behavior. But actually, no one really uses the full !off-topic tag invocation. The usage for the past month is almost entirely !ot, so I'm fully onboard with changing the tag nam...
GitHub Actions run 1595133825 succeeded.
GitHub Actions run 1595138102 succeeded.
I don't have any control over where the worker is deployed.
Relevant Issues
Closes #787
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Created an "epoch" command which allows you to convert a word date and time to an epoch (Unix timestamp). The parsing for relative dates is done with arrow.dehumanize, absolute dates are parsed with dateutil.parser.
If the entered string is parsed successfully, the epoch is sent to chat along with a drop-down interaction which allows you to...
GitHub Actions run 1596056795 failed.
Works pretty well, just a few things
timestamp is a single word, this should be renamed to TimestampDropdown
It is a bit sad that you have to explicitly mention Z, would there be any way around this one?
Writing the timezone is optional, it will default to UTC anyway. Z and UTC should both be recognized as well, but other named timezones (PST, EST, etc.) won't be. Do you think I should remove that line from the docstring?
I'm not sure what you mean here. What would that look like?
[python-discord/bot] branch deleted: better\-off\-topic\-tags
Connected!
GitHub Actions run 1596374657 succeeded.
GitHub Actions run 1596434800 succeeded.
When trying to use the source command on a tag, it errors out and the exception is not caught:

A simple solution would be to just catch the exception, but since it's a very identifiable scenario (being an instance of TagIdentifier), we can instead point to the appropriate MD file in the repo.
I can implement this tonight, if no one else wants to do it before then
Looks like this is caused by how we're loading extensions, if the source cog is loaded before the tags cog, then the TagIdentifier class used by source is different to the one in the tags cog because the tag module is reloaded.
Although when it does work it uses the wrong path so that should be fixed in the source cog at L68
Currently, a tag is directly returned when it has an exact match even when there are matched fuzzy alternatives, but this does not attempt the exact match on only the name if the tag has a group. This causes issues if the user invokes a tag with some text after it which is considered as the tag's name.
The PR adds an additional search with only the tag's name without a group when the first lookup of the original identifier fails
GitHub Actions run 1596940706 succeeded.
A list of tuples would look like this:
STYLES = [
("Epoch", ""),
("Short Time", "t"),
("Long Time", "T"),
...
]
A list of tuples would look like this:
STYLES = [ ("Epoch", ""), ("Short Time", "t"), ("Long Time", "T"), ... ]
I don't see the benefit over a dictionary. That should retain order as well, no?
If my memory serves the correct information, dictionaries retain insertion order. So what you have now should be fine.
GitHub Actions run 1597158867 succeeded.
Description
A command that will fetch information about a certain day (can be filtered by the year too) for AOC puzzles.
Reasoning
I've seen a lot of people including myself have trouble remembering what day had what. Especially with puzzles from past years when people didn't participate, you have to look up the day every time to see what happened on that day.
In addition, being able to pull up the day from Discord rather than exiting into your browser to search up the day every...
Works like a charm!
I tested this with a couple of different combos of tags + text after including with a tag group (dpy tag group) and everything works as expected.
Quick update on this: I'm feeling like I won't be able to work on this simply because I can't seem to understand Pillow. If anyone else wants to pick this up, feel free, just be sure to get assigned on the issue #937 first!
GitHub Actions run 1597685696 succeeded.
I think this should be upgraded to a log.warning, since it means we likely need to int e remove them from the modpings.
Nitpick but comments should generally start with a capital letter
Should probably have a . at the end of this line (meaning next line will need a capital letter)
Maybe specify that it's PyDis we're getting? Probably not needed but could be nice.
I'd also add that we assign it to self.guild.
"Fetch the Python Discord guild and assign to `self.guild`."
Few nitpicks and suggestions. I would like to see the log.warning and _ctx change along with the schedule_modpings docstring re-write.
Is there a reason this is _ctx instead of simply ctx as in our other converters?
Slightly off grammatically.
"""Attempts to convert `argument` to a UTC datetime object."""
This sentence doesn't make grammatical sense. I think you're missing a period (.) after the "...with UTC day", i.e. "...with UTC day. If no 'am' or 'pm' is passed..."
Added the do-not-merge because I accidentally approved instead of requesting changes.
Nope, I just copied one of the earlier convertors as a template and applied the changes.
Should probably be changed to ctx then
was supposed to request changes
No no, I was thinking about a dictionary of tuples, something like
STYLES = {
"Short time": ("t", "h:mm A"),
"Long time": ("T", "h:mm:ss A")
...
}```
To remove `TIMESTAMP_FORMAT`
Oh I see, yeah you could mention in the help text that the timezone is optional and will default to UTC
GitHub Actions run 1598874899 succeeded.
Connected!
GitHub Actions run 1599130223 succeeded.
Connected!
I just started getting the same error about type descriptors in my local branch which is based off master. I'm not sure what triggered it. It seems to only happen when I run it through docker-compose up. If I use pipenv run devshand thenpython -m snekbox`, it works.
Will you be able to finish the PR soon? Let's just agree to not bother renaming the file since it breaks things.
Also, please target the current ref in the master branch rather than 3.0. Since 3.0, a feature has...
https://github.com/google/nsjail/pull/186 was merged and it'd be helpful for snekbox. It would mean that at least for cgroupv2 support, snekbox wouldn't have to manually write 0 to memory.swap.max. This PR isn't available in any NsJail release, so the Dockerfile will have to clone based on commit hash.
By default, Docker uses a private cgroup namespace when the host system uses cgroupv2. This results in the root cgroup within the container having an empty cgroup.subtree_control, which means the child cgroups NsJail creates will not have any controllers enabled. Attempting to write to the root cgroup.subtree_control results in a "device or resource busy" error, which seems to be because the cgroup already has processes in it (it's the root cgroup, after all). However, the exact cause for...
Reading back my mails, I realize that it might be best for me to respond to this..
Makes sense yeah, we'll keep it like this then.
Description
I would like to make a Sudoku game command for Lancebot. Here are the rules for playing Sudoku, in case you don't know: https://sudoku.com/how-to-play/sudoku-rules-for-complete-beginners/
Reasoning
Sudoku is one of the most popular puzzle games in the world currently and it provides a good challenge for your brain.
Proposed Implementation
- The bot will print an embed with a code block in it that has the Sudoku board, like so:

The rules are the same, just with less numbers
The rules are the same, just with less numbers
Ok, if that's the case, then I can do that.
I believe this is out of scope of this pr, and should be changed in GH-2001
GitHub Actions run 1599982710 succeeded.
As we were talking about on discord, by reducing the size to a 4x4, we could use buttons for the user interface instead
Although, a 4x4 seems kind of small for a sudoku game, it should be fun enough.
However, if using buttons, it would not be possible to expand it any larger, so it would be a tradeoff that we would need to make.
As we were talking about on discord, by reducing the size to a 4x4, we could use buttons for the user interface instead Although, a 4x4 seems kind of small for a sudoku game, it should be fun enough.
However, if using buttons, it would not be possible to expand it any larger, so it would be a tradeoff that we would need to make.
I think 4x4 should be fine with buttons. Not sure what you mean by "tradeoff" @onerandomusername
Given we can only have 5x5 buttons in total, if we use buttons we cannot ever grow beyond that size.
GitHub Actions run 1600037932 succeeded.
Looks like this is caused by how we're loading extensions, if the source cog is loaded before the tags cog, then the
TagIdentifierclass used by source is different to the one in the tags cog because the tag module is reloaded when the extension is loaded.Although when it does work it uses the wrong path so that should be fixed in the source cog at L68
Yeah, I moved TagIdentifier to a separate file, and that it solves the problem.
Not changing my approval, but there is this error message on timeout which I don't fully think makes sense.

Additonally, I'm not sure about the random titles, as its somewhat unprompted.
Finally, I suggest mentioning the user with this error as its a timeout.
Looks like this is caused by how we're loading extensions, if the source cog is loaded before the tags cog, then the
TagIdentifierclass used by source is different to the one in the tags cog because the tag module is reloaded when the extension is loaded.
Although when it does work it uses the wrong path so that should be fixed in the source cog at L68Yeah, I moved TagIdentifier to a separate file, and that it solves the problem.
While that does solve the problem, I fee...
While that does solve the problem, I feel like it's more of a bandaid solution.
A similar error is likely to occur for other extensions if they end up depending on each other so I think something more robust like making loading extensions respect already imported modules instead of overwiting them would be better here. Or at least making the extensions order deterministic so the errors caused by it are not intermittent.
We shouldn't be importing from extensions since reload and loadin...
Given we can only have 5x5 buttons in total as discord limitation, if we use buttons we cannot ever grow beyond that size.
Ah, I see. To be honest, now that I think about this, I feel like 4x4 would a bit too easy. Another thought I had was to make this game thread based so it's not taking up the entire channel but they haven't been enabled on PyDis yet, so I'm not sure if that's possible, at least without making this issue stalled.
Not changing my approval, but there is this error message on timeout which I don't fully think makes sense.
Additonally, I'm not sure about the random titles, as its somewhat unprompted.
Finally, I suggest mentioning the user with this error as its a timeout.
As you mentioned on [Discord](#dev-contrib message...
UPDATE: after futher invesigation, most of the above imports are being used for type hinting, and the cogs do use get_cog
There's a few cases where I found the bot imports cogs from other modules and using them, which should be updated to use get_cog
https://github.com/python-discord/bot/blob/c4837978399ce42b7073e17bae7e30b7a43d088d/bot/exts/moderation/watchchannels/_watchchannel.py#L16
Most of the above imports could be done up like the below:
https://github.com/python-discord/bot/...
Really picky but variables should go in backquotes to indicate that it's a variable (this would apply to both constants.Guild.id and self.guild.
Haven't tested anything, but aside from the backquote comment the code looks good :+1:
Yeah, agreed. Have done left a comment on that PR :+1:
Description
This issue proposes to add more topics (number currently undecided, perhaps a few dozen) to our two .yaml files containing topic starters.
Reasoning
I've seen quite some people complaining about how the topics aren't fresh anymore and have appeared several times already. This is due to our limited quantity of them. I believe adding more topics can benefit the community, especially when sometimes we need to get a derailed conversation back on topic.
Proposed Impl...
Considering this is closed does that mean it's now supported? If so can someone suggest a bot that has this feature in it?
[python-discord/site] branch deleted: revert\-metricity\-change
GitHub Actions run 1603771653 succeeded.
Its not possible right now to use threads, no. I do know that you would be able to get some nice colours out of the codeblock by setting the codeblock language.
The main reason I was on buttons is because the suggested input does not seem the most user-friendly--but only if there's a better option.
r[insert row #]c[insert column #]v[insert # (value)]
This looks complicated to me, although its probably the best way to input a number. We maybe could try something with selects and but...
About the random titles, that was something that Shom770 pointed out in a review so I added that. It sounds like this is a standard convention for similar projects so I decided to commit that suggestion. If you think I should not have it, I think it's fine either way.
Well, we should keep them then, but I think that message should mention the user at minimum, and remove the please try again later :D
What about an image of the board that we edit every time the player makes a move? Could be done with PIL
What about an image of the board that we edit every time the player makes a move? Could be done with PIL
See https://github.com/python-discord/sir-lancebot/pull/956#issuecomment-997322591
@VRArt1 The current antispam system collects all messages within a time frame using a custom cache, regardless of the channel. You can see the code for that here:
https://github.com/python-discord/bot/blob/main/bot/exts/filters/antispam.py#L179-L182
That file is generally where most of the overhead of the antispam filtering exists.
GitHub Actions run 1604002260 succeeded.
About the random titles, that was something that Shom770 pointed out in a review so I added that. It sounds like this is a standard convention for similar projects so I decided to commit that suggestion. If you think I should not have it, I think it's fine either way.
Well, we should keep them then, but I think that message should mention the user at minimum, and remove the please try again later :D
...
Site PR has been merged, this can now be merged safely
GitHub Actions run 1604140335 succeeded.
Its not possible right now to use threads, no. I do know that you would be able to get some nice colours out of the codeblock by setting the codeblock language.
The main reason I was on buttons is because the suggested input does not seem the most user-friendly--but only if there's a better option.
r[insert row #]c[insert column #]v[insert # (value)]
This looks complicated to me, although its probably the best way to input a number. We maybe could try something with s...
GitHub Actions run 1604900601 succeeded.
Ah, yeah. That makes more sense. I agree with this suggestion.
We do go through the topic suggestions that are linked when you fire the command every once in a while.
I believe that it's time I should go through them again. Thank you for bringing this up.
@onerandomusername Actually, I did end up thinking of another way to implement the user input. We could have the user enter their input like so:
row #, col #, #
Or:
row #
col #
#
What do you think?
We do go through the topic suggestions that are linked when you fire the command every once in a while.
I believe that it's time I should go through them again. Thank you for bringing this up.
After I'm done going through the suggested topics, I'll create a PR for the new listing. I'll leave it up for a bit so I can get a good amount of suggestions.
If you have a bunch of topics in mind, feel free to put them in a comment within this issue.
There was a discussion on ...
Shivansh gave me permissions to push, so its fixed in https://github.com/python-discord/bot/pull/2021/commits/37098dfa7138bbfa7734983496bf7810692d1d1b
GitHub Actions run 1605325858 succeeded.
This issue proposes the addition of a .twemoji command. This will be useful for viewing and downloading Twemojis (the default emojis on Discord, which we base a lot of our branding on).
Proposed Implementation
Invocation
An invocation of the command could look something like this. These are all common formats for specifying an emoji. However, I might limit the available formats, in order to make things simpler.
.twemoji ๐
.twemoji \U0001f9d0
.twemoji 1f9d0
.twemoji...
6612f26 Support new guild specific avatars - ChrisLovering
8eff60e db type that supports aware datetimes in user-land - ChrisLovering
305accb Use tz-aware datetimes throughout project - ChrisLovering
a3671a8 Add discord.py thread models & migration - ChrisLovering
f412c98 Upsert threads when syncing channels - ChrisLovering
[python-discord/metricity] New branch created: message\-sync\-command
[metricity] Branch message\-sync\-command was force-pushed to `771c92a`
Adds a command to sync all messages between two given dates. This can be used if there was a bot outage, and the bot owner wants to ensure data integrity.
This could also be used to back-date what messages are stored within the database if needed.
This is currently based on https://github.com/python-discord/metricity/pull/10 so that thread messages could also be synced. This PR should be rebased onto main one the other PR is merged.
Sentry Issue: BOT-2JN
TypeError: delete() missing 1 required positional argument: 'package'
File "discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(*args, **kwargs)
File "bot/exts/info/doc/_cog.py", line 467, in clear_cache_command
await self.item_fetcher.stale_inventory_notifier.symbol_counter.delete()
File "async_rediscache/types/base.py", line 243, in wrapp...
c2da663 Correctly use string IDs for threads - ChrisLovering
[metricity] Branch message\-sync\-command was force-pushed to `6aa3958`
GitHub Actions run 1608397884 succeeded.
2c57773 Bump d.py to 2.0a0 - ChrisLovering
f2d31ec Expose psql port in docker-compose - ChrisLovering
148d66f Support new guild specific avatars - ChrisLovering
907fe8d db type that supports aware datetimes in user-land - ChrisLovering
ce2efe3 Use tz-aware datetimes throughout project - ChrisLovering
[python-discord/metricity] branch deleted: thread\-support
[metricity] Branch message\-sync\-command was force-pushed to `1a3b1c4`
There are 1 failures, 0 warnings, and 0 notices.
[metricity] Branch message\-sync\-command was force-pushed to `1a2b9c9`
[metricity] Branch message\-sync\-command was force-pushed to `f0acb5f`
GitHub Actions run 1608648989 succeeded.
78ac304 Show a warning if use_cgroupv2 is true but only... - MarkKoz
Thanks for your work on this! One problem - unarchived threads aren't added to the database, and instead throw the following:

0bfc0a5 Fix on_thread_update as it takes 2 args, not one - ChrisLovering
[python-discord/metricity] New branch created: fix\-thread\-update\-event
[python-discord/metricity] branch deleted: fix\-thread\-update\-event
That's a lot better, but now it's not setting the archived DB field to true if I unarchive a thread that was archived before the bot started, and archive it again.
It also seems to be doing a full category and thread sync when I do that?
The sync function is one big function for everything, so that explains the second part. I'll test the first thing, but the state should be updated whenever an update event is fired, regardless of previous state.
I dunno what to tell ya, haha


@gdude2002 It's actually not firing off an event at all for the situation you described. I wonder if this is from discord's end, our end, or d.py.
Discord definitely has an event for this, we have logging bots capturing it. Though, if you're still on vanilla d,py (haven't checked) then I imagine the events may be incorrect
Looking at how we check for that in KordEx (my framework for Kotlin bots), it looks like it should just be part of the thread object you get as part of the thread update event.

90840b6 Modify function signatures and use string inste... - RohanJnr
I think get_cog would be the right way to go for any inter-cog dependency. In this case, though, it is a bit different since we have a utility class in the same file as the cog. I think moving to another file sounds pretty good. I would say we should avoid making any changes to the extension loading mechanism.
Connected!
GitHub Actions run 1609142696 succeeded.
Thank you for this PR!
Really solid code, I just have some minor feedback and a small bug with the dropdowns.
A question more than anything, is it an arrow limitation that .epoch 6 hours and .epoch in 6 hours produce different results? In my ideal world, .epoch 6 hours would mean the same thing as .epoch in 6 hours
Could you explain a bit more about what this logic is doing/trying to accomplish as a comment? It's a bit non-obvious for me and I think would be helpful for others.
The message of "The resulting date and time is:" is actually quite helpful as part of the message and it would be nice if this was sent for every epoch invocation that used relative datetimes.
Closing in favour of #102. The approach taken here is inherently incorrect, and there wasn't any to salvage it.
e25773e Remove dynamic cgroupv1 creation - MarkKoz
Yes, it seems a relative time can't be parsed without an in .. or ... ago. I guess it's probably best to mention that in the docstring
Connected!
1597bd7 Fix unlimited swap memory warning - MarkKoz
ca4c955 Fix temporary cgroup path for swap controller c... - MarkKoz
It's just generated protobuf code - no need to have it under coverage.
This is only applicable to cgroupv1. Snekbox now supports parsing the NsJail config. Thus, it can compare each cgroup limit against its default value to determine if that cgroup is needed. I'm not sure if it's possible to get the default from the generated config, but it'd be nice if those didn't need to be hard-coded.
https://github.com/python-discord/snekbox-deploy has scripts to deploy Snekbox onto a Debian VM. It was originally created because we thought that #126 could only be fixed by using --cgroupns host, which is not configurable on our managed k8s cluster. While a proper fix has been found for that issue, there may still be merit to using this scripts to move away from k8s. It could let us finally use gVisor.
GitHub Actions run 1612128038 succeeded.
this could maybe be manually adjusted, by inserting "in" if it isn't there, and ago is not there
it's possible, yeah.
I think it's safe to implement it now as it is, but write a separate method to get the input so we can continue to bikeshed it and make it easier to change in the future.
Tested the PR on the following platforms:
- Ubuntu 20.04 with v1 and v2
- Ubuntu 21.10 with v1 and v2
- Debian 11 v2 (Ran out of time for v1)
Nothing seems out of the ordinary. Code eval works, resource limits work.
I was also testing Deb 10, but ran into some issues with the compose version, and didn't have time to finish testing.
it's possible, yeah.
I think it's safe to implement it now as it is, but write a separate method to get the input so we can continue to bikeshed it and make it easier to change in the future.
So are you saying it's fine to implement the user input the way I originally proposed? @onerandomusername
I'm thinking that's the input style we should use for now unless someone has a really really really great fantastic user input idea
GitHub Actions run 1612656692 failed.
GitHub Actions run 1612724495 failed.
Hey can i try these.
Yes.
@ChrisLovering That is an interesting idea, but the response also needs to include the return code of the process. I don't see how that could work.
I'm thinking that's the input style we should use for now unless someone has a really really really great fantastic user input idea
Alright, sounds good. I mean, the only other thing I can think of (and you mentioned this yourself I believe) is that I could use dropdowns. Do you think I should do that or just stick with the original proposal? @onerandomusername
Its not possible right now to use threads, no. I do know that you would be able to get some nice colours out of the codeblock by setting the codeblock language.
The main reason I was on buttons is because the suggested input does not seem the most user-friendly--but only if there's a better option.r[insert row #]c[insert column #]v[insert # (value)]
This looks complicated to me, although its probably the best way to input a number. We maybe could try somethin...
0e8ffe5 Convert all user input to lowercase - gustavwilliam
Relevant Issues
Closes #987.
Description
Please refer to #987 for a more detailed explanation of the command.
Example usage
The following screenshots showcase different formats that can be used to indicate what twemoji should be displayed.
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] Re...
GitHub Actions run 1613398061 failed.
GitHub Actions run 1613467983 succeeded.
Since, the try..except handling isn't on this line of code, it should be moved out of the try..except block.
Looks good, few minor comments.
This doesn't follow our style guide.
You can make the date_time argument required and remove this, i.e.

Besides the requested changes, great PR.
We can add events lead role ID as a constant in Roles class.
Very picky, but I would like to use gold (of the discord colour class) colour here.
Include the error with traceback here, helps in debugging the invalid json in the text.
I thought it would be helpful to bring up the help embed if no date string was given
I agree we should show the help embed every time there is an invalid input error, like how python does, I could probably open a separate issue to mention that.
I prefer it in the current implementation, where if I just invoke the command with no datetime if provides the help command without an error embed.
Which makes sense, sure, but it should be implemented on the error handler rather than on every individual command.
Bot already has it in the error handler, so we should make a issue/pull to migrate that feature over here.
I'm not sure what you mean here. Leave it as a tuple as opposed to converting to a list? We're working with a generator here so it has to be converted. Note that this is outdated code; I've since switched to filter+map. But even then the map object needs to be converted to a list
That isn't something within the original spec and I don't think it's necessary. Sourcing and finalizing the questions takes quite a bit of work, so I don't imagine I'll do that on the fly or want to.
Yes, it could be a bool instead.
This could probably need a confirmation message.
I don't think they're important enough. Right now the code yields the following rather satisfactory result for a 20s duration:
10s remaining...
5s remaining...
2s remaining...
There is no need to differentiate between 2.5s and 2s.
I'm working on reviewing this. Might take me a couple of review sessions.
You're duplicating the entire run section, which I don't think is correct. Instead, you should append the path to the existing omit on line 4. To specify multiple omit values, you can put them on separate lines, as shown in the example in the documentation: https://coverage.readthedocs.io/en/6.2/source.html#execution
Thanks for the contribution! Would you mind editing your PR description to mention the issue being fixed? For example, "Fixes #x" where x is the issue number, would associate the PR with that issue. Thus, GitHub would automatically close the issue when the PR is merged.
i am not understanding how to add multiple omit values do you have any other examples.
Look at how exclude_lines is specified currently. Notice how each value is on a new line. The same would apply to omit for what you're trying to add.
you mean like these omit =
snekbox/api/app.py
snekbox/config_pb2.py
Yes, though please indent the lines with 4 spaces, just like the values for exclude_lines are indented.
Remove these 2 extra newlines please.
Thanks for the contribution! Would you mind editing your PR description to mention the issue being fixed? For example, "Fixes #x" where x is the issue number, would associate the PR with that issue. Thus, GitHub would automatically close the issue when the PR is merged.
so
You didn't have to create a new PR. Did you close it on accident or something? I could've re-opened if you asked.
You didn't have to create a new PR. Did you close it on accident or something? I could've re-opened if you asked.
Really sorry about that i accidently closed it.
That's okay. Did you understand my comment regarding your PR description?
That's okay. Did you understand my comment regarding your PR description?
I new to github so i really did'nt get that part regarding PR description.
I edited your description so you can see what I meant.
Anyway, notice that at the bottom it says one of the checks failed. Let me give you a run down of how to diagnose this. If you click on "Details" to the left of "Lint, Test, Build, Push / lint-test-build-push (pull_request)", it'll take you to some logs which explain why the check failed.

Once there, expand the "Run pre-c...
2575966 Excluded the snekbox/config_pb2.py from coverag... - Nightfurex
Connected!
As mentioned on discord, since a spring-cleanup-like PR (I forget the number), we use list[] etc. in place of the typing variant.
GitHub Actions run 1615446125 succeeded.
Looks great and seems to be working. Thanks!
[python-discord/bot] New review comment on pull request #1889: feat: added url parsing to the filter
I'd save url.lower() and match.group(1).lower() into separate variables just because those values are used a couple of times each, but it's not a big deal here.
This PR is incompatible with #1889, and will likely require conscious review before merging main. Whichever PR is merged second will need to make those changes.
@HassanAbouelela good to know, I'll keep that in mind should mine be merged after.
Like Mark said it might take me a bit to wrap my head around all the details of this PR.
Are you sure persistence is useful here? the bot restarts once or twice a day on average anyway. You could just use an LRU cache instead (we have a utility LRU cache for async functions).
Furthermore, I might be missing something, but I don't see where you're clearing the cache of old domains. I only see deletions when you hit an expired URL (for which I'd argue that you actually want to keep it since the URL is relevant again).
Also, are you sure this should be a screaming snake case? ๐
At the moment certain URL shorteners are filtered, deleted, and cause an alert regardless of where they lead. We might not have blacklisted the destination, but that doesn't mean an alert shouldn't be made for the domain (with a ping). I think it will also be useful to show the destination as above even when we don't blacklist it. We already did the work of getting that information at this point.
The persistence is useful if we get hit with a raid and suddenly have to unfurl the same URL 300 times a minute.
It's cleared if it's pulled after expiring, which in practice means the data is only ever a day old, or however long it is.
The case is for constants, I think we use it like this elsewhere too.
Any blacklisted redirect domains will send an alert no matter what. The only thing that changes is the mod ping, because I don't think we need to alert whenever someone uses a link shortener.
The reason the link isn't there is to avoid making the embed larger than needed, and let mods run the unfurl command if they want that info. If we want to add it, it'll be pretty easy.
The cache is useful in case of a raid, not necessarily the persistence. For the cache you could use a simple LRU cache as mentioned.
It's cleared if it's pulled after expiring
Right, but I argue that many URLs are unlikely to be pulled after expiring.
I donโt think thereโs much harm to doing it in redis. Itโs pretty easy to use. As for the point about expiring, the goal isnโt to remove the entries from the table. The goal is to not provide the user with outdated data.
We could run it by the mods regarding the ping, but I do think there's no reason to not show the unfurl information when it's already fetched.
In fact it's not a matter of how many URLs won't be pulled, as long as there are any URLs which won't be pulled. The cache will just continue growing indefinitely.
Thatโs true, Iโm not sure itโs a problem. We can add an occasional vacuum task, but I donโt know when I can code again
I donโt think thereโs much harm to doing it in redis
The harm is that I think it doesn't help much while complicating the code. When you need to manually manage insertions and deletions, make sure it's occasionally vacuumed, and write separate tests for it, just slapping an LRU cache decorator on unfurl_url seems appealing to me.
[python-discord/site] New comment on pull request #624: Content: update help channel claiming system
There is a minor markdown error on another guide page which I will attempt to fix along with this PR.
Bunch of suggestions for doctsrings, comments, and log messages. Tried to make it easy for you by including the actual diff, so you can easily commit them.
I think returning None when something fails isn't good design for this. It would make more sense to raise an exception and let it propagate to the caller of unfurl_url. An exception is more explicit and in some sense less error-prone than returning None (since one can forget to check for None and get a TypeError/AttributeError). Inste...
This is a comma splice.
dest = f"Result was too long to display. You can find it [here]({paste})."
Don't use "we".
Colour the embed green if the final destination of the url is found correctly.
Otherwise, colour it red.
Use the imperative mood.
Unfurl to a maximum depth of `max_redirects`.
I asked about it, but was told we didn't have support for it in the library. Seems like a better idea.
Can an LRU cache be skipped actually?
Anyways, the reason the worker doesn't handle the cache is because there are much more strict limits on storage in CF workers, and we'd waste a bunch of time waiting for the request + lookup instead of just lookup. It could in theory be done though.
We want to fail quickly if running in filters so the filters aren't slow, but the command may place higher importance on finding a result instead of time.
It's actually possible to make the distinction. When the unfurl succeeds or when there are too many redirects, return as normal. When there is an error, raise an actual error and the LRU cache won't be able to cache the result.
That said one can argue that we actually do want to cache failures because if we're bombarded with a redirect in a short amount of time, and the first try fails, it's reasonable to assume the rest will too. It's an unlikely scenario, but then again that's one of the...
If an error is raised for all failures, then it's impossible to get partially successful results.
Well, I suppose the object could be an attribute of a custom exception, but I'm not sure if this is a nice design in this case.
I'm looking at unfurl_url and I'm not sure what you mean. The only scenario I see where we might want to not cache is for a 400. For other cases I think it can be assumed that the redirect chain is unlikely to change in the near future (in which the cached result will be relevant). And in any case, the failure reason can be the exception message and retrieved in the except clause of the caller.
I would still like the bypass_cache argument to be a thing, is that possible with an LRU cache?
To expand on that: a malicious attacker can bypass our filters by sending the link once to a safe destination, then changing the destination.
This seems to undermine the very idea of any cache, including the redis one. How will you tell when to use it without actually unfurling the link again?
You wouldnโt, but you can force update the link if you know the link needs updating. Keep in mind that such an attack would be done by someone that has to be familiar with our systems, so weโll likely notice that something is wrong if we see someone suddenly posting a ton of links to a seemingly safe destination.
You mean with a command? I guess if you want to do it manually you can invalidate the cache entry directly. Looking at utils/caching.py you might want to allow caching with no size constraint, similarly to https://docs.python.org/3/library/functools.html#functools.cache
The behavior I'm describing is already possible with the current unfurl command added by this PR. It's facilitated by that option.
Oh, I didn't review the command yet. Yeah I guess you can just remove the key from the dict first.
c1593a6 Fix markdown error linking to recommended editors - minalike
0dc2e2a Update wording in topical and general help chan... - minalike
5403f81 Add Frequently Asked Questions header - minalike
75cde82 Update channel dormancy timings - minalike
0219d94 Add "no one answered me" question and answer - minalike
GitHub Actions run 1617297658 failed.
GitHub Actions run 1617316001 succeeded.
[python-discord/site] New comment on pull request #624: Content: update help channel claiming system
Besides the original intent of this PR (to describe accurately the timings for when help channels go dormant), I aimed to remove information that isn't specifically pertinent to the question at hand, or specific to the topic of "how to get help." Small edits here and there to improve readability.
Reviews welcome.
To whoever eventually hits the merge button: squash.
I currently don't have ideas for implementations of the current way we go through suggestions.
This is a comma splice
## Q: I don't need my help channel anymore; my question was answered. What do I do?
This isn't accurate. If the claimant sends a message, and then another user immediately sends a message, the channel will still close in 30 minutes. It does not get delayed by 10 minutes in such case. An accurate way to describe it is "it closes 30 minutes after your last message or 10 minutes after the last message sent by another user, whichever time comes later."
You omitted the explanation of each category when discussing the channel cycle in "For how long is the channel mine?" Thus, I think mentioning the dormant category here may be confusing. Do you think it's worth elaborating a bit on what being moved to that category means?
Ok, so based off [this discussion](#dev-contrib message) (starts there), I have made my final (hopefully) decisions as to how I (and others) want this implemented.
- Instead of a 4x4 (or 9x9 for that matter), I will be making a 6x6 grid generator instead
- I will not be adding the embed that says whether a user's input is right or wrong
- I will also be alphabetizing each column and numbering each row as shown in the attach...
Initial semi-indepth review
NIT: We have backquotes around code values to distinguish them from general text, so None.
I think there's also a typo (codepoints --> codepoint - the parameter). If this is the case, then again, it should have backquotes around it to indicate that it's code.
Is there a reason you have "code point" and not "codepoint" here? Everywhere else it's one word.
NIT: If you're need to change this line anyway, then it'd be nice to make the error capitalised ("Please include...")
According to the function annotations, codepoint is already a string?
It is, and the return value is also a string. See the examples in the docstring.
Not sure if I'm understanding your question correctly?
This always returns the most trimmed down format. I could, however, specify that more clearly.
He is basically saying why do we need to call str() on codepoint if the parameter codepoint is already a string.
I'll make it consistent. Autocorrect seems to prefer "code point", but I'm more of a fan of "codepoint"
This ^ @gustavwilliam. If it's already a string then why are we converting it to a string again?
Right, I see. Keep the error lowercase then. I too prefer codepoint over code point by the way so would keep it one word.
Oh, my bad, didn't look at the source when was commenting on this, it is _ctx since I am not using it anywhere.
GitHub Actions run 1619075732 succeeded.
ignored_tokens is only used on "".join() which works with a generator, so we can remove the list call and keep it as
ignored_tokens, date_time = (a.strip() for a in date_time[1] if a.strip()), date_time[0]
GitHub Actions run 1619287268 failed.
GitHub Actions run 1619299997 failed.
Ah, good catch! I'll investigate.
I would rather keep it as a list. With a generator, the condition if ignored_tokens: is True, even when empty
9a767b6 Block submission when missing OAuth2 scopes - jb3
[python-discord/forms-frontend] New branch created: jb3/block\-submit\-missing\-oauth2
This PR blocks form submission until authenticated with the required scopes for the form. If the Enter key shortcut is used to submit early without filling in auth the form is automatically scrolled to the bottom of the page.
21f76a2 Skip one of the FormPage tests that throws errors - jb3
[python-discord/forms-frontend] branch deleted: jb3/block\-submit\-missing\-oauth2
How about just "My question was answered. What do I do?"
Description
I would like to create a Kenken game command. You can read more about the game here: http://www.kenkenpuzzle.com/howto/solve#
Thanks to @Sn4u for the original suggestion! [Link to discussion](#dev-contrib message)
Reasoning
I've played this game before at my middle school and it's a fairly easy game to play.
Proposed Implementation
This will be an image-based game where the bot will choose ...
async for log_entry in mod_logs_channel.history(limit=100):
There's no need to flatten it and then iterate through it.
You may have forgotten to remove this print.
Shouldn't results[0] == link?
I just have one comment I would like you to adress, this is looking great.
What's wrong with async with self.leader_board_cache_lock:?
It will also handle exceptions and cancellations because the lock will always be the released. Considering the amount of usage this could end up getting, I would like to see this changed so that we don't end up with locked lock that no task ends up releasing.
Works nicely, thanks to everyone involved!
The behaviour of the PATCH/PUT method is a little unexpected. You can send a request to /api/bot/off-topic-channel-names/existing-name with the body {"name": "another-one"}... which causes another off-topic name to be created.
That said when using PATCH correctly it worked nicely and made the names no longer show up when specifying ?active=true (as expected from the changes by this PR).
Uh oh, because of the code below it won't this try to iterate the string?
activity_output = "\n".join(
f"{name}: {metric}" for name, metric in zip(["Messages", "Activity blocks"], activity_output)
)
Shouldn't it be activity_output = ["No activity"]? Have we never hit this codepath?

