#dev-log
1 messages ยท Page 2 of 1
360ef04 Removed a redundant regex character class - ionite34
We'd probably only implement taking stdin in snekbox if we wanted to have it for the bot, and I'm not convinced it's worth the effort given it's usually pretty simple to just replace the input with a fixed string.
I think that's a separate issue that could be opened on this repo though. Even if we did support input users would get an EOFError if they forgot to supply it, so improving that response would make sense anyway.
Closes #123
- Added new optional groups to start of pattern
r"(https?://)?(www\.)?"
- Added additional unit tests to confirm both re.match and re.search works as intended
- Unified usage of
flagskeyword argument - Removed an existing redundant character class
Looks good, could you bump the version up by a minor version, and document the change in the change log.
There's some info about the change log in the docs readme
a6411af Use a httpx.Client for netlify static builds - ChrisLovering
[python-discord/site] New branch created: extend\-download\-timeout
This allows for setting the config in one place and reusing it.
This also solves an issue where the requests to fetch the download URL would timeout after the (default) 5 seconds.
GitHub Actions run 2871640145 succeeded.
Sorry, I lied. We can actually make this link to the area of code changed, by doing the below.
- :support:`124` Updated :obj:`botcore.utils.regex.DISCORD_INVITE` regex to optionally match leading "http[s]" and "www".
[python-discord/bot-core] branch deleted: invite\-regex
[python-discord/bot-core] New tag created: v8\.1\.0
f"\n\nThe <@&{Roles.moderators}> have been alerted for review."
I have a working solution to get a random 5-letter word from an API (in agreement with their terms of service) however I can't seem to find you using the discord ID provided.
Would it be best to have this implemented on a keyword basis? Meaning that we have a list of particular keywords that map to a particular rule?
Or would it be better to use NLP here in order to try to identify the rule that a particular user is trying to mention, and then maybe give suggestions ?
Would it be best to have this implemented on a keyword basis? Meaning that we have a list of particular keywords that map to a particular rule?
Or would it be better to use NLP here in order to try to identify the rule that a particular user is trying to mention, and then maybe give suggestions ?
I think having keywords would be best, it should be simpler, as well as being more predictable and giving us more control.
With that we would need some way of discovering the keywords that work...
IMO regardless of what we do, we should keep the ability to reference based on numbers, on top of whatever we do here.
The rule command has existed for quite a while that a lot of staff and regulars are very used to be able to invoke based on an index.
In terms of implementation, this is trivial, as we would just need to leave the greedy int convertor, and add an optional string param.
@ChrisLovering I don't think the point was to change the fundamentals of how the command works. Listing a rule by its number would remain the same.
What we're trying to do is to make it slightly easier for people who are unacquainted with the rule numbers to find them easily.
@wookie184 I definitely agree with you on that. Because we don't want it to get too clunky and get lost in finding keywords as well.
I'll try to spin up a draft PR for this and discuss implementation details there...
One aspect that is lost here is that the current rules command is dynamic. The rules are fetched from the API. The suggested approach is probably ok, but will require hardcoding keywords, which will need to be changed/rearranged if the rules ever change. How much of an issue would be to take a keyword and check whether it appears only in a particular rule?
How much of an issue would it be to take a keyword and check whether it appears only in a particular rule? In terms of getting undesirable results
Not so much undesirable results, but it would stop us having stuff like !rule tos if the rule just contains "terms of service", or !rule advert if the rule contains advertisment.
The rules are fetched from the API
It shouldn't be too difficult to add the keywords on the site side and make them be fetched along with the rules.
One possibility would be trying to work out the syntax highlighting based on whatever is being used on the actual doc page. Taking a quick look I can't see a way that woud actually be done, that information seems to be lost by the time the doc page is actually rendered.
Another idea would be to try parsing the contents of the codeblock, and see if it parses as valid python, like how we do already to detect people sending code without codeblocks https://github.com/python-discord/bot/blob/ma...
One thing we could do is reduce the time (maybe to 2 minutes), and send a warning message that the channel will close in that time unless a message is sent.
That could also encourage people helping to leave the channel empty (rather than saying "Hello?" or something), so it closes sooner.
I'm not sure it's a big enough issue to be worth doing this though.
I can take on this issue if needed
Sorry for not getting back to you, that would be appreciated, yes!
Sentry Issue: BOT-36E
AttributeError: 'NoneType' object has no attribute 'id'
File "discord/client.py", line 456, in _run_event
await coro(*args, **kwargs)
File "bot/exts/moderation/modlog.py", line 673, in on_raw_message_delete
await self.log_uncached_deleted_message(event)
File "bot/exts/moderation/modlog.py", line 634, in log_uncached_deleted_message
if self.is_channel_ig...
discord.py now always includes the guild attribute on DMChannels (and I believe all other channels), it is just set to None instead of not existing. https://discordpy.readthedocs.io/en/latest/api.html?highlight=channel#discord.DMChannel.guild
This check needs to change to account for this.
Sentry Issue: BOT-366
HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embeds.0.title: Must be 256 or fewer in length.
(1 additional frame(s) were not displayed)
...
File "discord/ext/commands/help.py", line 960, in command_callback
return await self.send_error_message(string)
File "bot/exts/info/help.py", line 273, in send_error_message
await self.context....
If the query for a help command is excessively long it will not fit in the title. We should just trim the query if it is too long

