#dev-log
1 messages ยท Page 89 of 1
GitHub Actions run 1485310581 succeeded.
- This PR adds substantial pytest fixtures that can be used in the future. (More about the topic)
- It also introduces changes in the linting-testing workflow:
- Add a test database to the workflow
- Migrate reminders endpoint
- Furthermore Database enhancements have been implemented.
What we want
We would like to consider parallelising the execution of tests.
How did we do it
This can be done with pytest-xdist
What problems do we face
- We might need to change how the database is created. For example, creating a new database for each worker
My proposal is to just simply create test databases using worker ids See I have already added the logic to my PR that could be modified.
(We're talking about a fairly easy modification)
Connected!
377dcf9 Add Better Support For Whitelisting DM Commands - HassanAbouelela
[python-discord/sir-lancebot] New branch created: dm\-check
Sentry Issue: SIR-LANCEBOT-6Z
AttributeError: 'NoneType' object has no attribute 'get_role'
File "discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(*args, **kwargs)
File "bot/exts/events/advent_of_code/_cog.py", line 71, in aoc_subscribe
role = ctx.guild.get_role(AocConfig.role_id)
Unhandled command error: 'NoneType' object has no attribute 'get_role'
The ...
[python-discord/bot] branch deleted: disable\-file\-logs
Connected!
GitHub Actions run 1485534112 succeeded.
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #952
Description
Disabled commands in DMs by default. Note that this only disables the invocation of a command in DMs, not handling of messages. This means commands which use DMs for other purposes, such as battleship will still work. (Tested with a game of battleship against @Akarys42. Issue will be updated with the victor)
Adds a toggle to the whitelist ove...
GitHub Actions run 1485545016 succeeded.
Relevant Issues
- -
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
The PR introduces a quick fix to the AoC day and star stats feature, since it was tested on a fully populated leaderboard.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and ...
GitHub Actions run 1486629795 succeeded.
GitHub Actions run 1486634063 succeeded.
Connected!
GitHub Actions run 1487230914 succeeded.
GitHub Actions run 1487294555 succeeded.
I'd like to work on this issue.
Works great from the testing I've done, thank you!
Not sure if this would be out of scope for this tag but I think it'd be a nice addition to reference https://typing.readthedocs.io/en/latest/index.html as a more general user focused resource on static typing as it'd be next logical step after learning about type-hints IMO.
Yes, there are plans for adding more content like that but it's limited by people's time.
e9c2bcc Send webhook embed containing information about... - Shivansh-007
a2958fb Add incidents webhook to default config template - Shivansh-007
c32aee3 Send multiple webhook messages in case of more ... - Shivansh-007
7c4fdba Use MessageConverter to find messages - Shivansh-007
d521273 Use str() when checking for message.content - Shivansh-007
[python-discord/bot] branch deleted: allow\-reply\-in\-remind
GitHub Actions run 1489149189 succeeded.
Connected!
GitHub Actions run 1489158920 succeeded.
Due to how we select the channels inside the duckpond cog, if the channel is a thread the bot cannot find it
This raises a question though, why are we using on_raw_reaction_add and not a normal on_reaction_add with all the payload already resolved? I couldn't find the information in #621, maybe @lemonsaurus would remember?
We can make this a list comprehension, I am not sure how much experience you have this those. It would look something like this:
blanks = [self.edited_content.pop(msg_id, submitted_words[msg_id] for msg_id in submitted_words]
This could also be a list comprehension - but I think it would become to long so it is probably fine.
We need some form of if-statement so that not all messages get added here.
I have an idea, in discord.py there is a way to say how many commands can get used at once. If we use this we can limit the amount of commands to one at a time, then completely reset this dictionary each time the command ends.
Maybe with a before and after hook we can setup so that some form of attribute gets set that says that a command is ongoing? That way it'll run even if the command errors out.
You can just simplify it like this:
submitted_words[message.id] = message.content
Maybe we can just make a copy of the list (using [:]) and then pop/remove items from it rather than modifying it with the visited key?
Is there a reason you went for setting that key rather than something like this?
Wait now why exactly so we remove as much as the user would've won if it wasn't for whatever the if-statement tests?
Could technically be a property no?
@Akarys42 This is a duplicate of #1930.
From #1968 (a duplicate of this issue).

CC @Akarys42 @lemonsaurus
Have copied this into #1930. Will close now as it's a duplicate.
It was done because we wanted to be able to duck messages even if they aren't in the cache.
With Continuous Deployments, the bot is quite frequently clearing the cache, and it would be poor user experience if it wasn't possible to duck a message just because there happened to be a redeploy right after the message.
If this isn't a problem, or if we can solve this problem without raw reactions, I'm sure that would be fine.
Please donโt open issues without descriptions. Closing this as spam.
we could easily solve this by adding the guild.channels and guild.threads lists together and then using get on the channel_id.
I forgot reaction_add doesn't fire on messages outside of the cache, that's stupid. Yeah, I think searching both the channel and thread list is a good solution.
we could easily solve this by adding the guild.channels and guild.threads lists together and then using get on the channel_id.
This sounds good. I'll PR this by (hopefully) the end of the week :+1:
I am a bit familiar with list comprehensions. I will accept this suggestion.
GitHub Actions run 1490119658 failed.
Can't I just use the author_check you added to my main program? @Bluenix2
GitHub Actions run 1490129728 failed.
Yeah, I'm afraid it will go over the PEP 8 line limit if I do. I'll resolve this, if you don't mind. @Bluenix2
List comprehensions don't need to be on one line. ```
story = [
f"{value}{blank}"
value, blank in zip(random_template["value"], blanks)
]
I'm not saying whether you should or shouldn't do this, I just noticed this thread so thought I'd comment.
Well yes it could, I just think it looks nicer the way I have it now. @ChrisLovering
This listener is not aware of that author check.
Well right now it isn't of course, but could I add it here? Would it work? @Bluenix2
Sadly no, because there's no ctx.
Ahhh, ok. Well could I add it as a parameter to the function? Would that work? @Bluenix2
No that wouldn't work either because discord.py creates the ctx for each command. So we need to somehow tell the listener each command running - kind of like how/what I suggested!
Ok, I see. I'll think about what you suggested then and if I have any questions, I will ask. Thanks!
This PR adds a tag on how to
make / commands or context-menus in d.pyv2.0a
GitHub Actions run 1490374471 succeeded.
This has fixup commits, so please do not update this branch when it's approved.
Doing so would stop me from being able to rebase and actually fix them up. Just ping me when it's ready and I'll rebase properly.
544dff5 Notify user leaves, kicks and joins in threads - Qwerty-133
[python-discord/modmail-plugins] New branch created: notify\-fix
In its current state, the on_member_join and on_member_remove events don't use locks, so the order in which they execute isn't fixed. That can lead to a misleading order of messages. This PR changes that and improves the messages for different scenarios.
_maybe_kick_user is also refactored to return a boolean for whether the operation was successful.
Hello @Rishiraj0100,
Please leave a suggestion on python-discord/meta before opening a PR for a new tag. Right now we don't want to show what could be perceived as open support to a discord.py library or another.
1872bb1 Deal with activity_blocks not being returned by... - ChrisLovering
[python-discord/bot] New branch created: optional\-timeblocks
We are planning to change metricity endpoints on site so that activcity_blocks are not returned if the user has more than 1000 messages. This is because the query to calculate those blocks can get expensive at a high message count.
To deal with this, both places activity_blocks are used has been changed to reflect this planned behaviour.
Screenshots
0 activity

Minimal acti...
GitHub Actions run 1491575664 succeeded.
this should not be excluded from the entire source, IMO. Just where its used should have # noqa
Why is this required for testing? Why not have it be automatically defined by the test suite itself if this does not exist?
Seems okay for what it does.
Would like to see a few sentences in the readme to clarify that the database must exist to run the tests at this point.
OR as discussed on discord, recommend running the tests on docker if support is added. ๐
I think it's best not to specify any value.
If you run the tests in docker you'll have the env variables pre-set.
In Github Actions, I think that does not make much of a difference.
See site..
We might use FastAPI dependencies all around the code, it would be a burden to do it in the repository everywhere we use them.
[python-discord/site] New branch created: don't\-always\-calc\-activity\-blocks
https://github.com/python-discord/bot/pull/1971 must be merged before this.
We only truly care about how many activity blocks a user has when they have a small number of messages, as we only use this for the voice gate.
If a user has more than say 1k messages, then we really don't need to calculate their activity blocks, as it's quite an expensive query with many messages.
Also, for the tests we only actually care that thee key:value pairs are equal, the order of them isn't actually ...
GitHub Actions run 1492038220 succeeded.
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Discussion: [#dev-contrib message]
Description
This PR is simply to fix a grammatical mistake in the description ("brief") of the .spookify command on Sir Lancebot.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template...
GitHub Actions run 1492178832 succeeded.
Connected!
GitHub Actions run 1492208289 succeeded.
GitHub Actions run 1492290064 succeeded.
Hey @TizzySaurus, would you be able to continue working on this?
Sentry Issue: BOT-1QT
HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In content: Must be 2000 or fewer in length.
File "discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(*args, **kwargs)
File "bot/exts/info/site.py", line 129, in site_rules
await ctx.send(f":x: Invalid rule indices: {invalid}")
File "discord/abc.py", line 1422, in send
...
LGTM.
I added the "do not merge" label to prevent somebody from merging it before the bot PR is merged.
[python-discord/bot] branch deleted: optional\-timeblocks
GitHub Actions run 1494614467 succeeded.
Connected!
Since you'll be changing other code can you also take the to add a comment about why we do this?
I know why as we've been talking about it, but I don't know how clear it is to others.
Not the biggest issues though but shouldn't take too much effort if you're changing other things.
This is no longer true, all this does is generate the embed.
Something worth mentioning if it's useful is that
channel.delete_messages()special cases when you send it an iterable with just 1 element. In this case, it uses the normal delete_message() function. Whereas if you pass it more than 1, it uses bulk_delete, which does not raise any errors.
does that mean delete_message() is raising error because an iterable is passed to it?
No, this means that channel.delete_messages() will only raise a message not found error for the case where an iterable of length 1 is passed to it, since then it will just use the delete singular method.
For actual bulk-deletion channel.delete_messages() ignores that error.
so basically it needs await channel.delete_messages(to_delete) to be under a suppress block right?
so basically it needs await channel.delete_messages(to_delete) to be under a suppress block right? @ChrisLovering
5b1bb82 Alter message query to leverage index - ChrisLovering
[python-discord/site] New branch created: alter\-query\-to\-leverage\-index
Previously this query would convert each row to an array just to check if it matched or not. By changing EXCLUDE_CHANNELS to a tuple instead of a list, it doesn't get passed as an array, so we can do a simple NOT IN check.
This will also allow us to add an index with this condition to speed it up further.
GitHub Actions run 1495699251 succeeded.
Let's squeeze that speed fruit. Should it be merged yet?
Let's squeeze that speed fruit. Should it be merged yet?
yup, it's good to be merged
Sure, I can do that.
Personally, I like the idea of a complement or other color harmony command, however I don't see much utility of one for darken / lighten. If you really needed to darken or lighten a color, you could take the hsl part of your color and modify the lightness attribute.
The option to allow users to specify more than one color in a single command would be useful. I had an idea for an alternative approach. A "โ" reaction would show up after color embeds that lets the user save the color into t...
GitHub Actions run 1499287854 succeeded.
Now that we've moved to discord.py 2.0 we have access to
discord.ext.commands.flagsmeaning we can have almost-UNIX-like command flags, so a possibility would be a command like:
!black --line-length 120 <code>
I do like the rest of it, but want to clarify, discord.ext.commands.flags are not unix-like.
The command would be more like this: !black line-length:120 code:'code to blackify'
to have an actual interface like that, we could use argparse on the command input.
Thank you for your PR!
I think we can leave out the suppress in one of the two spots, I left a comment there. Otherwise, this looks great.
I believe in this case we can leave out the suppress, as we know it will be a bulk delete per len(to_delete) == 100, which doesn't care that the messages are absent.
I agree.

My bad I missed, it was specified there.
Connected!
GitHub Actions run 1500273875 succeeded.
GitHub Actions run 1500492258 succeeded.
I'm not convinced the linters and type checkers make sense to add. There was a discussion about black here before #community-meta message
That said, I'm not sure how widely useful it would be in the server
That's a red flag to me. If there is no good justification, then it should not be done. Please let's not agree to adding features without solid reasoning. Maybe I'm the odd one out, but I am against adding features just f...
Looks good to me, fix up the tests and it's good to go!
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #937
Description
I created a new .christmasify cog in the avatar_modify.py file. I made this command very similar to the currently existing .spookify command, with different images to represent Christmas / New Years.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
...
GitHub Actions run 1501347337 succeeded.
GitHub Actions run 1501358965 succeeded.
GitHub Actions run 1501362121 succeeded.
Closing as resolving PR #1976 was merged. FYI @git-zephyrus any variation of solve won't work, you'll need to use fix, close, or resolve (or their plural / past tense forms).
Aah, usually you have the comment before the code it is referring to ๐
Dont forget to cleanup here (remove the check and remove messages from edited_content that has been added as a result of the check)!
We don't want to be leaking these and creating a huge dictionary that keeps all messages alive.
I don't see you removing the check in the end, can you do that?
The game itself works pretty well! Two suggestions from me however -
1 ) Change the text to text when the embed with all the words used and formatted into the prompt
2 ) We could use validation for checking whether something is a verb, noun, or adjective? Not sure about plural nouns or places, but we could use nltk.corpus.wordnet for validation. This is something that is more of a consideration as it depends on what you want to do.
@ichard26 Sorry I don't get what you mean ?
any variation of solve won't work, you'll need to use fix, close, or resolve (or their plural / past tense forms).
@ichard26 Sorry I don't get what you mean?
The original inspiration for this issue was a command to assist in typing conversations, and it was limited to mostly mypy.
The idea behind the other commands (at least ones like black which have the same -c interface as mypy) is that there shouldn't be much (if any) additional code required to make them run.
GitHub Actions run 1503329483 failed.
You can use special keywords in the PR description so GitHub will automatically close an issue upon merge. You can read more here: https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword. This makes sure any issue that should be closed are in fact closed (and I won't have to go proactively hunt for such issues!), keeping our very chaotic issue tracker ever so slightly less chaotic and scary :)
I th...
Oh. No, I didn't knew actually this was my first commit. Anyways thanks for telling, will make sure next time.
GitHub Actions run 1504956580 succeeded.
Congratulations then! ๐
@dusk berry force pushing could be harmful! be careful!
Thanks! I will make sure to watch out in the future.
GitHub Actions run 1505073919 succeeded.
GitHub Actions run 1505096420 succeeded.
GitHub Actions run 1505102831 succeeded.
FWIW I don't think Black needs to be a first-class command especially as https://black.now.sh exists. I can't imagine it'll be used often enough to justify the (even if minor) maintenance cost. If someone wants to demo Black they could just point to a pre-filled Playground URL. I'd argue that adding Black as an available snekbox package would be more useful once we declare an official API for Black and start getting more user help requests in regards to that. I suspect this would be easier to...
Thanks you so much :) and thanks everyone for helping me out.
Hey, sorry for the late update but i may not be able to work on this as i'll be away for a month :(
I'm quite interested, could I take your place? Are you still working on this @mathstrains21?
Hi!
We haven't actually done any work on it yet! Could you message me on
discord please? (mathstrains19#2057)
On Fri, 26 Nov 2021, 16:40 bones, @.***> wrote:
I'm quite interested, could I take your place? Are you still working on
this @mathstrains21 https://github.com/mathstrains21?โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/python-discord/sir-lancebot/issues/787#issuecomment-980119642,
o...
How does this interact with filesystem permissions?
I've previously had Docker mess up my local project directory (requiring me to chown all of them as root) when volume mounting.
[python-discord/site] New comment on pull request #624: Content: update help channel claiming system
Hi @Akarys42, have you had time to look at this yet, or could you use a helping handร
This is pretty genius. Thank you!
a77d115 Direct appeals to the appeals server - ChrisLovering
455dc79 Restructure bot contributing guide (#591) - mbaruh
8273372 Fix typo in bot guide - mbaruh
58607ec Merge pull request #613 from python-discord/mba... - Akarys42
f5ab651 Merge branch 'main' into new-ban-appeals-process - ChrisLovering
[python-discord/site] branch deleted: redirects
GitHub Actions run 1508741334 succeeded.
GitHub Actions run 1508746914 succeeded.
Ah no idea, I have a windows host and file perms are fine, I'd appreciate you checking if you're on a linux host
The seems to work well locally ๐
f093907 Create a signal to unassign roles from user whe... - D0rs4n
0f24bdc Add test to check role unassignment - D0rs4n
9d255dc Patch roles test to use fresh instance from the DB - D0rs4n
f34a520 Patch signals to use post_delete, instead of pr... - D0rs4n
053d43e Merge pull request #572 from D0rs4n/pr/deletero... - jchristgit
GitHub Actions run 1508840607 succeeded.
GitHub Actions run 1508847856 succeeded.
77da014 Clean Up Static Deploys Readme - HassanAbouelela
- Fixes a typo in the generation task
- Cleans up the readme
GitHub Actions run 1508864595 succeeded.
I'd also like to see something like .colour list 87ceeb ff0000 ffaabb which would show an image like:

constants.Colours.bright_green and constants.Colours.soft_green both exist, and they're very similar. (For reference, orange and soft_orange are nowhere near each other.)
bright_green is only used 3 times: twice in the help channel system and once in the modpings cog. soft_green is used 19 times across 12 files.
I propose that we make all the green color usages the same, keeping only one and possibly ren...
[python-discord/bot] New branch created: bsoyka/greens
7fbe4f8 Combine bright_green and soft_green constants t... - bsoyka
This closes #1977 by doing the following:
- Replace
bright_greenwithsoft_green. - Rename
soft_greentogreen.
GitHub Actions run 1509700405 succeeded.
You've not missed any migrations etc. just one concern I have.
We should probably do the same thing with sir-lancebot too.
I'm inclined to keep this the same name for the sake of easily referencing it with the discordpy docs. We do this with all the other colours, so I'm not sure this is a good reason to strafe from that.
This is made worse by the fact that it's actually misleading (rather than just confusing having a non-existent colour) since discord.Colour.green is actually 0x2ecc71, not 0x68c290 (which are rather different).
I agree with Mark here, took me a moment to figure out why the command wasn't doing anything ๐
Tested with:
diff --git a/pydis_site/apps/api/models/bot/message.py b/pydis_site/apps/api/models/bot/message.py
index 60e2a553..8261b4fc 100644
--- a/pydis_site/apps/api/models/bot/message.py
+++ b/pydis_site/apps/api/models/bot/message.py
@@ -27,7 +27,7 @@ class Message(ModelReprMixin, models.Model):
author = models.ForeignKey(
User,
on_delete=models.CASCADE,
- help_text="The author of this message."
+ help_text="The creator of this mes...
Yea, that makes sense. We have two options here docker-compose up or docker-compose up --no-recreate or docker-compose up --force-recreate.
The former checks if there are any changes to pick up, if there are it recreates the containers then attaches to them. The latter attaches to the currently running containers and doesn't do any changes.
I'm leaning more towards the latter.
IE for the latter this task would become `docker-compose up web -d --no-recreate && docker-compose exe...
Hmm alright I can investigate this perms issue a little later, I'm a little lost at first glance.
Is there a way to pass this arguments, or even make it mandatory?
Yea, I can add--nameon the end of this task, which would work the user to dopoetry run task dockermigrations <name>. I only did it this was for consistency with themakemigrationstask.
Forcing a named migration probably is best here.
9:34:23 PM: Action isn't ready, sleeping for 10 seconds.
Action isn't ready, sleeping for 10 seconds.
Action isn't ready, sleeping for 10 seconds.
Action isn't ready, sleeping for 10 seconds.
Aborting build due to a failure in a previous CI step.
What's going on there?
Ah, I think I know. Will fix it
GitHub Actions run 1510500459 succeeded.
Does this work correctly?
utcnow() returns an unaware time. For example 14:00, then an hour is added so that it becomes 15:00. In my timezone the final timestamp will become 15:00+02:00 as in 17:00 when it should be 15:00+00:00 โ right?
Shouldn't it be async with or at least await ctx.typing()?
A small typo here yeah?
After some #dev-contrib discussion, it might be easier to simply adjust one or two of the soft greens to use bright green.
The original intentions behind this issue were to make these two messages, which are in the same place and both related to the help system, match:

Instead of combining the two colors altogether, I'll change the helpdm message to use bright_green.
[python-discord/bot] branch deleted: bsoyka/greens
[python-discord/bot] New branch created: bsoyka/helpdm\-green
0779db2 Use bright_green for "Currently Helping" DMs - bsoyka
You can pass different arguments to that command to get a different result. It may work, it may not. It's a rather unlikely situation to be in in the first place.
Closes #1977 by using the bright_green color for "Currently Helping" DM embeds.
(This is a replacement to #1978 after discussion in #dev-contrib.)
GitHub Actions run 1510828632 succeeded.
Hey! Would you mind opening an issue (and a PR if you'd like to) in the API repository regarding the database model changes?
@ChrisLovering I can take on this one. :)
[python-discord/bot] New branch created: bsoyka/rules\-bug
68f27b7 Limit length of the invalid rule indices message - bsoyka
[python-discord/bot] Pull request opened: #1980 Limit the length of the invalid rule indices message
This closes #1975, which shows that extremely long invalid rule indices errors, as shown below, throw an error if the message is long enough.

This PR limits the length of the invalid indices string to 50 characters to avoid errors like the one shown in Sentry.

GitHub Actions run 1511345255 succeeded.
94944ca Change placeholder for invalid rules message sh... - bsoyka
Changed the placeholder since it's ... everywhere else across the code.
[python-discord/bot] branch deleted: bsoyka/rules\-bug
GitHub Actions run 1511350977 succeeded.
Connected!
GitHub Actions run 1511357995 succeeded.
7e8ecb4 Add missing space in text shortening placeholder - bsoyka
[python-discord/bot] New branch created: bsoyka/rules\-shortening\-space
This is a quick visual fix to add onto #1980. It adds a space before the ellipsis in the placeholder.

[python-discord/bot] Checks Successful on PR: #1981 Add missing space in text shortening placeholder
GitHub Actions run 1511364194 succeeded.
[python-discord/bot] Checks Successful on PR: #1981 Add missing space in text shortening placeholder
GitHub Actions run 1511383737 succeeded.
I had an idea to implement a drop-down where you can select different timestamp styles to be used with discord. I've inserted a screenshot below. Is this something we would want?

Does this code runs on 3.10 version? Maybe it can be done with the new pattern matching feature.
@zeph-yrus9 The bot only runs on Python 3.9 right now, so unfortunately not.
The game itself works pretty well! Two suggestions from me however - 1 ) Change the text to
textwhen the embed with all the words used and formatted into the prompt 2 ) We could use validation for checking whether something is a verb, noun, or adjective? Not sure about plural nouns or places, but we could usenltk.corpus.wordnetfor validation. This is something that is more of a consideration as it depends on what you want to do.
This comment no longer applies.
Connected!
GitHub Actions run 1512088996 was cancelled.
How would I let admins (or whatever role we want) send it in community meta, while the rest of the community can only send in the bot command channels?
GitHub Actions run 1512090138 failed.
assuming the ones that chris posted in #1765 are correct, then these are correct
b57af0e Use bright_green for "Currently Helping" DMs (#... - bsoyka
[python-discord/bot] branch deleted: bsoyka/helpdm\-green
GitHub Actions run 1512287362 succeeded.
19a21dc Add check to ensure the day-and-star data exists - D0rs4n
3d254ed Merge branch 'main' into patch-aocdayandstar - Akarys42
f5deb3b Merge pull request #954 from D0rs4n/patch-aocda... - Akarys42
0a1ded2 Fix a grammatical mistake in the description of... - DMFriends
ef9d438 Merge pull request #955 from DMFriends/christma... - ChrisLovering
[python-discord/sir-lancebot] branch deleted: file\_logging
GitHub Actions run 1512292219 succeeded.
Connected!
GitHub Actions run 1512295250 succeeded.
Connected!
GitHub Actions run 1512297613 succeeded.
[python-discord/site] New comment on pull request #624: Content: update help channel claiming system
Hi @Akarys42, have you had time to look at this yet, or could you use a helping hand?
I can look at it later this week, but if you want to have a go, feel free :+1:
35c8c0a Rename channels.discord_py to discord_bots - bsoyka
[python-discord/bot] New branch created: bsoyka/discordpy\-bots
Since this is such a minor change, I'm just PRing it (at the advice of a core dev in #dev-contrib). However, there's a slight issue of whether this might affect stats too much, so I'm CCing @jb3 here for an opinion.
GitHub Actions run 1512791750 succeeded.
GitHub Actions run 1512817240 succeeded.
This also changes the length from 50 to 75. Was that intentional?
This also changes the length from 50 to 75. Was that intentional?
@jchristgit Yes, because similar to how this is done elsewhere in the bot's code, the :x: Invalid rule indices: string is now part of the shorten call, which adds about 25 characters.
From the docs:
This is both a regular context manager and an async context manager. This means that both with and async with work with this.
I see we use both around the code base, I don't know if there is any particular benefit to using the other manager? Under the hood, d.py just puts this in an async task either way.
It's a useful utility for moderation, but there is no extra development or running costs to allow users to run it. I added the cooldown check to avoid spam, but honestly, it uses an unlimited resource, so we don't even need that. I think it's a nice feature to have.
It seemed to work in my testing, but perhaps it's because I'm ahead of UTC, so the time would be in the past regardless.
Fixed in e071154c
I believe I've addressed all comments on Tizzy's review, but I can probably clean the commit history before merging.
GitHub Actions run 1513248669 succeeded.
I'd like to work on this issue. Is there anyone else currently working on this?
This needs to happen before sending the message (preferrably directly after defining blanks) to avoid a race condition.
Wait this only catches 3 numbers (11, 12, 13)?
sorted_lb = sorted(unsorted_lb.items(), key=lambda kv: kv[1], reverse=True)
top_ten = sorted_lb[0:10]
for rank in range(len(sorted_lb)):
if sorted_lb[rank][0] == author_id:
break
else:
rank = 0
There's a default argument just for this purpose ๐
Also just now realized the name should be author_rank in the loop, unless you change the usages of it.
After the channels were changed to a set I am getting this crash loop:
sir-lancebot | Traceback (most recent call last):
sir-lancebot | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 672, in _load_from_module_spec
sir-lancebot | setup(self)
sir-lancebot | File "/bot/bot/exts/events/advent_of_code/__init__.py", line 8, in setup
sir-lancebot | from ._cog import AdventOfCode
sir-lancebot | File "/bot/bot/exts/event...
Sounds good, will do.
Other than this small regression, the rest works. I am ready to approve when that has been fixed.
Can you look over these again, the result are a bit unsatisfactory at times. For example, there's inconsistencies with where "a" is used:

It says "pizzeria" but "a mouse"
Hmm, I see the same argument for making those comments really. But yeah it's not the biggest thing.
Yea, the comment is describing what the ints within it signify, whereas plain typehints don't cover that.
This was brought up internally and voted on on the staff meeting today. We've decided we'll allow the uploading of .csv and .json files!
I won't include the reasoning here, but if you're curious feel free to ask in server.
We need to adjust our python bot to not automatically delete those files.
Resolved by @ChrisLovering with a couple commands, turns out the filter for this is dynamic. ๐
GitHub Actions run 1514121612 succeeded.
GitHub Actions run 1514368603 succeeded.
be7da6f Change MODERATION_ROLES and STAFF_ROLES con... - TizzySaurus
0d51688 Start from upstream main branch - brad90four
15d545e Create draft body of file - brad90four
969ab35 Add colorsys import, verbage for using JSON - brad90four
b66e613 Added ryanzec_colours.json constructed from rya... - CyberCitizen01
663b528 Added ryanzec_colours.json constructed from rya... - CyberCitizen01
After the channels were changed to a set I am getting this crash loop:
sir-lancebot | Traceback (most recent call last): sir-lancebot | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 672, in _load_from_module_spec sir-lancebot | setup(self) sir-lancebot | File "/bot/bot/exts/events/advent_of_code/__init__.py", line 8, in setup sir-lancebot | from ._cog import AdventOfCode sir-lancebot | File ...
GitHub Actions run 1515224860 failed.
GitHub Actions run 1515296857 succeeded.
[python-discord/sir-lancebot] New branch created: aoc\-count\-timestamp
Description
Swapped out our custom logic to create a human readable delta with a Discord time stamp.
This allows users to hover over the time stamp to get an exact date, along with automatically rounding to the most significant unit.
I have also added a refactor commit to swap the conditional block around, so the "smaller" code path is the one in the if statement, which makes the function easier to read
Screenshots
Before:

I'm working on this with @katimoth right now - here is what we have this feature looking like right now. Any suggestions?
@evgriff and I would like to tackle for a school project. Are there any recent updates on this issue?
@evgriff and I would like to tackle for a school project. Are there any recent updates on this issue?
I think the only update is that we'll have to wait for Python Discord to support threads for us to be able to add these features (at least the migration to threads)
Thanks for this Tizzy!
GitHub Actions run 1523509204 succeeded.
GitHub Actions run 1523618568 succeeded.
This works well! (After I lost a year of my life debugging emojis).
Approving this since you've already fixed my comments.
Goodbye Sir Threadevere!
This is a general comment, but the reviewed_emoji will almost always return a valid ducky. But if it doesn't find a ducky for whatever reason, it will return ":eyes:" and that will fail when it tries to add it as a reaction.
Doesn't need to be fixed in this PR since it's out of scope, but that was Not Fun debugging.
So! This is fun. The addition of nominee.id will no longer make this fail silently if a user leaves the guild after they were nominated but before they're up for a vote.
self.make_review() returns (string, None, None). review is therefore a non-empty string and that short-circuit logic there won't work anymore. nominee.id now tries to access the id attribute which a NoneType doesn't have.
So, the if not review should explicitly check for the nominee, not the review.
GitHub Actions run 1523654731 succeeded.
[python-discord/bot] branch deleted: kill\-sir\-threadevere
edb18d5 Add thread archive time enum to constants - ChrisLovering
292a500 Refactor make_review to return nominee too - ChrisLovering
c217c3e Manage nomination threads - ChrisLovering
6bd2a56 Update nomination message regex - ChrisLovering
0a4ba0b Supress NotFound when archiving a nomination - ChrisLovering
GitHub Actions run 1523670740 succeeded.
Connected!
GitHub Actions run 1523683708 succeeded.
GitHub Actions run 1523682325 succeeded.
PR Author
Workflow Run
Source Branch
kill-sir-threadevere
GitHub Actions run 1523711997 succeeded.
I would like to work on this with @katimoth for a school project - are there any updates?
Description
To support something I'd like to do this year regarding assigned roles, there needs to be a nice way for people to associate their Discord account IDs with their name/account of Advent of Code. I'd like to shift the bulk of the work of figuring this out away from myself and to the users themselves. I'd like them to create the "links" between their accounts.
Proposed Implementation
Steal the Hacktober stats implementation!
The user should be able to run .aoc link . ...
GitHub Actions run 1527443252 succeeded.
Nice addition and QoL change - thanks Chris this looks good!
Perfect, works much better than the previous behaviour! Another bug squashed..

edb18d5 Add thread archive time enum to constants - ChrisLovering
292a500 Refactor make_review to return nominee too - ChrisLovering
c217c3e Manage nomination threads - ChrisLovering
6bd2a56 Update nomination message regex - ChrisLovering
0a4ba0b Supress NotFound when archiving a nomination - ChrisLovering
GitHub Actions run 1528073618 succeeded.
rewrote hanukkah to use datetime.strptime
left a helper method and some variables in order to allow extending
to use a cache in the future, rather than requesting the api every invoke
that is out of scope of this commit and pull, since the command is
currently broken.
I've only kept the same functionality, without trying to rewrite the
entire command.
[python-discord/bot] branch deleted: subscribe\-with\-buttons
8680df2 Move handle_role_change to a util file - ChrisLovering
0465db9 Remove the subscribe command from the verificat... - ChrisLovering
5df26ba Add self assignable roles to config - ChrisLovering
4f70109 Add an interactive subscribe command - ChrisLovering
4c98287 Ensure the user interacting is still in guild b... - ChrisLovering
GitHub Actions run 1528102850 succeeded.
Connected!
GitHub Actions run 1528112198 succeeded.
e9c2bcc Send webhook embed containing information about... - Shivansh-007
a2958fb Add incidents webhook to default config template - Shivansh-007
c32aee3 Send multiple webhook messages in case of more ... - Shivansh-007
7c4fdba Use MessageConverter to find messages - Shivansh-007
d521273 Use str() when checking for message.content - Shivansh-007
[python-discord/bot] branch deleted: dynamic\-views
GitHub Actions run 1528136153 succeeded.
Connected!
GitHub Actions run 1528147973 succeeded.
[python-discord/bot] New branch created: subscribe\-redirect
Instead of silently failing in channels other than bot commands for non-staff, the bot now instead redirects the command output to bot commands and pings the user.
To facilitate this, I had to change the ctx.reply to a ctx.send since the invocation message may be in a different channel.
This shows the output from the command when ran in bot-commands and then below is the output if the user runs the command from another channel.
 and then uses it to redirect all AoC commands that can be run in the main channel to the AoC commands channel
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...
New results:

Current result, of which this pr is to fix:

GitHub Actions run 1528284573 succeeded.
Works well, manually tested by editing the date it was using for today.
While I know this was ported, does this still make sense to be a constant? or should it be a function param, with this constant as the default?
Also: if not...: return
[sir-lancebot] Branch redirect\-aoc\-commands was force-pushed to `c3f69e3`
yea seems reasonable. Updated the port commit with this change.
[sir-lancebot] Branch redirect\-aoc\-commands was force-pushed to `5773b14`
...missed this, should it be a param as well?
I don't think this one should be no. I see little point in ever changing this delay on a per command basis, since it's set to 30 seconds. The constant is mostly just to remove magic numbers.
looks pretty good to me, honestly
Curious: why is this created as a task, and not awaited right here?
minor nit, mentioning for the future:
this will only work on ctx.channel, if a command uses ctx.message.channel this value will not be changed.
It's a synchronous decorator.
Yea, probably not something to worry about for now, maybe something to think about in bot core.
there should be a pass underneath the docstring
but right above it there's an await? How does that exactly work?
Ahh right, that's not needed and I wasn't aware we had a precedent to require it.
I think I've seen it in most new prs, not sure if there is a precedent.
Connected!
GitHub Actions run 1528370164 succeeded.
Ah yea, it's an async inner. I'm not entirely sure of the reasoning on this one. Possibly to force an ordering of operations.
GitHub Actions run 1528392307 succeeded.
Connected!
GitHub Actions run 1528396274 succeeded.
Functions as it should, code is great, looks good to me!
Everythings looks good, except for one suggestion.
We should change the channel name here as well.
Channels.discord_bots: "discord_bots",
I left that as-is to avoid messing with the stats after opinions from Zig and Akarys [in #dev-contrib](#dev-contrib message)
Should probably have a comment why
Originally, it was to avoid messing with stats too much. Just asked @jb3 on Discord and he says we should be good to rename the stat too as it's not critical or checked much, so I'm committing this.
bd36fdf Rename #discord-bots slowmode stat name - bsoyka
GitHub Actions run 1528836398 succeeded.
Description
Allow the topic command to take a channel as an argument, so the channel can be used to get a topic from the provided channel's pool, rather than the single channel.
Reasoning
This would let some of the lesser accessed topics be useful outside of their own channel. For example, being able to draw from all of the topics in the normally-allowed channels would be beneficial to letting some lesser-used topics circulate.
Proposed Implementation
Add an optional c...
I'm not entirely sure if there's a way to inject stuff into a help docstring, although that would be nice.
If we could use {prefix} in the help text, and format it separately, that would work...
Perhaps an implementation in the bot.add_cog method which would format all of the function's docstrings.
simplified:
for func in cog.commands:
func.__doc__ = func.__doc__.format(prefix=self.prefix)
This would also allow adding other values too... hmmmm. If done in one...
Tried something personally, I kind of like this, but obviously shouldn't use this in a production environment, although all of the docstrings are controlled.
Once again, this is not likely the proper iterator, but meh
# bot.add_cog
# iterates through all of the commands of the cog and formats their docstrings
# this might need to be elsewhere or work differently, not sure
for func in cog.commands:
func.__doc__ = eval('f"""' + func.__doc__ + '"""',func.__globals__)
Description
Sir Lancebot doesn't handle Advent of Code usernames with spaces very well.
Steps to Reproduce
Run .aoc lb followed by any AoC username with at least one space.
Expected Behaviour
The bot would handle the arguments together as a username.
Actual Behaviour
The bot uses the first word and ignores the rest, unless the username is wrapped in quotes.
Known Impacted Platforms
- [x] Web
- [x] Desktop
- [x] Android App
- [x] iOS App
P...
[python-discord/sir-lancebot] New branch created: aoc\-link
1dba7a7 Make self_placement_name keyword-only in .aoc lb - bsoyka
[python-discord/sir-lancebot] New branch created: aoc\-lb\-multiword
Relevant Issues
Approved by @janine9vn: #dev-contrib message
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #962
Description
I made .adventofcode leaderboard's self_placement_name argument keyword-only to accept multi-word usernames without needing quotation marks.
Did you:
- [x] Join the [Python Discord Community](https://discord.gg/python...
GitHub Actions run 1528955053 succeeded.
Description
This adds functionality to the Advent of Code cog for users to "link" their Discord Account with their Advent of Code name on the leaderboard. The cog doesn't explicitly make use of it, but it is necessary to exist and be functional for something I want to do.
This is implemented with a Redis Cache. A user can link their discord account with a name they specify and it's stored as a key-value pair with the Discord ID as the key.
There is no validation that the name they ...
GitHub Actions run 1528968737 succeeded.
GitHub Actions run 1529023885 succeeded.
What about using str.startswith/endswith? Might be more readable?
I don't see how using that makes it more readable, I think it's fine as it is.
Personally, I think the named methods are probably a bit easier to understand, especially with this project geared towards beginners.
this can use the reference, with a fail_if_not_exists IIRC
I don't think it's worth it, there are like 6 commands which provide command invocation examples, and they can easily be reworded.
aea61a0 Shorten parameter name for .aoc lb - bsoyka
GitHub Actions run 1529078836 succeeded.
Yeah, it was still an idea, probably not worth it, but an idea nonetheless
# Additionally keeps the second layer, if a user has a name with quotes on both ends.
all changes addressed on discord,
note: I did not run the code
5059e61 Remove unnecessary edits during pagination - onerandomusername
338fc7a Swap conditional in aoc count - ChrisLovering
790bcdf Use a Discord timestamp to show countdown - ChrisLovering
c81d303 Use Discord timestamps for aoc next day message... - ChrisLovering
60174af Merge pull request #957 from python-discord/aoc... - jchristgit
[python-discord/sir-lancebot] branch deleted: update\-role\-constants
11d00e7 Rename Roles.moderator to Roles.moderation_t... - TizzySaurus [71d800a](https://github.com/python-discord/sir-lancebot/commit/71d800add94df3d678786ab482747ae904290129) Rename Roles.admintoRoles.admins - TizzySaurus [dc5f73b](https://github.com/python-discord/sir-lancebot/commit/dc5f73be8c18ef11c701822e8c600c8fca7b149c) Rename Roles.ownertoRoles.owners - TizzySaurus [e2da188](https://github.com/python-discord/sir-lancebot/commit/e2da188b554aba07b6c5a7a25b8af0baa74973cb) Check role id in MODERATION_ROLES instead of co... - TizzySaurus [aa272db`](https://github.com/python-discord/sir-lancebot/commit/aa272dbe789e86013969bc6f4e506d70ddfc63be) Check role id in STAFF_ROLES instead of compari... - TizzySaurus
GitHub Actions run 1529967658 succeeded.
Connected!
GitHub Actions run 1529972408 succeeded.
I want to keep the two separate, like we run self.bot.ensure_leaderboard(ext) in the ext __init__ like how we need to run ctx.ensure_objects() before storing values in ctx.obj[] in pallets/click.
Secondly, this would unnecessarily be running every time your cog calls increment_points whereas keeping this in the __init__ would only call it during the cog setup.
...
Nope, will revert it ๐๐ป
If we don't display the user's rank on the leaderboard there is no way for them to know where they stand, I could create a separate command to see someone's rank but I think we can just include it in the same command.
The suggestion is to specifically hide it if the user isn't even on the leaderboard.
Sorry missed this comment, these are special cases, they don't work correctly for numbers ending with 11, 12, 13.
In [1]: n = 113
In [2]: ["th", "st", "nd", "rd", "th"][min(n % 10, 4)]
Out[2]: 'rd'
[sir-lancebot] Branch merge\-github\-issues was force-pushed to `cb41148`
GitHub Actions run 1530367004 succeeded.
LGTM, just fix up this and we should be good to go.
cdd4067 use og_blurple in issue embed for consistency - ChrisLovering
GitHub Actions run 1530393318 succeeded.
I see this exists https://discordpy.readthedocs.io/en/master/api.html#discord.Message.to_reference but that's for creating message references. So it could be used by adding reference=ctx.message.to_reference(fail_if_not_exists=False), to the ctx.send call.
However fail_if_not_exists is just for messages that are deleted/NotFound before the send could happen. The API still raises the error `discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In message_ref...
Description
So my idea was to add a BlackJack game where the user can do !blackjack to start the game against Sir-Lancebot (which will be the dealer), the member is going to start with 5000 chips and he will bet a amount of chips for a round, he can save up these chips and buy a few perks for other game ideas I had (which will be in other issue requests). Those perks would be something similar like "chip booster 15%" and similar perks. And maybe (with some help) we could also make player ...
I'm not sure message_override is a good choice in naming here, as without looking at the implementation, I'd expect the string I send here completely overrides the message that gets sent. Whereas actually it just adds to it, maybe something like Message_extended_detail or something to that affect.
I'm guessing this object is supposed to be immutable after being created, since we don't update the return. As such we could add eq=True, frozen=True to the dataclass call here. This will improve performance and make it hashable/allow equivalence checks.
Seems fine, just one optional change that could make it nicer
Yeah sounds reasonable. 80abaef2
GitHub Actions run 1530953153 succeeded.
Tested and works nicely. You already incorporated my early feedback of allowing it to still work if people specify it with quotes.
Thanks!
"self placement name" needs to be updated.
could you add a comment on why this is being done so in future the ones seeing this code know why this exists?
Could do:
if all(aoc_name, aoc_name.startswith('"'), aoc_name.endswith('"')):
This wouldn't work. all() take 1 argument, which needs to be an iterable. This means you need to put the 3 checks into a iterable, such as a tuple. This would mean all 3 get evaluated first, then sent to all, meaning if aoc_name is None, this would error, as it's no longer a lazy check.
e9c2bcc Send webhook embed containing information about... - Shivansh-007
a2958fb Add incidents webhook to default config template - Shivansh-007
c32aee3 Send multiple webhook messages in case of more ... - Shivansh-007
7c4fdba Use MessageConverter to find messages - Shivansh-007
d521273 Use str() when checking for message.content - Shivansh-007
GitHub Actions run 1531426259 succeeded.
Could you add a comment describing the contents of the cache, for example:
# bot/exts/help_channels/_caches.py#L3-L5
# This dictionary maps a help channel to the time it was claimed
# RedisCache[discord.TextChannel.id, UtcPosixTimestamp]
claim_times = RedisCache(namespace="HelpChannels.claim_times")
This could probably be the first part of the if statement with if not aoc_name and then we could return early to avoid one extra indentation ๐
You can probably move the await self.account_links.set() line outside(after it) the if..else statement as it is the same.
If the cache is empty, later code trying to pull items from the cache will fail. Additionally, this will help with future development. Did you test this locally?
I think it's clear that I'm iterating over a key:value situation with the cache. Hopefully the doc string of the function and the name of the final variable provide enough context.
806d71b Serve robots.txt: simplify bind url - Akarys42
Rust code looks decent, let's go
The worker should be set on `*example.com/robots.txt`. Each robot file is defined in the `robots/` directory, the file name being the domain the rule should be served on.
Code looks good! Just some spelling.
This worker is used to serve `robots.txt` files across our infrastructure.
Typo ๐
GitHub Actions run 1531967901 succeeded.
Update, this enum will stay, but I'll be removing a different constant
6b0c2b4 Edit deployment interaction messages, rather th... - ChrisLovering
[python-discord/king-arthur] New branch created: edit\-interaction\-message\-on\-interaction
When you a redploy fails, edit the bots first message with the feedback, rather than sending a new message.
Also removes the buttons from the message too, reducing noise when restarting a few services in a row.
discord.py and discord support this, so future threads will be created with the default of the channel
approved on discord by chrisjl #dev-contrib message
GitHub Actions run 1532117215 succeeded.
GitHub Actions run 1532120643 succeeded.
98010b8 Edit deployment interaction messages, rather th... - ChrisLovering
[python-discord/king-arthur] branch deleted: edit\-interaction\-message\-on\-interaction
GitHub Actions run 1532130689 succeeded.
Looks good, just need the noqa removal.
I believe there is a possible race condition which would extend the amount of bugs.
If a channel is currently being closed while this runs, they would be awaiting an edit coroutine. This would allow the program to switch context and run the waiting task here.
However, the api would still be completing when this task decides to reload the cog, furthering the issue.
Its a race condition that would make the problem worse, imo.
A solution with that could be some asyncio.Locks, in or...
This doesn't seem like it would fix the problem, and may add more problems in the long run.
nit: this should be a NonCallableMagicMock
If an instance of RedisCache can not be called, this shouldn't be callable either.
I propose we add more Discord libraries to the !docs command, now that they are growing in popularity and being used in place of the outdated discord.py
The libs I propose are added are:
- disnake
- hikari
Why not py-cord and nextcord?
Both of these libs provide - without the ability to disable - components in the discord namespace, which would lead to collisions with eachother, and with the OG discord.py
Do we know if their sphynx symbols actually use the discord namespace?
Pycord does, I've checked nextcord and it doesn't, so it should also be fine to add (I'll update my initial comment)
[python-discord/bot] New branch created: clean\_improvements
This PR follows observations of how the new clean features were being used.
Changes:
- All clean commands now use the clean limit (message, time delta, ISO datetime) instead of
traverse. - Consequently,
clean allhas been removed asclean untilnow effectively fulfills that role. - Removes the cache usage argument from the clean commands. The cache will be used if the age of the oldest message requested for cleaning is younger than the oldest message in the cache (meaning, all...
GitHub Actions run 1532454666 succeeded.
I've looked into it when we opened the issue, but the cog is pretty resilient. If the closing process is still on the bot side, that shouldn't affect matters since it'll be canceled and resynced on startup.
If it's waiting on an API call from discord, I think it actually does not cancel until it's done, but I may be mistaken. Either way, the worst case scenario if it doesn't is that we'll move one channel twice, but it'll be to the same place both times, so nothing will break.
GitHub Actions run 1532860760 succeeded.
11d00e7 Rename Roles.moderator to Roles.moderation_t... - TizzySaurus [71d800a](https://github.com/python-discord/sir-lancebot/commit/71d800add94df3d678786ab482747ae904290129) Rename Roles.admintoRoles.admins - TizzySaurus [dc5f73b](https://github.com/python-discord/sir-lancebot/commit/dc5f73be8c18ef11c701822e8c600c8fca7b149c) Rename Roles.ownertoRoles.owners - TizzySaurus [e2da188](https://github.com/python-discord/sir-lancebot/commit/e2da188b554aba07b6c5a7a25b8af0baa74973cb) Check role id in MODERATION_ROLES instead of co... - TizzySaurus [aa272db`](https://github.com/python-discord/sir-lancebot/commit/aa272dbe789e86013969bc6f4e506d70ddfc63be) Check role id in STAFF_ROLES instead of compari... - TizzySaurus
GitHub Actions run 1532887418 succeeded.
1dba7a7 Make self_placement_name keyword-only in .aoc lb - bsoyka
4959f08 Strip quotes from start/end of the username for... - bsoyka
aea61a0 Shorten parameter name for .aoc lb - bsoyka
4a06ec8 Note that only one layer of quotes is stripped ... - bsoyka
914e4ab Note why .aoc lb strips quotes from names - bsoyka
[python-discord/sir-lancebot] branch deleted: aoc\-lb\-multiword
Connected!
GitHub Actions run 1532893978 succeeded.
Some very nice code Zig ๐ I really like the change you made to the cache, should make this much nicer to use :D
[python-discord/bot] New branch created: fix\-message\-convertor
Discord.py's Message convertor is supposed to infer channelID based on ctx.channel if only a messageID is given. A 'refactor' (linked below) a few weeks before d.py's archival broke this, so that if only a messageID is given to the convertor, it will only find that message if it's in the bot's cache.
Co-Authored by: Hassan Abouelela
GitHub Actions run 1533141192 succeeded.
ratelimits are handled above, but not handled with this request, which means in a very rare situation the last request could be used on the initial request, but not this request.
Moving ratelimits to fetch_data would solve this problem, however.
minor: could this have a wait_for_deletion, so a user can delete the embed, just like the other github autolinking
could this also show the issue number, which used to be included a while ago
Yes, we can use a dict and do dict.fromkeys(issues)
Why is this convertor when the class itself is named converter?
that sounds so dumb (but it would work!), I wish something like OrderedSet was in the stdlib.
I know this doesn't count, but I can't help myself. You gotta do what you gotta do when you see beautiful code.
Why is this convertor when the class itself is named converter?
Because those are the ones I manually typed out, rather than copy-pasted, and I always spell it or for some reason, ignoring the difference. Force pushed a fix though.
GitHub Actions run 1533166473 failed.
Why is this convertor when the class itself is named converter?
Because those are the ones I manually typed out, rather than copy-pasted, and I always spell it or for some reason, ignoring the difference. Force pushed a fix though.
Yeah, makes sense. Missed one tho :P
GitHub Actions run 1533170595 succeeded.
I'm a bit confused as to how this patch is working, I can't find the line that fixes a message being found if it isn't in the cache?
its possible to patch with a provided object, rather than patching with a mock.
we can provide the new= param, https://docs.python.org/3/library/unittest.mock.html?highlight=unittest mock#patch
This means that we don't need to use a mock at all, which should save making a useless objects (and all of its internal workings, unittest isn't exactly known for being fast in prod)
this is identical to what we're mocking, so I don't understand the point?
uh, why exactly are we using unittest in production?
Works as expected! I didn't do a super in-depth review of the added utilities since they were ported straight from Python bot.
One thing to consider in the future but isn't necessary for this PR is to reduce which commands Staff Roles can bypass. I don't think Helpers need to necessarily bypass the override to post in the main channel for every command.
Can't mark it since its just out of pr bounds, line 174 of infraction/_utils.py should be 4096 now
additionally, line 161, is a default of token removed good for the icon_url? I feel like it should be None
Looks good.
Testing the current behavior with the soon-to-be-removed site command, and noticing, with buttons, being able to link tags and get a nice view like this but with tags would be awesome.

Given that type-hinting also exists, it may be worth mentioning that pydis has that channel as well? Not sure.
Also feels worth linking pyright and other checkers.
We could remove the check on line 111 as first_limit is now a required argument, so it wouldn't be None (after this check).
There is somewhat a problem here, conceptually.
Internally on dpy, load_extension, unload_extension, and reload_extension are all not awaitables.
However, the new load_extension for the bot is defined as a coro. There may be internal methods that call load_extension, but I don't think there are, so it should be good.
However, because of these three lines,
why is this imported here? is it possible to import it at the top of the file?
I may have missed this code, ignore my previous write-up
might be easier to make the patreon roles a list, which means this could be done easier:
current_patreon_tier = 0
for num, role in enumerate(reversed(patreon_roles):
if role in before.roles:
current_patreon_tier = num
This is really good, honestly, for a first pr, keep it up /gen
This may be worth being a cog constant-- they aren't going to change while the cog is live.
That would be done with a asyncio.create_task from the self.bot.loop in the init method.
The reason its done like this is the cache may not be filled when the init method is called.
utils.channel.get_or_fetch_channel is a coroutine so it needs to be awaited
Any updates? Its next weekend :P
Curious, why isn't this compiled too?
I see no way to unlink an account, I feel like that should be possible.
Huh, I left a overall message which strangely did not get saved.
I was mentioned that it looks pretty good, but I'd like to see an unlink command. In addition, a way to unlink from a moderator view in case someone adds an account they cannot control. I also do not see an admin/mod or event lead command to be able to force an unlink.
this looks good to me, keep up the moderation tooling!
(side: I agree with bluenix's comments)
[python-discord/bot] New review comment on pull request #1889: feat: added url parsing to the filter
note that yarl is open for usage too
Yarl is a direct dependency of aiohttp and is already checked in and used by aiohttp, so if you wanted to use it here, i can't see why not.
Might be worth turning off automerge since it needs to be merged at the same time as the bot pr....
GitHub Actions run 1533602915 failed.
It's simpler than the alternative, but mocking in the main application is not necessarily a bad thing if used properly, See my other comments on this.
GitHub Actions run 1533609074 succeeded.
maybe reword this to specify both questions and projects? Otherwise, I think this should be good.
maybe reword this to specify both questions and projects? Otherwise, I think this should be good.
This edit is currently blocked until a dev actually approves it, see the comment by xith
Looks good! Sorry for the annoying review you're doing of #1889 right now ๐
I don't think using mocks here is really a problem. This function is only called when something explicitly calls the message converter, and I struggled to find anything that does to test this function with. Mind you that the message object in context, and the message passed to on_message do not go through this. The only thing that goes through this are commands which accept a message as their arg.
No? We're mocking a function which calls this in the middle because we want to have slightly different behavior (see the side effect on mock). We duplicated the base function because we need to call it in the side effect, and this was the easiest way.
The above method would result in a performance boost from the current code. I feel like mocks are a bit slower than other objects, given their internals.
You're talking performance boosts that will show benefits if we're calling this a 1000 times a second, but that's simply never going to be the case. We may as well do it, but honestly, it should be fine even if we don't.
As a heads up, poetry.lock got all of the dependencies updated.
To fix this, please be sure you are using poetry 1.1.x
First revert poetry.lock locally.
Ensure that pyproject.toml is the same, with tldextract in it.
Next, use poetry lock --no-update
This will relock poetry without updating all of the dependencies.
However, it may be worth an update seperately to the dependencies, as this updated redis, rapidfuzz, sentry, etc
[python-discord/bot] New review comment on pull request #1889: feat: added url parsing to the filter
line 485 can be before line 483
GitHub Actions run 1533648230 succeeded.
[python-discord/bot] New review comment on pull request #1889: feat: added url parsing to the filter
how is this already outdated?
Looks good! Sorry for the annoying review you're doing of #1889 right now ๐
Hey, it wasn't an annoying review!
Description
Too many people are trying to get the leaderboard rapidly. Since it only updates once every 30 minutes, a channel of #aoc-leaderboard would be nice while the game is afoot. This would automatically update every 30 minutes, as the leaderboard currently does. The current aoc lb command would link to the #aoc-leaderboard channel, maybe showing the user where they currently are, but linking to the channel to view the full lb.
Reasoning
 has been brought up [briefly](#aoc-bot-commands message) on Discord already, and Kat's decision was that we want to reduce calls to the AoC servers as much as possible, so we're only refreshing the leaderboard when it's requested. (cc: @janine9vn)
I'm open to discussing potential solutions to this, but I don't think there's a good way to do this without making unnecessary calls to AoC.
A very similar idea (a pinned message) has been brought up [briefly](#aoc-bot-commands message) on Discord already, and Kat's decision was that we want to reduce calls to the AoC servers as much as possible, so we're only refreshing the leaderboard when it's requested. (cc: @janine9vn)
I'm open to discussing potential solutions to this, but I don't think there's a good way to do this without making unnecessary calls to AoC.
...
Additionally, we would be able to use discord timestamps, to show a helpful message in the lb command of how long until the lb can be refreshed again.
This may be worth a second and different issue, given that this can be implemented regardless of the rest of this pr.
Personally I think the buttons are a great idea, although I think we should still keep the command around for the self-placement feature. (Should be straightforward to keep the same cooldown for API requests, looks like that's in another function already.)
I'll wait for Kat's input here as our events lead.
Additionally, we would be able to use discord timestamps, to show a helpful message in the lb command of how long until the lb can be refreshed again.
This may be worth a second and different issue, given that this can be implemented regardless of the rest of this pr.
_Originally posted by @onerandomusername in https://github.com/python-discord/sir-lancebot/issues/966#issuecomment-985238562_
Given the amount of updating, and times ran the command, it would helpful to see a timest...
Yeah, but i also think we can shrink the full embed down, keep that function, but not the other part of the function.
Actually, when #964 gets merged, the default of the leaderboard command could be the user's user if they've linked it.
Personally I think the buttons are a great idea, although I think we should still keep the command around for the self-placement feature.
We can use buttons and ephemeral replies to display the user's score.
...That's true, with the above pr, a user will link it, and we will be able to have the lb in a command, then send an ephermal with the score of a user.
However, the lb command as @bsoyka mentioned should probably continue to exist.
Oh I thought this was merged already.. kind of surprised it isn't.
Oh I thought this was merged already.. kind of surprised it isn't.
Same here, it looked like it was going to be merged with the conflicts above sorted.
Most certainly not the intended reason for this set usage :-)
GitHub Actions run 1534803591 succeeded.
Connected!
GitHub Actions run 1534810448 was cancelled.
GitHub Actions run 1534816313 succeeded.
[python-discord/bot] New branch created: pep\-main
The PEP github repo changed branch from master, to main, breaking our code.
Switch the ref from master to main in our code.
GitHub Actions run 1534827412 succeeded.
GitHub Actions run 1534830922 succeeded.
Connected!
GitHub Actions run 1534845424 succeeded.
GitHub Actions run 1534858814 succeeded.
Connected!
GitHub Actions run 1534872452 succeeded.
Apparently not, just tested in repl, giving str.join a list is about 10-20% faster that giving it a generator
List comprehensions are faster yes. Without the brackets you are passing an iterable (generator in this case) which Python needs to create, then individually advance and resize the list.
list(x for x in y) is not the same as [x for x in y].
That kind of stuff adds up.
This patches the Message converter, not fetching a message from the API. This is the doc string for Discord.py's message converter https://github.com/Rapptz/discord.py/blob/master/discord/ext/commands/converter.py#L373-L386.
The second step there doesn't actually work. It doesn't fall back to the context channel if just a messageID is given, it actually only checks the cache.
Line 84 of this PR is what is actually patching this behaviour, where if _get_as_snowflake doesn't return a chan...
Since this function is the one we're mocking, and within the mock we calling it first, before inferring, we can't have the mock side effect call the function it's mocking, so we copied the function instead.
@onerandomusername @HassanAbouelela I think I've arrived at a nicer solution for this, which still works from my testing. If you wanted a simple way to test this, the !raw command using a message convertor.
GitHub Actions run 1535187742 succeeded.
GitHub Actions run 1535418562 succeeded.
why do we define the ref at all? it isn't required, and the api defaults to the default branch if no branch is provided.
Sentry Issue: BOT-1R0
Could not find a thread linked to 822853512709931008-908123826188083232
db85e56 Attepmt to fetch un-cached nomination threads o... - ChrisLovering
[python-discord/bot] New branch created: fetch\-thread\-if\-not\-in\-cache
Fixes BOT-1R0
Fixes #1992
The time between a vote passing and the helper being helpered can sometimes be >7 days, meaning the thread may have auto-archived by then.
We should deal with this by trying to fetch the threead from the API if it's not cached.
Ohh, I see what you're saying. We have a list of all the questions which is just a dictionary and then pop the dictionaries out if they were already used?
GitHub Actions run 1535725795 succeeded.
The game itself works pretty well! Two suggestions from me however -
1 ) Change the text to text when the embed with all the words used and formatted into the prompt
2 ) We could use validation for checking whether something is a verb, noun, or adjective? Not sure about plural nouns or places, but we could use nltk.corpus.wordnet for validation. This is something that is more of a consideration as it depends on what you want to do.
GitHub Actions run 1535763277 succeeded.
The default is None in case the user just does .aoc link with no specified name. I can check the cache if they've already linked or now and then return the status. It doesn't need to error out if they don't remember linking or not.
I see, that makes sense. Given the changes with #963, I feel like this command the leaderboard now have different input styles, which does not make the most sense.
We will definitely not have a leaderboard that refreshes automatically every 30 minutes. As it stand now we're already pushing the limits of the refresh rate with 30 minutes considering we're requesting 7 leaderboards everytime. The 30 minute cooldown is an absolute minimum, meaning we would expect there to be longer intervals throughout the day where we don't make the request.
Additionally, having a standalone channel with a message for the leaderboard places even more emphasis on the lea...
GitHub Actions run 1536352334 succeeded.
After much testing, I can now say that this works, and I like the implementation as well.
I'm not sure what you mean by this. All the user has to do is provide their advent of code leaderboard name and it gets linked, if they don't it'll tell them if they've linked it or not. It's the same as the .aoc lb aoc_name with that PR being merged.
[python-discord/bot] New review comment on pull request #1889: feat: added url parsing to the filter
i dont see the need of creating the extra variable unless we know we'll need it.
Yea, I guess it's technically both, since the MessageConverter just uses util functions from the PartialMessageConverter.
I'm going to say that this word message refers to the generic message and covers both, don't think it's something that needs changing :D
Since this is a staticmethod, I'd likely need to do return super(commands.PartialMessageConverter,commands.PartialMessageConverter)._get_id_matches(ctx, argument) for that to work right?
As a heads up, poetry.lock got all of the dependencies updated.
To fix this, please be sure you are using poetry 1.1.x
First revert poetry.lock locally.
Ensure that pyproject.toml is the same, with tldextract in it.
Next, use
poetry lock --no-updateThis will relock poetry without updating all of the dependencies.However, it may be worth an update seperately to the dependencies, as this updated redis, rapidfuzz, sentry, etc
this has been deemed not t...
yea, lets actually use the regex util file for this :D Fixed in a forcepush
please note that this was a code review, not a full test
GitHub Actions run 1536436362 succeeded.
What would be the benefit of doing so here? I want to make sure that the link happens before I send the message back to the user in case something goes wonky. I don't want to tell the user that the link has happened before it's actually happened.
Ah, yes, yes you would. That would make no sense in this case.
this seems like it could be pretty useful
but do we generate seeds for unseeded ducks? i dont know much about the internals of quackstack
What #963 did is it made the user argument keyword only.
This means that a user can run .aoc link name with spaces and not need quotes. Given that this is what the bot now has and our users expect it to work (at least in the scope of the aoc commands), this command should not require quotes for a username argument.
This is not the same, as I've tested locally.

Current be...
Ah, okay. So your feedback is to make this keyword argument only to accept spaces in the name without quotes. I can do that. That wasn't clear from your original statement.
As discussed on Discord, feel free to raise an issue and I can assign you to it, I want to keep this PR to just what it says in the PR title, rather than adding enhancements to the cog too, just to get it done and merged :D
As discussed on Discord, feel free to raise an issue and I can assign you to it, I want to keep this PR to just what it says in the PR title, rather than adding enhancements to the cog too, just to get it done and merged :D
As discussed on Discord, feel free to raise an issue and I can assign you to it, I want to keep this PR to just what it says in the PR title, rather than adding enhancements to the cog too, just to get it done and merged :D
e584697 Move logging and remove unused varibales in Git... - ChrisLovering
GitHub Actions run 1536612896 succeeded.
other requested changes can be made in other prs, sold with the current functionality.
Description
(Full list of changes is located on #778's review comments)
- constants
Some constants are unused, or not used well. - move ratelimits
Ratelimits are only handled after a single call to fetch data, would make most sense to handle them in the fetch_data method - remove git alias
while we're here, this should go as github is not git, and this allows future use ofgitas a command or tag. - add wait for deletion
if a user wants to delete the embed, they will now be a...
Update: as mentioned by @janine9vn, there is already a timestamp of the last update.
However, I did not notice that until it was pointed out by her.
As the current embed is like this, below a wall of codeblock, its not very noticiable.

To update this issue, my suggestion is changing the every 30 minutes to something a bit different, where the time is a discord relative ti...
GitHub Actions run 1536859034 succeeded.
Ready to start a PR, could I be assigned?
@evgriff and I would like to tackle this. Can someone assign us?
Description
Remove the subscribe commands from lance, because as of https://github.com/python-discord/bot/pull/1868, this is now supported on Bot. (Beautifully executed, too)
Reasoning
No sense in having two commands that do the same thing, more maintenance work!
Proposed Implementation
TODO:
- [ ] remove lovefest role command
- [ ] remove advent of code command (deferred until January, when the command can no longer be assigned or removed)
Additional Detai...
To ease transition, I think it would be worth having the various commands send the user a message telling them to run !subscribe instead to get roles.
Probably worth updating Docstrings to reflect that too.
That makes sense, I've updated the contents of the issue for that
Maybe have the messages delete_after ~20-30s too
now that !subscribe exists on Python, the lovefest command is irrelevant
Relevant Issues
Partially closes #970 -- lovefest migration
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Added a custom error that would be handled by the error handler, in order to deal with this migrations in the future. This has the benefit of only needing to raise an exception with the new command, and the error will be logged and an embed sh...
GitHub Actions run 1537240193 succeeded.
NOTE: Do not merge until January
Depends on #971, where the initial implementation is.
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Partially closes #970
Description
Yanked the aoc subscribe commands. See #971 for how this works.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or l...
GitHub Actions run 1537334861 succeeded.
Maybe have the messages delete_after ~20-30s too
I intentionally did not implement this, reasoning of not having stats on lance, so by leaving the responses, we can see if the commands are being used a lot, and not using the new commands.
Could you add , *, _) to the function signature here, so that if a user runs .lovefest sub this command still gets invoked and they are told about the move, rather than getting a bag arg error.
Could you please move this help string to the command's docstring. Our help command uses those to populate the help text.
The reason its here is because its dynamically using the configured prefix of the other bot. Additionally, this is used for the help command even in this location.
Setting help in the command decorator overrides the callback docstring, as shown below


Ahh alright cool, needing dynamic help here is a good reason. Could you hosted the docstring to reflect the new behaviour? It still references what it used to do.
From a concurrency (as in cancellation and failure) perspective it is better to directly use async with as error-propogation in tasks can be a bit iffy from what I know.
That said, this is not important enough to change and I think it's best to keep like this.
I don't understand max_continues. I passed the value 1 in the command with the url https://pydis.com/coc but it still resolved the 2 redirects?
Not gonna lie (n % 100) in {11, 12, 13} is more clear here but I see now.
max_continues is used when we hit the maximum redirection depth, which is hardcoded to 3 in L151:
https://github.com/python-discord/bot/blob/80abaef2cb991a86e97a40650efdc7b9541341d2/bot/utils/services.py#L151
That is to say, if you have a site that resolves after 5 redirects, the program will work as follows:
0 continues: Will not resolve since we only do a max of 3 redirects1 continue: Will fail once, the continue. The max redirects for this is 6, and since we only have 5, i...
Yes - make a copy of the list from the deserialized JSON (otherwise you would modify the original list) and remove questions as they are picked (for example: my_list.pop(random.randrange(len(my_list))).
Maybe call it attempts? Since what's actually happening is that we're attempting to resolve the URL that many times. To me (and I would really assume to many others) max_continues maps to redirects. attempt shares the same downsides though I suppose..
Why can't max_continues be passed in there directly (if we give it sensible limits)?
This is a little better documented on the actual command:
Setting
max_continueswill continue unfurling, even if we hit limits on the worker.
I don't mind renaming it if we find a better name. The reason I didn't bother making the other number configurable is that the range of valid values for it is a lot more difficult to control, and is dictated entirely by the range in the worker. I didn't want to maintain the range in two places. Continues is completely independent of the worker t...
I guess it isn't too bad. Could just manually define the continues based on the redirects % max, and just have the max defined in config. That way the command can just have the raw number like you were trying initially.
Exposing our own IP: Not much of a concern at the moment, since my plan is just to run unfurling against a very small set (either a list in constants, or a filter list). Exposing our IP to a service like bit.ly is not a problem.
Is this still a problem since we're using a cloudflare worker (as implemented in https://github.com/python-discord/workers/pull/20) which runs on cloudflare's network, and would expose their ip?
It's a volatile IP, which doesn't expose anything for us.
Looks good to me, does what it says on the tin.
I'm not too familiar with this system, so I won't leave an approval ๐
I' wondering, would it make some sense to show the intermediate unfurls?
Sure, there could be three redirects, but the middle one goes to supersketchysite, so the shortlink shouldn't be used at all.
@onerandomusername Perhaps, though that would require changes to the worker itself. It's also not the goal of this PR at the moment, since the shadysites is only a concern for moderators as far as this command is concerned, but we don't care for moderation purposes.
This is a little better documented on the actual command:
Setting
max_continueswill continue unfurling, even if we hit limits on the worker.
Yeah that isn't clear to someone who doesn't understand the workers. This would be better:
Setting
max_continuesmeans that unfurling will retry if the limit of redirects on an individual worker is hit.
I think what makes sense is just having the continues yes..
No real benefits, would just not duplicate code, looking at the log statements, I think we could even set the new aoc_name before the if...else block, since the logging statements are in past, saying the change has already happened.
I agree with some of what Jason is saying.
since Since the logging statement is before it happens, it should be in present or future tense.
If I was in a late debugging session trying to figure out what happened, I would think that the account successfully got linked, until I dug a bit further.
Changing the tense would save some time, and make more sense, as being past tense implies it has happened, when it hasn't.
11d00e7 Rename Roles.moderator to Roles.moderation_t... - TizzySaurus [71d800a](https://github.com/python-discord/sir-lancebot/commit/71d800add94df3d678786ab482747ae904290129) Rename Roles.admintoRoles.admins - TizzySaurus [dc5f73b](https://github.com/python-discord/sir-lancebot/commit/dc5f73be8c18ef11c701822e8c600c8fca7b149c) Rename Roles.ownertoRoles.owners - TizzySaurus [e2da188](https://github.com/python-discord/sir-lancebot/commit/e2da188b554aba07b6c5a7a25b8af0baa74973cb) Check role id in MODERATION_ROLES instead of co... - TizzySaurus [aa272db`](https://github.com/python-discord/sir-lancebot/commit/aa272dbe789e86013969bc6f4e506d70ddfc63be) Check role id in STAFF_ROLES instead of compari... - TizzySaurus
GitHub Actions run 1537932304 succeeded.
GitHub Actions run 1538449709 succeeded.
Looks good, and tested locally ๐
Two minor changes that would be welcomed, but shouldn't block this from being merged.
Something I noticed while testing is that if you try to run the leaderboard command and give it a name (or now as of this PR you have linked your GitHub), if you haven't join the leaderboard the message given isn't the best.

I think this would be better if ...
cached_aoc_names = [value for _, value in cache_items]
This is quite a small change, but imo will help readability where this var is used further on in the function, as it will indicate it's more than more name.
log.info(f"Changing link for {ctx.author} ({ctx.author.id}) from {old_aoc_name} to {aoc_name}.")
Looks really good to me. I tested it out locally, and it works perfectly fine.
Thank you!
GitHub Actions run 1539219817 succeeded.
Connected!
GitHub Actions run 1539231916 succeeded.
No comment on this and it's not mentioned, yet it is resolved.
Looking at the code again, it wouldn't really create much of a difference so could be skipped.
GitHub Actions run 1539245218 succeeded.
Description
Changes in the AoC DayAndStarView:
- From now on, when the interacting user and the original author of the view is different, the bot will send an ephemeral message, regarding the issue, instead of the default error message.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and agree to the [contr...
GitHub Actions run 1541046625 succeeded.
It is not so high priority, so I think this should be solved with exception raising and handling in global error handler. This would remove possible future duplication.
It is not so high priority, so I think this should be solved with exception raising and handling in global error handler. This would remove possible future duplication.
I'm not sure how that would work in the interaction environment.
If an error is raised in the interaction_check, it'll call the View.on_error(See): The default implementation prints the traceback to stderr.
...
[python-discord/bot] branch deleted: fetch\-thread\-if\-not\-in\-cache
1f1ca41 Sort subscribe roles alphabetically - ChrisLovering
8265f20 Redirect subscribe command output to bot commands - ChrisLovering
e311048 set three_day to 4320, the number of minutes in... - onerandomusername
fbd3513 remove default thread archive time as discord.p... - onerandomusername
af6c8b0 Merge pull request #1986 from onerandomusername... - jchristgit
Connected!
GitHub Actions run 1541089805 succeeded.
GitHub Actions run 1541089756 succeeded.
Connected!
GitHub Actions run 1541095096 succeeded.
[python-discord/sir-lancebot] New branch created: fix\-message\-converter
Description
Ported from https://github.com/python-discord/bot/pull/1990/
Discord.py's message converter is supposed to infer channelID based on ctx.channel if only a messageID is given. A refactor (linked below) a few weeks before d.py's archival broke this, so that if only a messageID is given to the converter, it will only find that message if it's in the bot's cache.
Did you:
- [ ] Join the Python Discord Community?
- [ ] Read all the...
GitHub Actions run 1541337836 succeeded.
Just noticed a bug this PR is going to introduce, will fix soon.
GitHub Actions run 1542274162 succeeded.
Remove excess whitespace from pep titles
Approved on discord by lemon: #dev-contrib message
OLD:

NEW:

GitHub Actions run 1542503100 was cancelled.
GitHub Actions run 1542505043 succeeded.
GitHub Actions run 1542521591 succeeded.
Connected!
It seems like most issues just originated from one specific story, I do have some comments on the other ones!
"Ahoy there, ____, "
Shouldn't it be:
"Ahoy there, ___",
" where he reportedly ", "in the fry machine. Later, a woman from ", " was charged with a similar crime. But rather than ", "with a ", ", she ", "with a ", " dog. Either way, we imagine that after witnessing him ", " with a ", " there are probably a whole lot of ",
"value": ["A ", " in ", " was arrested this morning after he was caught ", " in front of ", ". ", " had a history of ", ", but no one-not even his ", "ever imagined he'd ", " with a ", " stuck in his ", ". After drinking a ", ", cops followed him to a ",
" to keep them away. If a vampire ", " a person and ", "s their blood, they become a vampire, too. The only way to ", " a vampire is with a ", " through the ", ", but ",
It's better to say in the blank like "ending with 's'"
following a discussion in a mod channel, we decided we don't want to alert on member join/edit, as those members may never have even spoken in our community, so it's not a burden we want to put on the mod team.
GitHub Actions run 1547011316 was cancelled.
GitHub Actions run 1547015911 succeeded.
[python-discord/bot] branch deleted: Update\-Username\-Checks
aa08fe2 Normalise names before checking for matches - ChrisLovering
baf8239 Check if we recently alerted about a bad name b... - ChrisLovering
8efbff6 Return early when getting name matches - ChrisLovering
5901ac0 Also run name filters against a cleaned version... - ChrisLovering
d0dc7a0 Build an intermediate list for speed in filteri... - ChrisLovering
Connected!
GitHub Actions run 1547061466 succeeded.
Tested latest changes ๐
Connected!
Connected!
5baae04 Add the --use_cgroupv2 flag when relevant - Akarys42
[python-discord/snekbox] New branch created: cgroupsv2
According to https://github.com/google/nsjail/pull/119, the flag should be passed for NsJail to try to use cgroupv2. This commit will use the /sys/fs/cgroup structure to guess the installed version, and depending on the version add that flag.
I couldn't confirm this actually solves the issue with v2 but at least it doesn't break with v1.
Confirmed working on cgroups 1
[python-discord/snekbox] branch deleted: cgroupsv2