I think having control over the config directly is quite useful.
So maybe instead we could have an additional optional param for difficulty. This param would set the "default" config for the game, but users could still give the existing params to overwrite that if needed.
IE you could do !hangman easy 4 which would set the min_length to 4 and the other variables to whatever would be considered "easy".
What do you think of that?
Sentry Issue: BOT-379
Forbidden: 403 Forbidden (error code: 30010): Maximum number of reactions reached (20)
File "discord/client.py", line 456, in _run_event
await coro(*args, **kwargs)
File "bot/exts/fun/duck_pond.py", line 189, in on_raw_reaction_add
await self.locked_relay(message)
File "bot/exts/fun/duck_pond.py", line 120, in locked_relay
await message.add_reaction("โ
"...
Maybe...we can have both? The 3 modes added on to the current implementation of being able to have full control over the generated word?
If we were to do def hangman(self, ctx, *args), we could check the len() passed in, and the type to figure out what the user inputted
Attempting to duck a message that already has the maximum number of reactions causes an error. The reaction is used to prevent the message from being sent to the duck pond multiple times, so this breaks that logic too.
The ideal solution here would probably be to store ducked messages in the site database.
Maybe...we can have both?
That's sort of what I was suggesting, with an additional optional param for difficulty.
However, rather than only allowing one or the other, I proposed that we would allow both if the user wanted, having the specific config overwrite the faults for the difficulty.
Would the amount of times that one of the 4 current optional arguments be a factor that affects the decision? As in, if most of the time, users just use the command without arguments
4096 characters is quite a lot, do you think we should limit it to something smaller, maybe 2000 or even just 1000 characters, so it's less bulky?
I'm not a latex expert but this sounds fine to me if nobody is against this.
For the implementation of the button, I would ideally add the multiple arguments to the init of the view class and call the button with the arguments how it's being called currently, right?
Yes, I think that sounds right. There are some examples of discord.py views with buttons here if that helps: https://github.com/python-discord/sir-robin/blob/e90d24072baf2dc57acd455e8a9d7e5d40457d46/bot/exts/code_jams/_views.py
Hi @kosayoda, are you still able to work on this?
limit of 1 new thread per day across all the topical channels per person
I'm not sure about this, especially if the only way to enforce it would be auto-deleting further threads, which would be quite annoying (not sure we could easily prevent opening threads with permissions?).
If someone was helping they could reasonably want to reply in threads to someones message in a fast-moving channel, so I think there's a pretty good use case for opening lots of threads in a day, especially in ...
Hi @kosayoda, are you still able to work on this?
Feel free to work on it!
@wookie184
I was thinking of how this would be implemented:
- Do we keep this as 1 command only or do we have a group of commands? The "main" one would be using the rule number like usual & the other with a keyword.
- If we decide to have one command, I suppose that we need to prioritize numbers on keywords, this leads to having a signature like this:
async def rules(self, ctx: Context, rules: Greedy[int], keyword: Optional[str]) -> None
--> If no number is provided, we will try to...
I wasn't sure myself so asked in the dpy server.
Turns out the difference is that msg.reference exists for both replies and the system message you get from pinning a message.
MessageType.reply will only be for replies, and not the system message from pins.
TL;DR; This can be if msg.type != MessageType.reply since we don't care about the pin system message.
It would be clearer to just have a loop that does all the checks necessary before incrementing the total. The logic to get the replied to message is also quite involved, so could be moved to a separate function, possibly in
bot.utils.messages. You'd then have something more like this:
...
Yeah, I completely agree. The current logic was done by @onerandomusername and I didn't think to adjust it. I'll do this :+1:
I went for 4096 simply because that's the Discord maximum. If we'd prefer to lower it then I'm happy to.
872281e Added mod alerted notice to auto-infractions - ionite34
e68868e Added newlines and non-mentioned mod role - ionite34
c9d5aac Added article to automute message - ionite34
a4a7c64 Merge branch 'main' into automute-message - minalike
a441f9d Merge pull request #2251 from python-discord/au... - minalike
[python-discord/bot] branch deleted: automute\-message
Connected!
GitHub Actions run 2878434108 succeeded.
Closes issue #1565.
Due to the nature of the bot internals, it would be messy to only change the unban command to take a reason argument. Therefore, all pardon commands that call the method pardon_infraction() provided by the InfractionScheduler cog will have a reason argument and append the pardon reason to the infraction through InfractionScheduler.deactivate_infraction()'s HTTP patch call to the moderation API when the infraction is marked as non-active.
If anyone would like to...
[python-discord/bot] New comment on pull request #2259: feat: add reason argument to pardon commands
Oops, it seems that I've forgotten about tests - working on that now!
GitHub Actions run 2878740199 succeeded.
LGTM. Seems like there are some errors in the tests that need fixing though
Turns out I forgot to push the commit where I fixed the tests ๐
Yeah I can't seem to find them either on PyDis. Have you tried sending them a friend request, @Feroz2006?
872281e Added mod alerted notice to auto-infractions - ionite34
e68868e Added newlines and non-mentioned mod role - ionite34
c9d5aac Added article to automute message - ionite34
a4a7c64 Merge branch 'main' into automute-message - minalike
a441f9d Merge pull request #2251 from python-discord/au... - minalike
GitHub Actions run 2879420716 succeeded.
I would like to be assigned to this
The request fails with the given ID, must've changed their ID and forgot to update the issue.
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?

Is using a button to be redirected to the bookmarked message in the user's DM's a good idea?
b067c66 Get or fetch member when trying to reply - ChrisLovering
a451cb0 Ensure all guilds are checked for membership wh... - ChrisLovering
Do we keep this as 1 command only or do we have a group of commands?
It should remain as one command, here are examples of how I think it should work:
!rule -> Shows the general rule message as it did before.
!rule 1 -> Shows rule 1 as it did before
!rule 1 2 -> Shows rule 1 and 2 as it did before.
!rule coc -> Shows the rule with keyword "coc".
!rule 1 Look at this rule -> Only shows rule 1, i.e. ignore the text if a number was already given.
!rule a b c -> There are a...
remaining = time.humanize_delta(expiry, arrow.utcnow(), max_units=2) if duration != remaining: duration += f" ({remaining} remaining)"
This is causing an issue to still happen sometimes for me. Since it's comparing to arrow.utcnow() if the current time has changed to the next second between infraction creation and this line there will be a difference.
I believe the intention of this was to make it clear that the duration is not from when...
872281e Added mod alerted notice to auto-infractions - ionite34
e0b5933 Correctly initialise redis tests - ChrisLovering
b983e4b Merge pull request #2252 from python-discord/Re... - ChrisLovering
e68868e Added newlines and non-mentioned mod role - ionite34
c9d5aac Added article to automute message - ionite34
fce6ea2 feat: command for banning compromised accounts - dawnofmidnight
a7234a8 fix: change use of arrow to datetime and change... - dawnofmidnight
4eaecb3 fix: replace datetime.utcnow() with arrow - dawnofmidnight
2ea1d96 Merge branch 'main' into dawnofmidnight/compban - wookie184
65216f8 Merge pull request #2250 from python-discord/da... - wookie184
[python-discord/bot] branch deleted: dawnofmidnight/compban
GitHub Actions run 2882841419 succeeded.
Connected!
GitHub Actions run 2882868128 succeeded.
I guess since it was already like that and there wasn't an issue, it's probably fine. We can always change it later if we need to
6193ee2 Globally decode binary responses from redis to ... - ChrisLovering
e1967b5 Merge pull request #2249 from python-discord/re... - mbaruh
fce6ea2 feat: command for banning compromised accounts - dawnofmidnight
872281e Added mod alerted notice to auto-infractions - ionite34
a7234a8 fix: change use of arrow to datetime and change... - dawnofmidnight
[python-discord/bot] branch deleted: incident\-archive\-msg\-improvements
GitHub Actions run 2882969829 succeeded.
Awesome, that should be enough to get me started.
Thanks a lot, we'll continue the discussion in the PRs.
Connected!
GitHub Actions run 2882999104 succeeded.
15f93e7 Bump Discord.py to the stable 2.0 release. - ChrisLovering
[python-discord/bot-core] New branch created: dpy\-2\.0
This also bumps some other deps, rather than individually merging the dependabot releases.
Looks much better now, thanks ๐
15f93e7 Bump Discord.py to the stable 2.0 release. - ChrisLovering
127d0ef Merge pull request #125 from python-discord/dpy... - ChrisLovering
[python-discord/bot-core] branch deleted: dpy\-2\.0
Relevant Issues
Closes #1086
Description
Updated the latex template to use more packages.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and agree to the contributing guidelines?
GitHub Actions run 2883444841 succeeded.
In 06f9f48, Made DM remaining time optional with a resend kwarg.

It seems infraction["reason"] will be None rather than an empty string if no reason was provided initially, so will need to check for that.
GitHub Actions run 2883525426 succeeded.
Hello, may I be assigned to this issue?
Hello, may I be assigned to this issue?
๐
9d3ae7f Fix issue with .uwu failing to uwuify embeds in... - AbooMinister25
51aa4bb Ran lints :p - AbooMinister25
eb6d711 Fixed conflicts from PR 1078 - AbooMinister25
765388d Pulled changes from main and fixed conflicts - AbooMinister25
7a41518 Add a check for whether an embed is already ava... - AbooMinister25
Connected!
GitHub Actions run 2883733830 succeeded.
As of discord.py v2, all channel types have the guild attribute which means it will occasionaly be None and might create an AttributeError.
Fixes #2256.
Had a quick look over, looks good and seems to work nicely, thanks ๐
4e9aa1e Help command fix, normalize suggestions for unk... - RohanJnr
[python-discord/sir-lancebot] branch deleted: help\_command\_fix\_863
Connected!
GitHub Actions run 2883807607 succeeded.
Thanks for the PR, I have a few comments.
I assume resp.json() is still a list of dictionaries so this should be:
async def get_movies_data(self, client: ClientSession, genre_id: str, page: int) -> tuple[list[dict[str, Any]], int]:
I think it would be good to mention that this is different to what is documented
# Maximum value for `pages` API parameter. The maximum is documented as 1000 but
# anything over 500 returns an error.
MAX_PAGES = 500
f"There was a problem making the TMDB API request. Response Code: {status}, "
and same below, it could be nice if the repetition could be removed somehow, but you don't have to since it was already like that.
We don't need the hasattr check here, right?
if overridden_command:
# Determine which command's overrides we will use. Group commands will
# inherit from their parents if they don't define their own overrides
[python-discord/modmail] branch deleted: add\-git\-to\-docker\-image
[python-discord/modmail] branch deleted: dep\-update
[python-discord/modmail] New branch created: development
Connected!
GitHub Actions run 2884014774 succeeded.
Missed this line being removed in my patch, currently the top line is duplicated

[python-discord/modmail] New branch created: deployment
[python-discord/site] branch deleted: fix\-infraction\-tests
Also with that we can enable the help command in DMs

GitHub Actions run 2884214165 succeeded.
[python-discord/site] New branch created: fix\-warnings
While working on upgrading some of our dependencies, I started running into issues due to us continuing to use deprecated features. This includes:
- django-filter. The history behind django-filter, and our usage off it is a little complicated. I tried to summarize in 6fe491c, but I can elaborate/explain further if needed. The warnings go from deprecations to removal in the current latest version, which is where I ran into issues.
- Django 5.x: django actually emits a helpful deprecation war...
GitHub Actions run 2885513493 failed.
GitHub Actions run 2885678956 succeeded.
Hmm, now if pardoned_reason is none it'll try to update reason to be an empty string.
Due to the staleness of this PR, I'll be closing it. If anyone wants to pick it back up, feel free to do so.
I'll be closing this PR due to staleness.
@hedyhli if you'd like to work on this, please ping me and I'll assign you, and the PR can be re-opened.
[python-discord/site] New branch created: bump\-dependencies
I'll be closing this PR due to staleness.
If anyone would like to pick up this PR, feel free to ping me so I can assign, along with the PR getting re-opened.
dada405 fix: don't include replied mentions in mention ... - onerandomusername
GitHub Actions run 2885927415 succeeded.
Blocked by #768, which this branch is based on.
This PR updates the python version to 3.10, as we've done elsewhere in our repositories, and bumps and locks all dependencies to latest versions, using exact specifiers. Using exact specifiers is part of a larger push by the dev-core team for better dependency management, along with the addition of dependabot.
To keep things as simple as possible to review, the commits are organized as follows:
- 8210299 updates all normal dependencies, w...
Just opened this PR to keep track of CI as I make the upgrade, it's not ready yet.
GitHub Actions run 2885939048 failed.
Connected!
GitHub Actions run 2885947955 succeeded.
I'll be closing this PR due to staleness. If this PR is going to be completed, please ping me, along with re-opening.
@GDWR Would you like to take over this PR?
According to docs for get_channel it appears all current return union types have the guild attribute, so this LGTM.
Django distill seems to be failing on update from 2.9 -> 2.10. I've narrowed it down to this commit https://github.com/meeb/django-distill/commit/5abe55b78d2024df4f3150b0e16459759cb329b1. I'll investigate later.
Fixed - removed the "reason" field from data so it'll just have {"active": False} if pardon_reason is None
I think we should move this send into the except block, so it's easier to understand what is happening here.
Is this actually possible with the whitelist above? If the purpose is for type-casting, we can be more explicit about that.
This lookup fails for any non-cached message for me. Looking at the source code for the converter, after a cache-miss, it'll try to get the channel, then fetch the message from it, but it always fails to get the channel, even when it has already done other operations in that channel (such as sending a bookmark or a failure).
The reason I commented on this portion specifically is that I think it's best to just not mention this, and not worry about it.
We would like to update the existing bookmark command to also be available from the context menu.
Maybe not necessarily update, but have the regular text-based bookmark command and the context menu one working side-by-side. I think this one will have to wait until #1087 is merged just to avoid merge conflicts or otherwise multiple PRs for the same feature with potentially conflicting code
GitHub Actions run 2887140646 succeeded.
Connected!
GitHub Actions run 2887154281 succeeded.
This is fixed in a more recent version of d.py https://github.com/Rapptz/discord.py/pull/7688
Until we bump up to that, this monkey patch is supposed to resolve the issue you are seeing.
https://github.com/python-discord/sir-lancebot/blob/main/bot/monkey_patches.py#L72
Description
Sir Lancebot handles certain prefix "commands" incorrectly, invoking multiple commands at the same time and tossing "Did you mean:" embed box after ward
Steps to Reproduce
- Invoke Lancebot with
.ha- This issue also appears with prefix command lookalikes (
".....hah?") - This issue does not appear for
"..."
- This issue also appears with prefix command lookalikes (
Actual Behaviour

Expected Beh...
After looking briefly into #1064, it looks like the issue is these lines.
try:
if not await similar_command.can_run(ctx):
log.debug(log_msg)
continue
except commands.errors.CommandError as cmd_error:
log.debug(log_msg)
...
Testing it myself, it seems like this message converter just does not have a good time with messages in DM channels for whatever reason.
Possibly we just make it only work with a reply, since that seems to work consistently
e5bbd71 Update bookmark error handling - ChrisLovering
[sir-lancebot] Branch bookmark\-enhancements was force-pushed to `fabfa90`
Force push is to rebase onto main
I think thatโs fine, youโre going to be at the message when running the command anyway
I think this is something worth investigating as a bug in the whitelist code, or maybe d.py, but I wonโt hold up this PR on it. If you have reproduction steps that would be great.
Agreed, I might hold off until after I bump lance up to stable d.py 2.0. Just in the hopes that it disappears.
36eb3d1 Require dm delete command be invoceed by replyi... - ChrisLovering
GitHub Actions run 2889543551 succeeded.
In reference to issue #2108 this commit aims to add an initial set of keywords per rule.
These keywords will be later in the "rule" bot command in order to make rule identification easier
GitHub Actions run 2890068928 succeeded.
@wookie184
Here are the two PRs
https://github.com/python-discord/site/pull/770
https://github.com/python-discord/bot/pull/2261
I'd love to have some feedback !
GitHub Actions run 2890084341 succeeded.
Don't forget to delete this
A few things to do after this PR, but besides my comment, everything looks fine. I'll leave you to clean up the PR history, or just merge it, whichever you prefer.
This is still used in the bookmark command, where the strategy described actually works. It's only falling over for DM messages.
Now it'll error if data["reason"] += f"Pardoned: {pardon_reason}" is hit without reason being set first (if the reason is currently None) ๐
I think setting data["reason"] = "" first in if pardon_reason is not None: would fix it.
will have to open a new PR I think
GitHub Actions run 2891347804 succeeded.
DM and resend DM style has been modified pursuant to [discussions](#dev-contrib message).
New style:
- Re-ordered expires dynamic timestamp to be after duration.
- Removed optional remaining time in favor of detected
(Edited)flag

Mina test, mina like. ๐๐ป
40ad07b Simplify when a message can not be found when b... - ChrisLovering
2ecdaf4 Simplify bookmark error embed helper - ChrisLovering
4d9477b Remove need for additional abstraction in bookm... - ChrisLovering
5689ea0 Add command to delete bot messages in DMs with ... - ChrisLovering
631c7da Improve the docstring for the action_bookmark f... - ChrisLovering
[python-discord/sir-lancebot] branch deleted: bookmark\-enhancements
Connected!
GitHub Actions run 2891441397 succeeded.
I don't have time to continue, but would you like access to my repo to keep it in one PR?
I don't have time to continue right now, but would you like access to my repo to keep it in one PR?
That would be helpful, thanks!
GitHub Actions run 2891664051 succeeded.
Connected!
GitHub Actions run 2891684221 succeeded.
One thread per day sounds a bit limiting, I'd recommend that opposite approach and use something like needle to force threads for every message
Relevant Issues
https://github.com/python-discord/sir-lancebot/issues/932
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #932
Description
I replaced the reactions used currently with buttons
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 agre...
Maybe to be more clear?
"""The button callback."""
Let's add a trailing comma if we choose to use this paranthesis syntax
target_message: discord.Message,
I considered that but to be consistent with how they make the init currently, I left it out. And I am not sure what you mean by paranthesis syntax
Changed, I might add some logging but doesn't hurt to leave it regardless
GitHub Actions run 2895259080 succeeded.
Turns out it didn't work, I went for a similar approach that does
I do not wish to continue working on this (please ask me for access to my fork repo so you can see the code I wrote so far), feel free to ask to be assigned to this issue if you would like to work on it. Thanks!!
Changed, i'd be happy for any more feedback on the wording though, probably still room for improvement.
I'm not sure it really makes a difference here, I think i'll leave it as is
I agree it is a bit confusing, i'll think about how best to do this
I'm not sure how well having mentions in embeds will work, given they often don't resolve. Would it be better to make this a normal text message with allowed_mentions to prevent mentioning users. The character limit is much more limiting unless we use 3 separate messages though.
I think I should also add some sort of overflow handling if there are too many users. I'm thinking I might shuffle each tier and pick the first 10 or something.
This is how it currently looks on server for me (ignore first embed):

Not great. I'll try with a normal text message
Since you're likely going to remove the mentions, why not list all the users in paragraph form? Then we shouldn't need to pick only a random 10.
I mean we don't really need to seperate this into multiple lines, line below is 56 chars:
def __init__(self, target_message: discord.Message):
Hello, This code returns a message.content = 0/empty
Can you point me in the right direction?
client = discord.Client(intents=discord.Intents.default())
@client.event
async def on_ready():
print('We have a logged as {0.user}'.format(client))
quote='test response'
@client.event
async def on_message(message):
print(message)
print(len(message.content))
print('Content' + str(message.content))
print(message.author)
if message.author == client.user:
...
It looks like we have a full on discord.ui.View subclass for a simple link button - but for the actual button that sends the bookmark in the DM, we're just doing:
view = discord.ui.View(timeout=TIMEOUT)
view.add_item(
SendBookmark(self.action_bookmark, ctx.author, ctx.channel, target_message)
)
I think this should be flipped around. There's no need for a full fledged subclass for a simple link button, but maybe we can use a view subclass for the actual bookmark. I doubt...
It looks like we have a full on
discord.ui.Viewsubclass for a simple link button - but for the actual button that sends the bookmark in the DM, we're just doing:view = discord.ui.View(timeout=TIMEOUT) view.add_item( SendBookmark(self.action_bookmark, ctx.author, ctx.channel, target_message) )I think this should be flipped around. There's no need for a full fledged subclass for a simple link button, but maybe we can use a view subclass for ...
Should we consider maybe multi-column tables or embeds? Should at least be able to fit in all the patron supporters that way.


Currently, the text output of the help command is entirely italicized.
Removing these italics would make the text easier to read.
Raised by @dawnofmidnight in #dev-contrib [here](#dev-contrib message)
@Ibrahim2750mi has requested to be assigned if approved in #dev-contrib [here](#dev-contrib message)
Here is screenshot showing the current output with the ...
Hey! Seems this is just a general Python Discord bots question, not related to the actual repository.
We do answer questions about Discord bots in Python, just not here. Check out the #discord-bots channel our discord server to get help.
Since I am new to open source and am looking for my first contrib. I would like to try to tackle this issue with another willing person.
I have been looking into this and have a few questions. I have currently implemented a dark theme for the pre-defined colors in the BULMA_SETTINGS, the colors only change for the nav bar i.e colors present in the BULMA_SETTINGS are only used in the css of nav bar. To have a full dark theme I think we need to have background color too, will the bsckground color be implemented at (base.css)[https://github.com/python-discord/site/blob/main/pydis_site/static/css/base/base.css#L12]? base.css i...
GitHub Actions run 2899566088 failed.
GitHub Actions run 2899570885 failed.
Oops, I should have linked my draft PR on here so people could use it for reference. #657 - site preview
It is now a stale PR and can be ignored.
@Ibrahim2750mi, if you wish to take over I can reassign this issue to you.
In regards to your question about the background colour, from when I was creating this draft I am pretty sure I used the class has-background-white-bis to set let Bulma hook into the background-color css attr...
GitHub Actions run 2899614328 failed.
Great, I'll do it in a few days then.
Nearly everything is ready now, just need to figure out why coveralls isn't working again
bb32158 Switch To Coveralls Action - HassanAbouelela
Umm, I will first try to implement this on my fork(2-3 days) if it works I will post a comment and they you can assign this to me.
[python-discord/king-arthur] New branch created: bot\-core\-integration
973d700 Create dependabot.yml - ChrisLovering
This includes:
- Bumping all deps
- Adding bot-core
- Adding dependabot config
- Moving to an async main function to start the bot
- Moving all extension loading (barring jishaku) to bot core
- Adding dunder init files to all packages, required by bot-core ext loaders
- Fixing breaking changes in the newer Discord.py commits
GitHub Actions run 2899972324 succeeded.
[king-arthur] Branch bot\-core\-integration was force-pushed to `bc83f79`
GitHub Actions run 2899981394 succeeded.
[king-arthur] Branch bot\-core\-integration was force-pushed to `eb1014a`
This is great scaleios, thanks!
GitHub Actions run 2899995196 succeeded.
GitHub Actions run 2900089999 succeeded.
[python-discord/metricity] New branch created: stable\-d\.py\-and\-python\-3\.10
This version of bot-core also brings in the 2.0 stable release of Discord.py.
As the bump to Python 3.10 will make existing virtual envs running this project incompatible, a break change made sense to me here.
530d1cd Ensure monkeypatches from bot-core are ran on s... - ChrisLovering
[python-discord/king-arthur] New branch created: botocore\-monkeypatching
GitHub Actions run 2905242846 succeeded.
[python-discord/workers] New branch created: joe/wrangler\-upgrades
This PR upgrades all workers to be compatible with Wrangler 2, we still use the service-worker format for now but all wrangler.toml files for our JavaScript/TypeScript workers now work fine.
There is still a TODO to give this treatment to the Rust worker for serving robots.txt (or alternatively, ditching it and doing it in Django ๐)
All dependency files have been re-locked as well.
GitHub Actions run 2906549408 succeeded.
A couple of comments, only the regex one is required, the rest are just obseravtions.
Haven't reviewed js, css or html directly, but it looks good in the app itself.
Possibly worth changing this to specify that it's a commit from the bot repo, since we're hard coding the URL
Is it worth pluralising this to make it clear it's a list of authors, rather than a single author. From the format_users function, it seems that this is a serialised list of dicts? If so, probably worth mentioning that in the help text too, maybe even a comment describing the structure, or a link to the docs.
Since we're hard coding this to the bot repo, should this instead be
"""A tag from the python-discord bot repository."""
I called it author to follow the naming scheme of the API object, but it probably makes more sense to properly title it. In terms of the documentation, there's also the option of making the author another model, though it really only carries two important bits of info. Another option is to encode the author as a single string from the get-go if we wanted to avoid converting to and from JSON.
The initial value can be null, since the data is only populated when requesting a single tag page (to avoid making 100 requests at once). Once the tag is accessed for the first time (since the last update), it's commit data is saved for future access.
It wasn't intentional, I'll see about removing it.
Hmm, that dash is for tags, not tag groups, so I think it's still necessary (for instance args-kwargs). I hadn't considered tag groups at all when writing this, but I don't think they're separated by spaces either, I think the tag code does not support that. The relevant code for parsing tag commands is:
which leads me to believe that tags currently have to follow the `(...
What would we apply the cache to here? The code checks the TTL against items from the database.
There's also the option of just not caring, it's unusual for the commit author to not be the committer as well, so it's not very important info to display.
Yeah that's a fair point, c0384c62
GitHub Actions run 2907111611 succeeded.
GitHub Actions run 2907126808 succeeded.
Ah, this was my missunderstanding, I thought the ttl was used for an lru cache, but now I see what you mean. Ignore this.
Yea that seems reasonable, when i said separated by spaces I meant the group and the tag itself, I forgot tags could have hyphens in them too.
yea I don't think we need to go as far as another model, I was just surprised when reviewing that a field titled author was actually a serialized json structure containing multiple authors with additional info.
Actually it might be pretty difficult to accurately discern what's a tag group, and what's a tag with a normal sentence after it (for instance this tag link at the bottom of args-kwargs which has a sentence after it). The only reliable way would be to either make a request to the page (reverse does not validate kwargs), or to use the get_tag function, but that can make an extra request (commit data) if the tag is ...
This regex achieves the first part of that:
`*!tags? (?P<first>[\w-]+)(?P<second> [\w-]+)?`*
It might optionally match a second word after the first one, and if it does, that could be a tag group combination
Seems like it would do the job, obviously we'd need to update the tag model and the logic to get the url. So I'd be happy to merge this and have that as a separate PR if needed. Especially since we don't have any tag groups atm anyway.
@minalike Would it be ok with you if I started a PR with the above changes? This issue has been around for quite a bit now and nobody else has suggested anything.
I wrote the code for it, that was pretty simple, but I'm having unrelated trouble getting the test suite running. I'll probably have the fix out tomorrow
25db8f5 Explicitly Specify Infraction Time In Tests - HassanAbouelela
c5e03fb striked passed date - Ibrahim2750mi
fa2a41e Merge pull request #766 from Ibrahim2750mi/stri... - wookie184
ea24afc Merge branch 'main' into fix-infraction-tests - HassanAbouelela
39a54b4 Merge pull request #764 from python-discord/fix... - wookie184
GitHub Actions run 2910184157 succeeded.
GitHub Actions run 2910202417 succeeded.
Fair enough, thanks for the library suggestion though, it looks cool ๐
2343f7a Rename Tag Model Author Field - HassanAbouelela
GitHub Actions run 2910300856 succeeded.
7f823bc Bump kubernetes_asyncio to 24.2.2 - ChrisLovering
[python-discord/king-arthur] New branch created: bump\-dep
This fixes an issue where the config reader couldn't handle bool types.
See https://github.com/tomplus/kubernetes_asyncio/issues/217 https://github.com/tomplus/kubernetes_asyncio/pull/218
GitHub Actions run 2910487000 succeeded.
[python-discord/king-arthur] branch deleted: bump\-dep
4bcddc6 Bump kubernetes_asyncio to 24.2.2 - ChrisLovering
[python-discord/king-arthur] New branch created: bump\-dep
GitHub Actions run 2910503768 succeeded.
7dbadca Add 1<<15 to the raw intents value - ChrisLovering
[python-discord/modmail] New branch created: patch\-message\-content\-intent
[modmail] Branch patch\-message\-content\-intent was force-pushed to `8a4bf0e`
I am of the impression that the .topic command best serves its purpose in python-general and the off-topic channels. I think for the topical questions adding more questions wouldn't be of much use. But that's going but my gut, I haven't actually searched for invocations of the command.
TBH I don't really get it, why the original author had to 2 requests, with varying page.
GitHub Actions run 2913783218 failed.
GitHub Actions run 2913915712 succeeded.
[sir-lancebot] Branch bot\-core\-migration was force-pushed to `632d951`
[sir-lancebot] Branch bot\-core\-migration was force-pushed to `5d546ec`
[sir-lancebot] Branch bot\-core\-migration was force-pushed to `d9e2f10`
f3a0c6c Add dependabot config - ChrisLovering
Description
This bumps the bot up to 3.10, bumps all deps. The bumped deps include bot-core which comes with a move to the stable Discord.py 2.0 release.
Sir-Lancebot never had the async cog loading treatment, so this PR also includes that.
There are also miscellaneous fixes included in here for breaking changes in dep bumps.
Did you:
- [ ] Join the Python Discord Community?
- [ ] Read all the comments in this template?
- [ ] Ensure ...
GitHub Actions run 2914636612 failed.
GitHub Actions run 2914700175 failed.
[sir-lancebot] Branch bot\-core\-migration was force-pushed to `4079908`
[sir-lancebot] Branch bot\-core\-migration was force-pushed to `22cf4e2`
[sir-lancebot] Branch bot\-core\-migration was force-pushed to `ce407f9`
GitHub Actions run 2914784636 succeeded.
[python-discord/modmail] branch deleted: patch\-message\-content\-intent
c6a6740 Add 1<<15 to the raw intents value (#7) - ChrisLovering
For future reference, if needed: https://discord.com/developers/docs/topics/gateway#gateway-intents.
Thanks Chris, very cool.
[sir-lancebot] Branch bot\-core\-migration was force-pushed to `576cdd4`
GitHub Actions run 2920432422 failed.
[sir-lancebot] Branch bot\-core\-migration was force-pushed to `fc20b0d`
GitHub Actions run 2920443190 succeeded.
[sir-lancebot] Branch bot\-core\-migration was force-pushed to `c55deb4`
[sir-lancebot] Branch bot\-core\-migration was force-pushed to `a9c4778`
You're right that I had it flipped. The only other thing I might recommend we change is maybe subclassing discord.ui.View instead of a discord.ui.Button? Usually that's what we do for non-dynamic components. And I think all the parameters we pass into SendBookmark can be passed into the view subclass, and we shouldn't lose any functionality
After gathering some internal feedback, we feel the usage of the topic command outside of python-general, off-topic, and occasionally discord-bots is not high enough to require additional topics. While there is no harm in adding more, the current suggestions aren't compelling enough to add to the current list.
We do have interest however, in boosting the current topic questions for our more traffic-heavy channels where the command is invoked frequently making the existing topics very repetit...
Description
- Some dates are mm/dd/yyyy and others are dd/mm/yyyy. Make this consistent one way or another. Perhaps use localized timestamps since we have that option now instead of using the embed footers.
- Nitpick: I think "
minalike's GitHub profile info" should instead read: "minalike's GitHub Profile" (no backticks, proper casing) - Nitpick: The usage of a large thumbnail in the user embed versus a small icon for the repo embed is weird. I think I prefer the small icon.
...
Instead of the current text which says "Full output: [link]", use a link button instead.
Doc item doc_item.symbol_id='disnake.APIMessageCommand.nsfw' present in loaded documentation inventories not found on site, inventories may need to be refreshed.
The current invite regex is too permissive. It captures any non-space character, while invite codes can only have letters and numbers.
In https://github.com/python-discord/bot-core/commit/c9daa6f3774380794968cf28faf9ba4bde1f68e2 we made it go until the whitespace because of the way the Discord client parses invites, but we can safely account for it by adding / to the cha...
Sooo apparently there are other characters to account for here. The only thing that I can say atm is that a ? stops the invite code parsing.
aeb8c6f Add 1<<15 to the raw intents value - ChrisLovering
[python-discord/sir-lancebot] New branch created: message\-content\-intent
Description
1<<15 is the flag for message content intent, so adding this value to the intents value hard codes that to always be enabled.
Doing it this way also bypasses the need to patch the flags themselvse in discord.py.
This is required until https://github.com/python-discord/sir-lancebot/pull/1092 is merged.
Did you:
- [ ] Join the Python Discord Community?
- [ ] Read all the comments in this template?
- [ ] Ensure there is an iss...
GitHub Actions run 2943592921 succeeded.
Might be worth updating this issues' description with some context for the change as the related PR #1092 indirectly will fix this issue / it isn't mentioned in the PR description.
i.e. The reason this is being added now is due to the message_content becoming a privileged intent
[python-discord/sir-lancebot] branch deleted: message\-content\-intent
[sir-lancebot] Branch bot\-core\-migration was force-pushed to `aec74a6`
GitHub Actions run 2943853719 succeeded.
Connected!
GitHub Actions run 2943852538 succeeded.
GitHub Actions run 2944743769 succeeded.
Will finish this at a later time. Closing, since it'll become stale in the meantime.
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #932
Description
I used buttons for the bookmark command, both to view the bookmarked message from DM's and for other members to bookmark a message that someone else invoked the command on.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue ope...
This pull request replaces the previous PR on the same issue which I deleted, #1091
Doc item doc_item.symbol_id='nextcord.Embed.Empty' present in loaded documentation inventories not found on site, inventories may need to be refreshed.
GitHub Actions run 2958052189 succeeded.
GitHub Actions run 2959585800 succeeded.
69215bf Bump dpy to v2, and make update the project to ... - D0rs4n
[python-discord/sir-robin] New branch created: bump\-dpy\-botbase
The current alert embed for a triggered filter puts the filter type in the main body, where it's easily missed - especially for those of us who have higher-res screens.
Having the triggering filter in the embed's title will give instant access to that information at a glance. Below image is a mockup of what I propose:
I am not precious about the exact formatting of the title, as long as the information is in there.
GitHub Actions run 2960451063 succeeded.
GitHub Actions run 2965658456 failed.
GitHub Actions run 2974599581 failed.
GitHub Actions run 2974754263 succeeded.
GitHub Actions run 2974954034 succeeded.
GitHub Actions run 2975144352 succeeded.
Connected!
Given the actual time this is run could differ by up to 18 hours each week, I think it would be possible that any autobans added in (up to) the first 18 hours after a message may not appear in the next message.
We could make this -8 days (or -7 and 18 hours), if we'd rather have repeats than missed ones. I don't mind either way. I don't think it's worth a more complex solution to 'fix' this though, as it seems pretty minor.
Where do the 18 hours come from?
https://github.com/python-discord/bot/pull/2267/files#diff-2d7d975ffaf01fcfb495567a4238c5d0e5fee119591ad115a83ea6ebf5471677R301 means that it will run at 6pm UTC every day. Rather than some 18 hour offset.
https://discordpy.readthedocs.io/en/latest/ext/tasks/index.html#discord.ext.tasks.loop
I swear I got confused on the exact same thing on a different PR recently ๐คฆ
Ignore what I said ๐
Pretty simple change. None of the internals have been tweaked. A new context menu with type 3 has been added that will allow for users to eval their or someone else's code (this is new) with the press of a button.
I think it would be handy if you could write out your code, and then right click and eval the code. This also works with other people's code, in case you're curious on the result.
The actual implementation shouldn't be hard either, the run_job function is already there, all that needs to be done is have it moved into the context menu callback.
We designed the verification system before we had components and interactions. Discord has changed quite a bit since, and we should revisit the current setup.
Current State
Users have to run a specific command, and if they ran it correctly they'll get a response. The invocation and response disappear after a bit, and if they didn't run it correctly their message disappears almost immediately.
Proposal
This setup can be converted to a button that is added to the explanation mess...
GitHub Actions run 2985216377 failed.
100% has my blessing. That's a great idea
GitHub Actions run 2988842932 succeeded.
GitHub Actions run 2988864612 succeeded.
GitHub Actions run 2988872618 failed.
Docker image builds successfully
Hi! I don't mean to rush you, but any update on this? The PR is excellent except for a few minor changes, I'd love to get this merged. Cheers ๐
Looks good to me! If there are any last proposed changes from the reviewers, and if you could get those resolved, that'd be awesome. Thanks!
Hi Eric! I don't mean to bug you, but thanks for the PR! I think it would see a lot of use in #discord-bots. What's the current status on it? I'd love to get it merged ๐
GitHub Actions run 2996029839 failed.
GitHub Actions run 2996031309 failed.
GitHub Actions run 2996032665 failed.
GitHub Actions run 3001891909 failed.
All of our filters are prefixed with filter right ?
If you want, I could send a PR for this @Etzeitet.
As for implementation we could split based on the underscore then build the title and the type of filter from there.
OR, we could add a key that can hold a descriptive name for each filter.
What do you think ?
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #1090.
Description
Removed the call to self.on_command_error, so that errors from command suggestions are ignored. Also fixed an incorrect typehint that was added in #1064.
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 re...
GitHub Actions run 3011073365 failed.
Because the command currently supports multiple rule integers, I believe it would be intuitive to also support multiple keywords. Ideally, something like !rules 1 keyword 2 keyword2 would work. However, the current command allows invocations like !rules 1 2 3 some text here, and it ignores the "some text here". I'm not sure if this could still be supported given my above proposal.
Need to gather more opinions on what the interface should be.
Once we finalise the desired interface for this command, please update the docstring to mention that keywords can be used. Keep in mind this docstring appears in the help information for the command.
For consistency, this error should not be sent as an embed because the invalid indices message doesn't use one:
There are more uses of italics. Should these be removed too? We need to come to a consensus.
https://github.com/python-discord/bot/blob/9b5f2f67b5cdd0ee427607c94e47cfbc394b286f/bot/exts/info/help.py#L334
https://github.com/python-discord/bot/blob/9b5f2f67b5cdd0ee427607c94e47cfbc394b286f/bot/exts/info/help.py#L375
https://github.com/python-discord/bot/blob/9b5f2f67b5cdd0ee427607c94e47cfbc394b286f/bot/exts/info/help.py#L415
There are also these, which are bold and italic
https://gith...
@MarkKoz Yes I agree that it's not intuitive, but it's also not intuitive IMO to invoke it like this !rules 1 kw1 2 kw2 and also the greedy pattern matching won't work here.
As for when it comes to detecting multiple keywords, we could do that sure, so let's just gather opinions on the interface like you said.
I agree, I just wanted to put it there as placeholder at first, and the response if it was fitting. But definitely too trivial of a matter.
Good catch, consistency is definitely key. I'll re-adapt it.
@MarkKoz Yes, true. And that was done on purpose after the discussion that @wookie184, others and I have had.
You can read that in issue #2108.
The purpose is to be able to fetch rules on keywords as a secondary option, but if someone wants to use rule numbers, then it gets processed as a priority. Otherwise it can either conflict or confuse the person to use both.
Should be changed
In these the title(or name) of the description uses bold which is fine by me, could remove the italics from their description if it is agreed upon:
- https://github.com/python-discord/bot/blob/9b5f2f67b5cdd0ee427607c94e47cfbc394b286f/bot/exts/info/help.py#L415
- https://github.com/python-discord/bot/blob/9b5f2f67b5cdd0ee427607c94e47cfbc394b286f/bot/exts/info/help.py#L375
- https://github.com/python-discord/bot/blob/9b5f2f67b5cdd0ee427607c94e47cfbc394b286f/bot/exts/...
@MarkKoz should I make another commit according to my comment I posted or should I wait until some further discussion?
Perhaps !rules 1 kw1 2 kw2 was a poor choice of an example. What I mean is that the keywords and integers should be accepted in any order/grouping. So kw 1 2 kw 3 kw kw kw 4 5 6 7 kw kw kw 8 would work. Hopefully that's a better example.
I'm not strongly against it as is. I don't think using both is inherently confusing, but it is likely a niche use case. It may become confusing only because we're trying to allow arbitrary text after the command and it may pick up a word as a keyword that was not intended to be a keyword.
@MarkKoz should I make another commit according to my comment I posted or should I wait until some further discussion?
It's up to you. But if you do, you may end up needing to revert some or all of it depending on the conclusion. If you provide pictures of each output that has/had italics, it would help gather opinions.
I'm not sure if that's one of the things that we wanted to do, e.g. drop the priority.
I think that having a pre-known order is also a good thing.
But of course, this just a personal opinion, we could collect more feedback about this to agree on the interface.
self.code_jam_mgmt_api: APIClient | None = None
The change from Optional[APIClient] to APIClient would appear to make this type hint incorrect, as it's being initialized withNone
Connected!
@MarkKoz
| Line number edit | Before | After |
|---|---|---|
| Cog description #L375 | ![]() |
![]() |
| [Brief command detail #L334](https://github.com... |
GitHub Actions run 3021273217 failed.
Yea, I think raising it in #community-meta makes sense here. Allows staff that don't watch #dev-contrib to give opinions too.
3fa905b Fix error in help channels cog which assumed an... - wookie184
[python-discord/bot] New branch created: fix\-ensure\-cached\-claimant\-none\-check
Minor bug I noticed locally, embed description can be None so we needed to check for it to avoid this error:
bot_1 | Traceback (most recent call last):
bot_1 | File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 929, in _load_from_module_spec
bot_1 | await setup(self)
bot_1 | File "/bot/bot/exts/help_channels/__init__.py", line 40, in setup
bot_1 | await bot.add_cog(HelpChannels(bot))
bot_1 ...
GitHub Actions run 3028195931 failed.
If we want to make statsd an optional dependency we shouldn't expose StatsClientBase directly (or by inheriting from it). Instead we should create a wrapper class (e.g. an ABC), with one implementation that uses statsd, and have a separate implementation (that doesn't do anything) for when statsd is not installed.
Users should not need to check that self.stats is not None every time they try to use it, as it never should be None.
We can avoid this by internally using a self._stats attribute that can be None, and exposing a stats property that raises an error if self._stats is None, and otherwise returns the stats client.
I think we should also do this for self.api_client. Whilst it is a slightly different case in that it can be None, it should either always be None or *nev...
I think all the changes so far are improvements, I definitely think not being in italics makes reading longer text cleaner and easier.
RE the two that you couldn't trigger, I think they could be left as is and this changed to be italics:
https://github.com/python-discord/bot/blob/dc9cb7910040f32d91aa546eec23b942a5a72203/bot/pagination.py#L239
My reasoning being that these are all somewhat "meta", I also wouldn't mind just making none of them in italics. I'd like to get another opinion fi...
This seems fine to me, is the plan to use ephemeral messages when it's invoked or treat it exactly the same as the command invocation? Ephemeral sounds like it would be neater otherwise it would come out of nowhere.
I think the first one (Account created at) is a localised embed timestamp (shows dd/mm/yyyy for me), whereas the second one isn't, as localized timestamps in embed footers are very limited. I don't really have a preference on how to fix this inconsistency.
I agree with your second point on changing the title wording/formatting.
I don't really mind the icons being different. I quite like the bigger icon on the user command.
Having placeholder values like "nothing to display" in italics and the rest without makes sense to me
c8eb0ab Check for commands being None in try_get_tag an... - wookie184
[python-discord/bot] New branch created: fix\-silence\-and\-tags\-when\-unloaded
Previously, if the commands were not loaded and you attempted to invoke a command that doesn't exist (e.g. !hello), an error would be raised:
bot_1 | Traceback (most recent call last):
bot_1 | File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 456, in _run_event
bot_1 | await coro(*args, **kwargs)
bot_1 | File "/bot/bot/exts/backend/error_handler.py", line 67, in on_command_error
bot_1 | if await self.try...
GitHub Actions run 3028768204 failed.
GitHub Actions run 3028832835 failed.
I have limited the command to list patrons to bot_commands
I've gone with plain text names listed in the embeds, I think that's neatest.
This is now ready for review
I have refactored this.
I've only tested it quickly so this is mainly a code review (although it seems to work nicely, I like the embeds!)
Firstly, thanks for the PR! The structure of the code seems good and it's been written well.
My main comments here are about repetition, there are couple of places where I think using loops would neaten the code up a bit, making it a bit more concise and extensible. That said, these aren't required changes, i've only mentioned them as something to think about if you want to.
Thanks for the hardwork you've put into this PR!
A few small things in my preliminary review.
Please remove my request for review.
Can't say I know fully what's happening but the checks on this PR aren't failing, which is better than what we have on main :P
Could use a discord timestamp here, I don't mind though.
Would it make more sense to send this to the channel the command was invoked in?
dependancies seems like a misspelling?
fb20aa6 Bump poetry in Docker and lint to 1.2.0 - ChrisLovering
GitHub Actions run 3029061970 failed.
GitHub Actions run 3029064959 failed.
GitHub Actions run 3029082138 was cancelled.
GitHub Actions run 3029092755 succeeded.
GitHub Actions run 3029115554 succeeded.
[python-discord/bot-core] New branch created: poetry\-1\.2\.0
3efbae7 Add metricity to docker-compose so web doesn't ... - ChrisLovering
3e4f320 Update poetry to use 1.2.0 - ChrisLovering
71ca91a Don't mount project root in docker-compose - ChrisLovering
73fc50b Use BOT_TOKEN in example project - ChrisLovering
0004add Add changelog entry for poetry & exmaple projec... - ChrisLovering
The change to 1.2.0 requires the use of in-project venvs, rather than pip user installs. This changes how the project is laid out, hence the Dockerfile & compose changes.
GitHub Actions run 3029243909 failed.
2c7a8e0 Use venvs with poetry in Dockerfile - ChrisLovering
[python-discord/king-arthur] New branch created: poetry\-1\.2\.0
his is required due to a regression in poetry, see https://github.com/HassanAbouelela/actions/pull/7
If the status gets approved can I be assigned this issue?
Connected!
GitHub Actions run 3029668460 succeeded.
GitHub Actions run 3029685076 failed.
GitHub Actions run 3029844112 succeeded.
GitHub Actions run 3029859965 succeeded.
GitHub Actions run 3029863971 succeeded.
GitHub Actions run 3029876046 succeeded.
hah, yes. I even added the channel arg to send_weekly_autoban_report to support this, I just never updated this line to send ctx.channel
[python-discord/king-arthur] branch deleted: poetry\-1\.2\.0
GitHub Actions run 3029927360 succeeded.
86aaf02 Send weekly_autoban_report to ctx channel when ... - ChrisLovering
99c742a Don't mount project root in docker-compose - ChrisLovering
GitHub Actions run 3029943497 failed.
GitHub Actions run 3029945988 was cancelled.
GitHub Actions run 3029947460 succeeded.
Is there a specific reason for the new has_role_id function and iterative search comparison instead of just doing if member.get_role(role_id):?
didn't intend to leave another review but I am.
This has an inherent dependency on how the patreon bot works. If the patreon bot decided to take away and giveth the new role in two seperate api requests, this would cease to work. Or, if the patreon bot were to take the old role away and then give the new role, this would also cease to work.
This all hinges on the patreon bot making a single api request, and would lead to funky behaviour if their bot used more than one request--and I believe it does.
patron_names = [f"โข {str(patron.name)}" for patron in patrons]
I believe you meant str(patron), which since this is an f-string would be the same as just patron.
Again minor, but this should be "A patreon tier of 0 indicates the user is not a patron."
Since PATREON_TIERS is ordered highest to lowest, that means we iterate highest to lowest.
As such, we could instead store "seen patrons" and check if they're in that list. May be slightly cleaner.
A few points, mostly about style so not requesting changes so as to not block the PR with this review.
According to the docs, the embeds kwarg should be a list and not a tuple.
Yep, edited the suggestion
The str() part isn't necessary (f-strings automatically call the __str__())
GitHub Actions run 3031317553 failed.
@MarkKoz After some thought, I figured that it wouldn't hurt to have them in random order & changed the implementation.
Can you have a look now please ?
We wait until ready before loading extensions so it shouldn't matter https://github.com/python-discord/bot-core/blob/127d0efa219d29e15bd71339d0d2517945aed57c/botcore/_bot.py#L125
It would make a pretty long line. I prefer it as is.
This already feels pretty clean and explicit to me, keeping track of an extra list would require more code.
Given this is static text it feels similar to a tag which we allow to be invoked anywhere. I don't feel strongly either way though.
I don't think this should be an issue. Whatever order things happen there will still only be one member_update that involves the tier increasing, which is all that this checks.
The only slightly unintended case would be if a user moves down a tier (e.g. from 3 to 2), and the bot does this by removing 3 and then adding 2. In this case the message would be sent, although it still wouldn't be incorrect (Just saying they are now a tier 2 patron).
Fixing this would probably require waiting f...
I opened https://github.com/Rapptz/discord.py/issues/8460 as this shouldn't matter and it's type hinted as allowing sequences anyway
It would be less than the 120 char limit (107 chars), but ultimately up to you.
I don't feel strongly either, and I don't see it being an issue so think it's fine as-is. If it does prove to be an issue we can always add in another PR.
GitHub Actions run 3031644720 failed.
I think you accidentally removed the "is" after Python Discord
NIT: "and maybe" --> "and sometimes"
๐ I made a couple other small changes to it too
Works nicely. Could you mention the behaviour in the docstrings?
Why don't we just do guild = self.bot.get_guild(Guild.id) here and save all the task code?
Should we delete them from pings_off_mods before returning? Does it matter?
I'm going to close this due to lack of activity and since it still seems quite far from being done. More discussion is needed on what formats should be accepted before continuing with this idea (this currently only accepts hh:mm or just hh which is quite different to what the example in the issue proposed).
You could do f"....... <#{constants.Channels.meta}> ....." instead to avoid importing the function (and a potential API call if it's not in the cache for some reason).
isdigit is not appropriate because it also considers a bunch of Unicode characters valid, but int() will not work with them. The best way is to use int() within a try-except catching the ValueError.
Do you think renaming this to "indices", "numbers", or something similar would make the distinction between this and the keywords more clear?
"redis_ready" attribute was removed from Bot in fc05849 so it no longer needs to be mocked. It was [suggested](#dev-contrib message) that this change was small enough to not warrant creating an issue.
Why was this change made, donโt we still want the other files and directories such as tests and configs?
This was made because I was putting the venv inside APP_DIR, causing venv on host to overwrite it with this volume.
It's not needed now though.
Dropped the commit that added this
GitHub Actions run 3035907621 succeeded.
Before the Code Jam some features (the majority of them) weren't implemented in an optimal manner, hence a facelift PR is required.
A few notes from previous PRs:
- There is a common pattern in Sir Robin where we get a team, handle possible API errors, and the proceed with the data gathered from the API. This procedure should be moved to a helper function.
- Return the data as dataclasses (/pydantic models), so that we don't have to slice dicts everywhere.
- Set the Textbox's type to b...
GitHub Actions run 3040419312 was cancelled.
GitHub Actions run 3040422886 succeeded.
[python-discord/bot] branch deleted: pin\-poetry\-to\-1\.1\.X
350df44 Use venvs with poetry in Dockerfile - ChrisLovering
e12e591 Use HassanAbouelela/setup-python for CI - ChrisLovering
0b495e7 Bump poetry in Docker and lint to 1.2.0 - ChrisLovering
03a3a03 Don't use fake in-project venvs for poetry - ChrisLovering
7adc758 Merge pull request #2268 from python-discord/pi... - HassanAbouelela
GitHub Actions run 3040713039 succeeded.
[python-discord/bot] New branch created: ignore\-mounted\-project\-venvs
Poetry's virtualenvs.in-project config deafults to None, meaning it will use in-project venvs if it finds one, otherwise it will use the cache dir. In dev we mount the entire root project directory to /bot. This means if the host's venv in in the project dir, this will get mounted and prioritised by poetry run. If the host is on a non-linux OS this will cause poetry to fail to boot.
Specify the path for poetry venvs
Without this the venv would be created in /root/.cache and the nonn-root...
GitHub Actions run 3041272660 succeeded.
Connected!
We wouldn't want, for example, for someone to eval a message from 10 hours ago, especially in help channels
You're right, we wouldn't. We could probably add some config option for this in config.yml or similar, but I think 2 minutes seems reasonable. As for the message popping up without any context, not necessarily. You can see which user ran the command, and you can click on it to be taken back to the original message that eval was ran on.
Since the input message might not have ...
Can I please be assigned this issue?
I believe I have fixed this.
Corrects key values for Giphy API response in .spookygif command
Relevant Issues
#1050
Description
Made the following change to line 28 of bot/exts/holidays/halloween/spookygif.py
-url = data["data"]["image_url"] +url = data["data"]["images"]["original"]["url"]Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an iss...
GitHub Actions run 3055678319 succeeded.
2c87e96 Add check_rerun_job util to commands.py - TizzySaurus
[python-discord/bot-core] New branch created: check\-rerun\-job\-util
Uses the logic of the eval command in python-discord/bot to create a re-run util.
That is, if the passed context's message content is edited within REDO_TIMEOUT seconds, and the user then reacts with the ๐ emoji that appears, then the util will return the new content, indicating that the job should be re-run. Otherwise, None is returned, indicating the job shouldn't be re-run.
This is made since python-discord/sir-lancebot#1062 asks for re-ru...
cdc9b30 Update changelog.rst - TizzySaurus
4e008c2 Use double backquotes in docstring. - TizzySaurus
Doc item doc_item.symbol_id='disnake.WidgetMember.bot' present in loaded documentation inventories not found on site, inventories may need to be refreshed.
Reviewed and tested.
LGTM :star2:
Description
Hello, the feature I would like to propose is a cellular automaton generator.
like if someone types;
.simulate
and it would send a picture of the output.
Reasoning
Proposed Implementation
the code for the simulation is already implemented in one of my own bots and it's fully functional
(https://github.com/Sas2k/PokeStrike-Utility-Bot/blob/main/Cogs/Fun.py#L19-L72)[Link-To-Gitub-Repo-of-the-existing-code]
. We could also add a separate command to display rule aliases, the discoverability from that isn't as high
There are a couple of cases that have come up that I didn't consider in my original proposed specification https://github.com/python-discord/bot/issues/2108#issuecomment-1219378065. Here are some updated cases, and how I think they should work (all still open to discussion).
!rule 1 coc 2 - Show rule 1 and 2 (coc is rule 1, shouldn't repeat it)
!rule 1 hello 2 coc - Show rule 1 (only)
!rule 999 coc - Error about invalid indices
!rule coc 999 - Error about invalid indices
`!rule...
Allowing keywords anywhere is an interesting idea, as it would allow things like !rule that breaks the tos of xyz. That said, I think I agree and prefer the more conservative way of stopping after an invalid keyword, I could possibly be convinced otherwise though.
GitHub Actions run 3070108586 failed.
40ab60f Allow referencing message as argument to !remi... - TizzySaurus [29d8820](https://github.com/python-discord/bot/commit/29d882065e12f9a042b14d6dfaf3161af215c953) Make reference message in reminders italic. - TizzySaurus [2536152](https://github.com/python-discord/bot/commit/2536152ffe43a9058dffc03fd8939015c0fd3d37) Merge branch 'main' into bot-2231-bug - TizzySaurus [9c85342](https://github.com/python-discord/bot/commit/9c85342f4449f2116fb36ee1500ad06a94c1e14c) Update docstrings & comment. - TizzySaurus [15e0491`](https://github.com/python-discord/bot/commit/15e0491a3ba533a2423d44b415de355d1152f84c) Merge remote-tracking branch 'origin/bot-2231-b... - TizzySaurus
[python-discord/bot] branch deleted: bot\-2231\-bug
GitHub Actions run 3070156973 succeeded.
Connected!
GitHub Actions run 3070187939 succeeded.
GitHub Actions run 3070453439 succeeded.
There are a couple of cases that have come up that I didn't consider in my original proposed specification #2108 (comment). Here are some updated cases, and how I think they should work (all still open to discussion).
!rule 1 coc 2- Show rule 1 and 2 (coc is rule 1, shouldn't repeat it)!rule 1 hello 2 coc- Show rule 1 (only)!rule 999 coc- Error about invalid indices!rule coc 999- Error about i...
GitHub Actions run 3011073365 failed.
Not sure why CIs are broken but code here looks good.
Works nicely, thanks!
GitHub Actions run 3073266053 was cancelled.
GitHub Actions run 3073266629 failed.
GitHub Actions run 3073404817 succeeded.
GitHub Actions run 3073432703 succeeded.
Connected!
I don't think we've ever actually given out a mechanical keyboard, so I removed it from here.
GitHub Actions run 3073530384 succeeded.
Could consider making ids a set to remove duplicates.
I also wonder if we'd want an upper limit on the length to prevent spamming the site api (you could currently cause nearly 1000 api requests with !remind delete 1 1 1 ...)
Always truncate the number of keywords we would process to a value
n
Could you clarify what you mean by this?
Are you saying you think !rule hello coc should match coc but !rule long message without any keywords but then coc shouldn't? If so, I think that whatever value for n we pick would be quite arbitrary, and make the behaviour somewhat confusing and unpredictable.
There are a couple of reasons I can for only matching at the start:
- Acts more like other commands, in that any text after the command invocation is ignored.
- Easier to understand how the command works (e.g. someone wouldn't have to guess which word in someones message is causing the rule to appear)
- Avoids false positives (e.g.
!rule coc While this isn't an advert, it *does* break our code of conductwon't matchadvert) - If we match through the whole message people would probably...
Yep, agreed :+1:
I've set the limit to 5, since that's high enough to likely not inconvenience the user, but l low enough to still prevent API abuse.
GitHub Actions run 3074339697 succeeded.
GitHub Actions run 3074453235 failed.
GitHub Actions run 3074502152 succeeded.
GitHub Actions run 3074531918 succeeded.
GitHub Actions run 3074542102 succeeded.
Chris consolidated the docker changes into https://github.com/ChrisLovering/python-poetry-base, which has reduced the work required here.
GitHub Actions run 3074611353 succeeded.
Just added the two commits above in the latest push. The force push was to drop 82a07329ab5093f76d7349be46d5ba4b089c9246
[python-discord/bot] New branch created: poetry\-1\.2
This switches the work done in #2268 and #2276 for https://github.com/ChrisLovering/python-poetry-base
GitHub Actions run 3074701576 succeeded.
0099911 Fix Poetry 1.2 Support - HassanAbouelela
[python-discord/forms-backend] New branch created: poetry\-1\.2
Poetry 1.2 introduced a regression which broke pip --user installs. These types of install were the main way we did installations in docker and CI, as they made it much more convenient to control the location, availability, and caching of packages.
Poetry's team does not recognize this as a supported use case, so major changes were required to get everything working again. Most of the changes were consolidated into chrislovering/python-poetry-base for docker, and HassanAbouelela/setup-py...
GitHub Actions run 3074724250 succeeded.
05fcb53 Use python-poetry-base Base Image - HassanAbouelela
[python-discord/king-arthur] New branch created: poetry\-1\.2
GitHub Actions run 3074758215 succeeded.
Use chrislovering/python-poetry-base as the base image for docker builds, to centralize poetry installation and configuration.
This is part of a larger push across all python-discord projects.
GitHub Actions run 3074771638 succeeded.
[python-discord/metricity] New branch created: poetry\-1\.2
13522f2 Fix Poetry 1.2 Support - HassanAbouelela
Poetry 1.2 introduced a regression which broke pip --user installs. These types of install were the main way we did installations in docker and CI, as they made it much more convenient to control the location, availability, and caching of packages.
Poetry's team does not recognize this as a supported use case, so major changes were required to get everything working again. Most of the changes were consolidated into chrislovering/python-poetry-base for docker, and HassanAbouelela/setup-py...
GitHub Actions run 3074829529 succeeded.
5260fa9 Fix Poetry 1.2 Support - HassanAbouelela
[python-discord/sir-lancebot] New branch created: poetry\-1\.2
Relevant Issues
Approved by myself and @ChrisLovering
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Poetry 1.2 introduced a regression which broke pip --user installs. These types of install were the main way we did installations in docker and CI, as they made it much more convenient to control the location, availability, and caching of packages.
Poetry's team does not recognize this as a supported use case, so ma...
[python-discord/forms-backend] branch deleted: poetry\-1\.2
GitHub Actions run 3074869032 succeeded.
GitHub Actions run 3074872095 succeeded.
GitHub Actions run 3074883656 succeeded.
925c1fb Fix Poetry 1.2 Support - HassanAbouelela
[python-discord/sir-robin] New branch created: poetry\-1\.2
Poetry 1.2 introduced a regression which broke pip --user installs. These types of install were the main way we did installations in docker and CI, as they made it much more convenient to control the location, availability, and caching of packages.
Poetry's team does not recognize this as a supported use case, so major changes were required to get everything working again. Most of the changes were consolidated into chrislovering/python-poetry-base for docker, and HassanAbouelela/setup-py...
[python-discord/sir-robin] branch deleted: poetry\-1\.2
[python-discord/sir-lancebot] branch deleted: poetry\-1\.2
Connected!
Connected!
GitHub Actions run 3074931020 succeeded.
GitHub Actions run 3074929837 succeeded.
GitHub Actions run 3074941969 succeeded.
Connected!
GitHub Actions run 3074951994 succeeded.
As shown, type error if a PyPI package is inquired and has no short description to render

Looking at https://pypi.org/pypi/base2048/json, the summary attribute is null.
We're passing this summary attribute straight into discord.py's escape_markdown, which is passing into re.sub, which can only take str|bytes -
https://github.com/python-discord/bot/blob/4dc9a952a71d03959e302434e8e9941e9bd3b577/bot/exts/info/pypi.py#L57
PyPi doesn't require the summary - we don't want to fail every time sometime forgets to add one...
Can we just fix this by converting the `None...
Can we just fix this by converting the None to an empty string before attempting to escape it? For example -
if info["summary"] is None: info["summary"] = ""
I personally would go for
summary = escape_markdown(info["summary"] or "")
but ofc both work.
[sir-lancebot] Branch bot\-core\-migration was force-pushed to `a84b743`
GitHub Actions run 3077077333 succeeded.
[python-discord/bot-core] New branch created: bump\-d\.py
This also bumps various dev deps
Changelog:

3efbae7 Add metricity to docker-compose so web doesn't ... - ChrisLovering
0f12f00 Update poetry to use 1.2.0 - ChrisLovering
ed2639b Don't mount project root in docker-compose - ChrisLovering
ce894c0 Use BOT_TOKEN in example project - ChrisLovering
6436908 Use Poetry Base In Docker Image - HassanAbouelela
[python-discord/bot-core] branch deleted: poetry\-1\.2\.0
[python-discord/bot-core] branch deleted: bump\-d\.py
[python-discord/bot-core] New tag created: v8\.2\.1
0cd7f30 Bump deps to latest - ChrisLovering
GitHub Actions run 3077395818 succeeded.
GitHub Actions run 3077534206 succeeded.
GitHub Actions run 3077625907 succeeded.
We use it in a few places in bot, such as utils where we don't have access to the bot var very easily.
I've done this here mostly for consistency.
There are a couple of cases that have come up that I didn't consider in my original proposed specification #2108 (comment). Here are some updated cases, and how I think they should work (all still open to discussion).
!rule 1 coc 2- Show rule 1 and 2 (coc is rule 1, shouldn't repeat it)!rule 1 hello 2 coc- Show rule 1 (only)!rule 999 coc- Error about invalid indices!rule coc 999- Error about i...
[python-discord/bot] New branch created: 2278\-pypi\-cmd\-fix
8c46657 Incident archive improvements - TizzySaurus
1e0c0cf Fix tests - TizzySaurus
b7e0361 Address Reviews - TizzySaurus
40ab60f Allow referencing message as argument to !remi... - TizzySaurus [0be3332](https://github.com/python-discord/bot/commit/0be3332904690730589113b99198f2f3fc2f1091) Added DurationOrExpiry` type union - ionite34
[python-discord/bot] branch deleted: disable\-pytest\-nose\-plugin
40ab60f Allow referencing message as argument to !remi... - TizzySaurus [0f4bc18](https://github.com/python-discord/bot/commit/0f4bc18ceb5ef5e55e003da409a3da8e3e1d9cf8) Disable nose plugin in pytest - wookie184 [29d8820](https://github.com/python-discord/bot/commit/29d882065e12f9a042b14d6dfaf3161af215c953) Make reference message in reminders italic. - TizzySaurus [2536152](https://github.com/python-discord/bot/commit/2536152ffe43a9058dffc03fd8939015c0fd3d37) Merge branch 'main' into bot-2231-bug - TizzySaurus [350df44`](https://github.com/python-discord/bot/commit/350df44731875c4e8b28fc509d83b431cfefbc5c) Use venvs with poetry in Dockerfile - ChrisLovering
I don't think this code is reachable, in which case it can be removed.
sets are not ordered, so you should remove duplicates and then sort.
(in practice they will most likely end up ordered anyway because of how integers are hashed, although this isn't something to rely on)
Behaviour seems perfect now, thanks! I have a couple comments
I think it's slightly neater here to use the start argument of enumerate, and I think rule_number is a more descriptive name than pick.
for keyword in keywords:
for rule_number, rule in enumerate(full_rules, 1):
if keyword in rule[1]:
final_rule_numbers.append(rule_number)
break
Where you create available_keywords above you could instead consider making a keyword_to_rule_number di...
GitHub Actions run 3077888939 succeeded.
[python-discord/bot] branch deleted: fix\-ensure\-cached\-claimant\-none\-check
8c46657 Incident archive improvements - TizzySaurus
1e0c0cf Fix tests - TizzySaurus
b7e0361 Address Reviews - TizzySaurus
40ab60f Allow referencing message as argument to !remi... - TizzySaurus [0be3332](https://github.com/python-discord/bot/commit/0be3332904690730589113b99198f2f3fc2f1091) Added DurationOrExpiry` type union - ionite34
[python-discord/bot] branch deleted: fix\-not\-awaited\-coroutine\-warning
31f6b90 Refactor infractions to avoid passing around co... - wookie184
fb419bc Fix tests - wookie184
1eff1d8 Add note to docstring, fix type-hints, and upda... - wookie184
9a4dbd8 Merge branch 'main' into fix-not-awaited-corout... - ChrisLovering
3e3e885 Merge pull request #2242 from python-discord/fi... - ChrisLovering
Connected!
GitHub Actions run 3077916705 succeeded.
GitHub Actions run 3077915071 was cancelled.
GitHub Actions run 3077922335 succeeded.
Connected!
GitHub Actions run 3077939551 succeeded.
[python-discord/site] New review comment on pull request #770: Add a collection of keywords per rule
{"exam", "exams", "assignment", "assignments", "homework"}
My comments are just suggested additions of keywords
I think it would make more sense for the keywords to be in lists rather than sets, as since they're converted to JSON to send over they'll end up as lists either way, having them start as lists makes that a bit clearer.
Could you also update the docstring of the class to reflect the changes.
Thanks
[python-discord/site] New review comment on pull request #770: Add a collection of keywords per rule
{"ad", "ads", "advert", "advertising"}
GitHub Actions run 3077953198 succeeded.
85d8ae4 feat: add reason argument to pardon commands - VirdanTheBurden
6ca8e48 fix: lint - VirdanTheBurden
2e01be7 Merge pull request #1 from VirdanTheBurden/feat... - VirdanTheBurden
e7188bc fix: docstrings - VirdanTheBurden
b8d4de5 Merge pull request #2 from VirdanTheBurden/feat... - VirdanTheBurden
Connected!
GitHub Actions run 3077984868 succeeded.
GitHub Actions run 3078004611 succeeded.
GitHub Actions run 3078022412 failed.
GitHub Actions run 3078036878 failed.
The docstring I meant was this one (e.g. the example response could be updated), although fine to have one on the get method as well ๐
GitHub Actions run 3078074196 failed.
The docstring I meant was this one (e.g. the example response could be updated), although fine to have one on the
getmethod as well ๐
Oops ! Ahahah
Done !
I'm going to close this PR as:
- From bluenix's comment it seems this approach doesn't fix the issue (and I don't think this refactor is worth doing otherwise)
- There are quite a few conflicts
- It's gone a long time without any activity
GitHub Actions run 3078077698 failed.
[python-discord/site] New review comment on pull request #770: Add a collection of keywords per rule
Best just to describe what it does. How it is used is out of scope of the actual API.
Returns a JSON array containing the server's rules
and keywords relating to each rule. Example response:
GitHub Actions run 3078119994 failed.
This looks great, thanks Wookie!
Not one for this PR, but we should really type the cached pool with some dataclasses some time, so we don't need to slice everywhere
Unacceptable
"*Refer to their nomination and infraction histories for further details.*\n"
8d891fc Moved escape_markdown after Truthy check - ionite34
GitHub Actions run 3078199622 was cancelled.
GitHub Actions run 3078201140 succeeded.
Is this still necessary? I think the issue was fixed in https://github.com/python-discord/bot/commit/2b2dc95f2aa2ac6606b51be183861f2663be3b3e
GitHub Actions run 3078293387 succeeded.
Connected!
GitHub Actions run 3078314174 succeeded.
[python-discord/bot] branch deleted: 2278\-pypi\-cmd\-fix
f65b494 Moved escape_markdown after Truthy check (#2279) - ionite34
GitHub Actions run 3078362457 succeeded.
Connected!
GitHub Actions run 3078376744 succeeded.
Functionally, everything is fine. However, I have some suggestions to improve the code.
Thoughts on doing it like this instead?
final_rules = []
final_rule_numbers = {keyword_to_rule_number[keyword] for keyword in keywords}
final_rule_numbers.update(rule_numbers)
for rule_number in sorted(final_rule_numbers):
...
Avoid using get() if you don't need to rely on its default value. Otherwise, it may mislead readers into thinking that sometimes the key may not exist. Furthermore, the code below assumes everything in final_rule_numbers is a valid index. If a bug was somehow introduced that caused a key to not exist in keyword_to_rule_number, the resulting error would be clearer if it originated from this point than from somewhere below.
Using list() is redundant.
[python-discord/site] New review comment on pull request #770: Add a collection of keywords per rule
Representing the data as tuples in docs is potentially misleading because JSON does not distinguish between tuples and lists once serialised.




