[python-discord/quackstack] branch deleted: vcokltfre/chore/enable\-docs
#dev-log
1 messages ยท Page 73 of 1
Connected!
The original color generations were really close and non differentiable due to which it looked the man duck wore a night suit xD. Now we use the duck body color to generate triad, therefore the three colors can never be similar :D
Earlier

Now
 -> Image.Image:
I'm not sure what you mean by the "eariler" image, the ninja suit is meant to be all-black.
I'm not sure what you mean by the "eariler" image, the ninja suit is meant to be all-black.
Oops yeah, here you go
Also for some reason, the flake8 works perfectly on mine but fails here, I will commit the change according to the flake8 error raised on workflow.

What's up with the beak on that duck? it looks as if the templates aren't applied in the right order
b26368c Nominations: automate post archiving - Akarys42
[python-discord/bot] New branch created: nomination\-archive\-automation
d6098bc Nomination: ping the whole team - Akarys42
This Pull Request adds automation to the #nomination-archive channel.
It adds a reaction handler to the talentpool cog restricted to the #nomination-voting channel :
- ๐ซ: unpin the message
- incident actioned or un actioned emoji: send an embed to the #nomination-archive channel and delete the message
When formatting the embed, the code does the following assumptions:
- The first user mention is the user nominated
- The first (introduction and ping) and last (how to vote) paragraphs...
When this was originally discussed, I raised some concerns about the numbering system not actually being functional. Tags move around, and I'd think you'd end up linking to incorrect pins a lot. There was discussion about it [here](#dev-contrib message).
In terms of the rationale of this issue, I don't remember if library-specific tags were a thing back then or not, but they 100% are now. We have a ton of discord.py tags (whi...
Looks good, besides one singular question.
How will we be encouraging linting, if at all?
It is mentioned inside the contrib guidelines. It may be worth to mention them here again but in the end the failed lint will be the same thing, weโll end up with a second fix commit.
Maybe we should link the contributing guidelines in a comment within this PR template?
It is already mentioned line 20 but I feel like it could even be the first line of the template. We could also add a sentence about when this template should be used.
I somehow completely missed that link with my eyes. Sorry about that, this PR looks good to me.
29084d1 Fix errors when a subreddit has <5 posts. - ChrisLovering
d77986e Fix spelling of a user facing message in reddit... - ChrisLovering
993a280 Merge branch 'main' into fix-reddit-index-error - ChrisLovering
2fe7815 Merge pull request #702 from python-discord/fix... - ChrisLovering
b352097 Merge branch 'main' into update-pr-template - Xithrius
[python-discord/sir-lancebot] branch deleted: update\-pr\-template
Connected!
Author hasn't responded to any pings. This PR can now be taken by any, with approval from a core developer.
Indeedly, fixed in 8d3e82c3dfee4bc2c1f5942cc54a2bb72406edd2, thanks!
Seems like the default behavior was enough, it has been removed in 9a0b7643.
1fdd5aa Tests: simplify public flags handling - Akarys42
6950d2a Earth Day - xkawixgirlx
0361eb6 Merge branch 'main' of https://github.com/pytho... - xkawixgirlx
3e84e24 Edits Made to file names on the commit for merge - xkawixgirlx
1a8b820 Made changes to files according to comments - xkawixgirlx
6e73b8f Removed all files in the static, fixed banner png - xkawixgirlx
[python-discord/branding] branch deleted: ci/143/status\-embed
You don't need the parentheses here.
Also, if cleaning was cancelled do we actually want to return this? it seems better to just not clean anything in that case and return an empty list.
Here as well
message_mappings, message_ids = self._get_messages_from_cache(amount=amount, to_delete=predicate)
I still think that the error embeds should be removed. Either completely, or placed in a separate function and replaced with error invocations, as it's the error handler's role to catch errors, convert them into embeds, and send them.
To be clear, until works as expected, between doesn't.
Running on Windows 10 Pro 20H2 through WSL2 on Ubuntu 20.04LTS seem to be rending correctly on Firefox 86.0 (64-bit)
On macOS Catalina 10.15.7 using the following browsers "django" is aligned correctly but not "BULMA":
- Google Chrome Version 90.0.4430.72 (Official Build) (x86_64)
- Safari Version 14.0.2 (15610.3.7.1.10, 15610)
- Firefox 80.0.1 (64-bit)
I'm guessing this is an OS specific issue.
<img width="348" alt="Screen Shot 2021-04-24 at 9 52 48 PM" src="https://user-images.githubusercontent.com/1612303/115969798-8c4c3e00-a547-11eb-9253-034fedb617fd.png">
Connected!
LGTM! Beak overlaying like that is definitely an issue but that's in ducky generation so we'll deal with that after
Yea, we don't want to kick them from voice with this, so adding a wait until guild available makes sense.
LGTM, tested and works well.
I think member.voice also uses the cache, hence I will wait for the cache ready even before I call member.voice
0dd2e75 Add bot and verified bot badges to the user embed. - Akarys42
2ad0317 Merge branch 'master' into feat/1365/add-bot-ba... - jb3
b8fb422 Merge remote-tracking branch 'origin/main' into... - Akarys42
0e4fd3d Make YAMLGetter raise AttributeError instead of... - Akarys42
c910427 Move the verified developer badge to the embed ... - Akarys42
[python-discord/bot] branch deleted: feat/1365/add\-bot\-badges\-to\-user
Connected!
Description
Implement selective trace logging from the python-discord/bot#1529 PR, enabling whitelisting or blacklisting certain loggers to emit trace logs instead of always emitting all trace logs with the debug mode.
Reasoning
Discussed in python-discord/bot#1502
Proposed Implementation
A new entry for the trace loggers will need to be added to the Client config, grabbing its value from the BOT_TRACE_LOGGERS
env var.
The _set_trace_loggers function can be copied...
Description
New commands for:
- camelcase
- pascalcase
- snakecase
- other cases that get suggested in issue comments here
This would essentially just be a cases extension to randomcase
Would you like to implement this yourself?
- [x] I'd like to implement this feature myself
- [ ] Anyone can implement this feature
Seems to work well, mostly minor comments:
f"**Channel:** {channel.mention} ({channel.category}/#{channel.name})\n"
Can it not just be a single line?
message = await MessageConverter().convert(ctx, message_link)
Also passes the message into `add_signals` if the message is an incident.
You know what scratch that, it can help identify who sent what.
The bill was originally in the wrong layer, merging this commit would move it to the correct layer.
Earlier

Now

[python-discord/site] New branch created: filter\-rewrite
i realised this was a bit vague, but essentially you'd call .pascalcase this is a sentence which would spit out ThisIsASentence
I'd suggest that we wait until #597 is merged for this issue.
Looks great! Excited to see this merged
Vintheruler1#9325* was thinking of a gratitude command which you could run once somebody had helped you with something. It would most likely have to have a cooldown of some sort however to prevent abuse.
- They suggested this and I did point them to here but they were happy for me to suggest it and credit them for it.
This seems like it would fit better in sir-lancebot if anywhere
[python-discord/site] New branch created: new\-filter\-schema
I think this could end up game-ifying the system which isn't something we want
I agree with @anand2312, people would probably just start asking for points or what-not.
This seems like it would fit better in sir-lancebot if anywhere
@vcokltfre sir-lance wouldn't have a great time tracking points since there's no database.
I don't believe it should be points-based. Rather, it should be an individual 1 off gratitude.
One user can give 1 gratitude to another user only once? A user could still unfortunately go around asking for gratitude.
Could you describe exactly what this command would do? I think we're all fairly against there being some form of leaderboard for this, since it promotes undesirable behaviour and adds moderation burden.
However, from your comments, it doesn't seem like that's what you had in mind for this. Could you describe in detail what this proposal is?
I think they mean one off as in you just run the command and it thanks them totally statelessly, but i still don't really see how it would fit/be of any use
I think they mean one off as in you just run the command and it thanks them totally statelessly, but i still don't really see how it would fit/be of any use
If that's the case, I don't see why you couldn't just thank them yourself. That'd also be much more sincere.
In detail:
User A has a problem.
User B helps them solve the problem.
User A thanks User B with the command.
There would be no points (for reasons you have stated above which I agree with entirely). So yes, it would essentially be stateless.
Sometimes, people (like the person who wanted this suggested) want to appreciate their gratitude, especially if it was a challenging issue. They may feel like a simple thank you is not enough, but they don't want to go out of their way and get ...
How would this be different than just saying thank you?
We currently have this lemonsaurus https://github.com/python-discord/branding/blob/main/emotes/other/src/lemonsaurus.svg
It would be really cool if we could have an animated version, with a walking cycle. Maybe with the tail & arms moving too!
Breaks message length
This doesn't seem to be resolved
To clarify, if I say post an entire message of just A's and then link it, I'll get "...". There should be some minimal preview.
This doesn't raise an error anymore, but it still fires the "skipping" log message whenever I action an incident, even if the embed is still there.
do we also want to have a "title" in the tags?
How would this work? Currently we don't have embed titles for tags, unless you mean we should make the start of the files **title**, which I think would be a good idea.
We could use a similar approach to the branding repo and put the tag metadata in the YAML frontmatter of the markdown documents.
For example:
---
title: How to get rich, fast.
---
1. Buy stonks
2. Watch stonks
3. ????
4. Profit
We could use a similar approach to the branding repo and put the tag metadata in the YAML frontmatter of the markdown documents.
For example:
--- title: How to get rich, fast. --- 1. Buy stonks 2. Watch stonks 3. ???? 4. Profit
I was only planning to do it with a bold text at the start like in ToxicKidz' comment, but implementing this shouldn't be too hard and will give more flexibility around tags in general so I'll do that.
Should the ...
I was only planning to do it with a bold text at the start like in ToxicKidz' comment, but implementing this shouldn't be too hard and will give more flexibility around tags in general so I'll do that.
Thinking about it, that is likely out of scope for this specific PR. Maybe we group that in with #1545 so we can have richer tag data.
Should the URLs also be moved to the title?
Up to you, I know that the URL embeds don't look too great, and I think that the inline hyperlinks look...
We could. I suppose we can also create a special
_rolesor a similarly named folder and to put restricted tags there, if we ever have any.
With the metadata described in https://github.com/python-discord/bot/pull/1539#issuecomment-827060796 we can do role restrictions through an attribute there, as having multiple folders would be a bit difficult to navigate if a tag was both role and group restricted.
I can start working on this if that sounds good.
Are there any group you curre...
I'll wait for the feature to go through then
A point that was made is that it might be simpler to just use hyphens (e.g !dpy-intents), and then no code changes are needed.
The reason this issue was raised is that we've been wary of adding new tags too liberally (for example, recently there was a suggestion for more ToS related tags), fearing too much clutter, and this approach seemed like a solution.
That said, simply using hyphenated names is completely valid as well.
Opinions are welcome.
There could be issues with fuzzy matching if we just use the prefixes so I think fully separating it with non fuzzy matched groups would be a bit easier in the code.
Using the group name to list all tags in that group would also be nice but apart from that I don't think there are UX differences between the two approaches.
Sorry, but I don't think this feature will be necessary as a utility or be much as a fun feature.
I do think the original idea was pretty interesting.
I think this should be done, given that all information is contained within the embed.
Looking good! Apologies I wasn't able to review this earlier I just got the notification that xith requested my review
# Sorts the list of snippets by their match index and joins them into a single message
If I'm not mistaken, this should be fine given the config line below for a max line length of 120.
00bdd6f Filters: hook the new models into the REST API - Akarys42
Implements the new filter related schema described in #479. The definition of each model can be found on this issue.
It adds a bunch of new routes under /bot/filters for each model, for example /bot/filter/filter_lists will provide GET, POST, PUT and DELETE for the FilterList model.
It also adds a migration (number 70) that will convert our current filters to the new schema and set some defaults that should mimic our current setup. Note that it will use a default value if the desc...
Description
There is a grammatical error in the commented part of exceptions.py
Possible Solutions
To reword/fix the comment.
Would you like to implement a fix?
- [x] I'd like to implement the bug fix
- [ ] Anyone can implement the bug fix
Connected!
- Made the line limit 15 (including lines between two snippets)
- Halved the char limit to be 1000
I'd like to suggest before this gets reviewed that instead of halving the limit which may cut off stuff people want to see, if it gets past 1k characters the output is redirect to #bot-commands instead
Relevant Issues
Closes #708
Description
Fixed the grammatical error in the commented part of exceptions.py
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 the [contributing guidelines](https://pythondiscord.com/pages/contri...
You can get None from bot. get_channel if the cache isn't ready yet. Usually this problem is circumvented by awaiting the wait_until_guild_available event on the bot instance.
I don't think you'd receive the message event if the cache wasn't ready yet.
I think this wording is better.
"""Raised when users try to use game commands when they are not playing."""
New version reads good to me. Nice change :)
I like how clear this sounds!
@jb3 Please check
New version reads good to me. Nice change :)
@ChrisLovering Thanks a lot :)
Connected!
5c262a8 Use a specific error message when a warned user... - Akarys42
[python-discord/bot] New branch created: not\-in\-guild\-error\-message
This commit changes slightly how the warn, kick and mute commands to take a fetched member as their argument and to return a little error message if the user isn't in the guild rather than showing the whole help page.
Previously:

(note that help message of the mute command is way longer)
Now:
.
It should be handled by the cog and passed silently.
Sentry Issue: BOT-Z7
When _fetch_response catches an exception, it returns None. The code that uses the response does not check if it's None, leading to the error below. I think it's only used in _snippet_to_codeblock, so a None check in there should suffice.
AttributeError: 'NoneType' object has no attribute 'splitlines'
File "discord/client.py", line 343, in _run_event
awai...
[python-discord/bot] New branch created: bug/info/1553/snippet\-404
Fixes #1554
Fixes #1553
Ignore 404s and avoid returning None as the response when there's an exception.
Are you sure about that? I thought message events are still emitted while the cache is filling?
Yep, message events can still be received before the ready event is received
This docstring seems to be a leftover from copying the cog
"""Cog that allows geting WTF Python entries from the WTF Python repository."""
Docstring mentions a ratio of 90, though the ratio is a global variable and currently 75
"""Returns the fuzzy match of a query if its ratio is above `MINIMUM_CERTAINTY` else returns None."""
A little more detail in this docstring would be nice, seeing how it just repeats the function name
This entire function could be replaced with just a dict.get inside the command itself.
Description
I think that it may be useful to add the normal workflow for features and bug fixes to the Contributing page of the site. This would include something that explain how you should first open an issue, wait to get it approved, and only then you should begin developing.
Reasoning
Many contributors often check the Contributing page and it's subpages to find out what to do when they wish to implement something. This might make...
Relevant Issues
Closes #1547
Description
This PR makes it so that when the bot sends the mod pings off embed, it uses and embed timestamp to show when the role will be given back, so that it can be converted to local readable time, instead of using an ISO format.
##Screenshots

Breaks message length
That should be mentioned in the code then as a comment,
Remember to target the dewikification branch with this pull request
Relates to https://github.com/python-discord/site/issues/449
Once the resources are properly tagged, it would be good to have a filtering system for experience level. This can be done with a dropdown menu next to each section in each resource.
GitHub Actions run 798588109 succeeded.
[python-discord/forms-backend] Checks Successful on PR: #88 Bump python-dotenv from 0.17.0 to 0.17.1
GitHub Actions run 798589177 succeeded.
Connected!
Description
I'll preface this by saying that the command name is subject to change, I don't like the current one (avatarmod) a great deal, but I can't currently think of a better name. Essentially the command would do similar transformations to current commands like spookify, and other commands that play with the avatar image, but in a more convenient way.
Reasoning
It would mean that all avatar imagery stuff was in one place, which would make it easy to just add a new transform...
I'd suggest waiting until https://github.com/python-discord/sir-lancebot/pull/597 is merged and building on top of that :D
Yep, that was my intent, I just wanted to make the issue so i didn't forget :P
Sounds good! Also, hope you didn't mind but I stole the name for the cog already and put it in the PR, since pfp_modify sounded terrible compared to avatarmod :)
2bbbef3 Add non-underscore aliases for lazy people like... - ChrisLovering
Yea, this sounds good to me, after the PR is merged, all of the effects are in the same file too, so should make it easier to get a list of options :)
[python-discord/sir-lancebot] branch deleted: Enforce\-image\-processing\-concurrency
Connected!
embed.set_footer(text="Moderators role has been removed until", icon_url=Icons.green_checkmark)
I'm not sure what other's think, but I preferred the wording you have before, with until here. It adds context to the date.
Would a return type of Union[str, dict] make more sense here?
Out of interest, what was the reason for using error.message here with a noqa, instead of str(error)?
We could also move the current footer to the embed's text, and just have "Until" in the footer.
82d4dd2 Merge pull request #3 from python-discord/main - dolphingarlic
42caf7f Fixed the line limit and halved the char limit - dolphingarlic
9bf55fa Redirect to #bot-commands if the message's leng... - dolphingarlic
c01caf4 Wait for cache to fill before redirecting - dolphingarlic
d3d9e26 Merge branch 'main' into master - ChrisLovering
Connected!
I'm not sure what other's think, but I preferred the wording you have before, with
untilhere. It adds context to the date.
I removed it by accident, my bad.
Whilst I talk about the possible new tag that I suggest should be implemented please do not mistake it for the "!ask" tag, I support that tag being removed and am aware of its flaws. I am saying this due to the fact that during my discussion in the Python Server itself many members were under the impression I wanted to bring said tag back.
The command and the contents it should return.
Command: !help
Content:
Here are the best channels to get help:
If you want to as...
Description
The .issue command should be moved to the .github group, so it would show in the Github cog, and the invocation could be .gh pr.
Reasoning
It makes more sense for it to be in the github group, since this command deals with github, just like .gh repo and .gh user. We could also use root aliases if there would be any confusion with the change.
Would you like to impleme...
Since #597 was merged, I am willing to implement this.
Just adding back until seems ok, on second thought
1761693 Remove dependency on the old system from other ... - mbaruh
Because it wouldn't consist solely of the message
https://github.com/aio-libs/aiohttp/blob/v3.7.4/aiohttp/client_exceptions.py#L87-L92
It's on a separate line cause the noqa wasn't working when it was in the f-string for some reason.
No. Technically JSON is not limited to objects (or arrays) as the root element. Plus it's an internal helper method, so I don't feel being extremely accurate is necessary, especially considering the caller literally has to pass "json" or "text" to the function.
Ah, interesting. Good to know :)
Description
When running .savatar , there was unexpected issue explained below
The image shows the image outside the embed, which is abnormal It happens with Parzivel_1 #4463 can be seen [here](#sir-lancebot-playground message)
Steps to Reproduce
The image should be in the embed.
Expected Behaviour
Note : This is a example how it should be looking like but cannot be seen this when Parzivel is testing it.
...
477a4d7 fix: remove () from list of safe filename chars - vcokltfre
[python-discord/sir-lancebot] New branch created: vcokltfre/fix/avatar\-filenames
Relevant Issues
Closes #712
Description
Removed () from the allowed filename characters since they cause issues in Discord with the file showing outside of the embed.
Before;

After:

Did you:
- [x] Join the [Python Discord Community](...
Looks good, fixes the issue well ๐
[python-discord/sir-lancebot] branch deleted: vcokltfre/fix/avatar\-filenames
Connected!
Connected!
Description
Basically: remove the ability to have multiple issue/pr numbers and add additional info to the embed, such as the issue/pr author, since the automatic linking of issues everywhere (#642) means that it's not necessary anymore to have these commands separate, as they display the same info unless of course that is changed to display more info about it.
Proposed Implementation
I do not have any specific implementation details in mind.
Would you like to implement t...
There are some reddit emojis in the config that I think aren't used anywhere else.
Sentry Issue: SIR-LANCEBOT-4Y
ValueError: empty range for randrange() (10, 9, -1)
(4 additional frame(s) were not displayed)
...
File "bot/exts/evergreen/avatar_modification/_effects.py", line 23, in apply_effect
im = effect(im, *args)
File "bot/utils/halloween/spookifications.py", line 58, in get_random_effect
return effect(im)
File "bot/utils/halloween/spookifications.py", lin...
Closes #687
Continues #688
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
This PR adds the .mosaic command, which splits your discord avatar in the amount of squares you provide, the maximum being 10000.
Screenshots

Did you:
- [x] Join the Python Discord Community?
- [...
Description
Fixed a spelling mistake in the PR template (tempelate -> template). Was discussed here.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this tempelate <- this was the mistake
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read the [contributing guidelines](https://pytho...
Connected!
Tested, this works very well.
82d4dd2 Merge pull request #3 from python-discord/main - dolphingarlic
42caf7f Fixed the line limit and halved the char limit - dolphingarlic
9bf55fa Redirect to #bot-commands if the message's leng... - dolphingarlic
c01caf4 Wait for cache to fill before redirecting - dolphingarlic
d3d9e26 Merge branch 'main' into master - ChrisLovering
[python-discord/bot] branch deleted: bug/info/1553/snippet\-404
197279d CodeSnippets: avoid returning None when request... - MarkKoz
742618f CodeSnippets: use a lower log level for 404 res... - MarkKoz
1d5a01b CodeSnippets: add more detail to the request er... - MarkKoz
41b5c24 CodeSnippets: fix type annotations - MarkKoz
712877f Merge branch 'main' into bug/info/1553/snippet-404 - Xithrius
Connected!
It's not a bug with textwrap.shorten. shorten will truncate the "word" which causes the string to pass the set length. If the only word makes it pass the length, that word will be truncated, and an empty string will be left. So that works as expected.
If there's such a long "word", I feel like showing 300 characters of it is unnecessary. In that specific case ~50 should be enough. I also think your usage of and is a bit obscure here.
I couldn't replicate this on my test bot, could you post a screenshot of it?
It's not a bug with
textwrap.shorten.shortenwill truncate the "word" which causes the string to pass the set length. If the only word makes it pass the length, that word will be truncated, and an empty string will be left. So that works as expected.If there's such a long "word", I feel like showing 300 characters of it is unnecessary. In that specific case ~50 should be enough. I also think your usage of
andis a bit obscure here.At the same time, there should probab...
So, if the sentence is three words (say) in the 300 shortened characters, then we reduce it to 50 characters. Otherwise, keep it to 300 characters (normal length).
I think just making sure it's not a single word is enough. So if shorten gives you an empty string, take 50 chars.
And on this shortened text, we check and make sure it is not more than 3 lines. (Counting the
\n).
yes
Connected!
Connected!
This PR adds a new tag to resources/tags which explains how when coding asynchronously you should limit the amount of blocking calls you make.
Closes:
#1410
dm_content is a better name.
This should not be a many-to-many relationship. It doesn't make sense for a filter to belong to multiple lists. It should be a one-to-many relationship, which is simply defined with a foreign key. Django supports following relationship backwards, if needed.
I'm only reviewing the schema for now.
A mistake you've made is conflating one-to-many relationships with one-to-one relationships. Recall that a foreign key describes the former, not the latter. However, the relationships between settings and filters is one-to-one, as well as the relationship between settings and actions/ranges.
One-to-one relationships are kind of strange to me in the world of database design, since they can be merged into a single table. There are some technical re...
Don't hard-code this. It's like a normal Python enum, so you can do FilterListType(self.list_type) to get the name from the value. If it had labels defined, then, of course, you could use FilterListType(self.list_type).label.
Should look into which indexes will be good to have, but those can be added at any time down the road if it's now still too early to see how the data will get queried by the client.
There isn't actually anything preventing a mute from being permanent at the database level, we simply chose to not expose such a command on the bot side, but it's still possible to edit a mute to become permanent.
Likewise, notes and warnings seem to be marked as permanent, at least on the bot side.
For infraction reasons I believe there are issues with pagination on the bot side when they're too long. I know we limited nomination reasons to 1000 characters, and recall we did something similar with infractions.
For DM's however I agree the limit is probably not 1000.
Is it acceptable to have a field to tell whether it's a channel or a category? I'd rather these weren't split into multiple tables, as then it complicates grouping them on the bot side.
I prefer the latter.
@MarkKoz the guiding principle in deciding where we should split settings, is that columns in the settings table represent entries that can act independently. Splitting the infraction fields and the user DM field will mean, as you mentioned in the bot issue, that we might try to DM a user who has been already banned.
Regarding the overrides, it is possible to handle null values on the bot side and just say it means we should skip this attribute, and then make sure we're not writing null va...
Sorrry, I made a mistake. To be clear, I meant a single table with 2 columns, not a single array.
Yes, I don't see why it wouldn't be acceptable. I don't believe it's possible for IDs to overlap either, if that was a concern.
As for your other point, keep in mind DRF lets you serialise the data in any way you want. It is not limited to being a 1:1 representation of the DB schema. Granted, it's easier when they do align, so the added work and any performance impacts should be weighed in along with the benefit I mentioned in the original comment.
Can this import the infraction model and use its reason limit here instead of having two separate constants that need to be maintained in tandem?
This seems like a good approach, yeah.
I should have said it the other way around. Some infractions aren't meant to expire, like notes and warnings. That's a semantic limitation, not a technical one. However, there is validation imposed that prevents it.
We could allow it here and defer the error to when it actually tries to apply an infraction, but that is a bad idea.
@MarkKoz the guiding principle in deciding where we should split settings, is that columns in the settings table represent entries that can act independently. Splitting the infraction fields and the user DM field will mean, as you mentioned in the bot issue, that we might try to DM a user who has been already banned.
As I mentioned, the JSON schema doesn't have to match the DB schema. Making a split for the reason you mention feels like encoding implementation-specific semantics/detsils in...
Putting everything under settings, and then grouping fields in the JSON schema is fine by me.
An asynchronous program utilizes the `async` and `await` keywords. An asynchronous program pauses what it's doing and does something else whilst it waits for some third-party service to complete whatever it's supposed to do.
I believe we should stick to American spellings
Pydis primarily uses British spelling for things, so that doesn't really make sense
It doesn't really matter as long as its consistent across the body of the text. How the author spells it is how it should be accepted. That being said, I tend to not see programme used in the computing sense, only for something like television programme.
Ah ok then, I'll switch to program, but I'll keep my spelling of utilises
We decided in a staff meeting today that there will be a new command that, for a given off-topic channel, picks a different name from the available pool and deletes the current name from the pool (rather than marking it used). This would be a moderator+ command that lives in the off-topic cog.
Other details of the spec have not been decided on, including:
- The name of the command.
rerollis a contender, though one might not infer that the command both rerolls and deletes. - The argum...
What if we can paginate through the eval command so we can see many more results if the result cant be seen in one page?
What's the justification for needing to see that much code? Put another way, why would one need to execute code that generates more output than can fit in one page? Keep in mind, the command is not meant to be users' personal interpreters.
Connected!
There is no role ID for here though, how do we want to handle this?
It was just a matter of having a little bit more lightweight field, as this is roughly just a boolean field, there are only two states. I donโt mind changing it though.
We usually do that by trying to resolve it as a role and then a user. We cannot run into conflicts this way.
@RohanJnr would like to implement this. I chatted with him earlier, and for now the specification is that !otn reroll n for n in {0, 1, 2}, though keep in mind that it will both reroll the name for that channel and delete the then-current name. The n argument will be optional when evoked in an off-topic channel.
Whoever is knowledgeable about rate limits as they apply to channel renames, I'd be interested to know if this command needs a cooldown.
Relevant Issues
Discussed here.
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
This PR Cleans up sir-lancebot's code, with the help of @vcokltfre.
Changes made in this PR include:
- Change all the type hints of
commands.Bottobot.Bot - Keep all the
setupfunctions' docstrings consistent (Load the x Cog.) - Not s...
5359c1e Updates Home Page Form Entry Expansion - HassanAbouelela
[python-discord/forms-frontend] New branch created: docker\-compose
Could we mention another change of changing all
return await ctx.send(...)
to
await ctx.send(...)
return
await ctx.send(...)
return
I'm not sure why we'd do that, personally I don't see it as an improvement.
[python-discord/olli] New branch created: prevent\-http\-errors
This PR hardens Olli a bit against service failures at Discord.
eca8fe6 Update webhook.py - jb3
384f4f9 Remove whitespace - jb3
dadc6a8 Switch webhooks to using new backoff - jb3
2eea419 Merge pull request #7 from python-discord/preve... - jb3
[python-discord/olli] branch deleted: prevent\-http\-errors
[python-discord/olli] New branch created: prevent\-loki\-cascade
e628e15 Prevent Loki failures from cascading into Disco... - jb3
This PR prevents a failure connecting to Loki from cascading into a failure sending to Discord. When a Loki failure occures and None is returned by get_match then passing it off to the Discord alerter causes attribute errors since it treats it as a match.
[python-discord/olli] branch deleted: prevent\-loki\-cascade
[python-discord/olli] New branch created: version\-0\.1\.2
[python-discord/olli] branch deleted: version\-0\.1\.2
[python-discord/olli] New tag created: v0\.1\.2
I believe I've duplicated all relevant tests now. db5b0751.
The challenge with that is we need to use two items from the target list, for each item of the test_cases. I'm struggling to see how I could solve that with zip. One solution would be to just double the test_cases list, but that would mean the test runner is completely dependent on there being an odd number of cases.
This has been addressed through various other comments, and I believe all the existing text tests have a voice equivalent where relevant.
@MarkKoz it's been a while, but I believe I've worked through all the remaining review comments. There are a lot though, so forgive me if anything got missed.
await ctx.send(...) returnI'm not sure why we'd do that, personally I don't see it as an improvement.
Sorry for the late reply. but when we use return await ctx.send(...) (returns discord.Message) it doesn't return None (which is the annotation for most of the commands which do this), therefore the annotations are incorrect.
This PR adds a new redirect app whose responsibility is ensuring that after Dewikification links still work. I had to create a custom redirect view to add functionality for our use case.
There is possible to define 2 types of redirects: exact redirects and prefix redirects.
There are survival tests for every redirect route that ensures:
- There is only 1 redirect.
- Redirects to the given URL.
- Final destination response code is 200.
Add resources and events app redirects, c...
be9cb47 EH Tests: Created test cases set + already hand... - ks129
8229d21 EH Tests: Created test for CommandNotFound er... - ks129
28e8321 EH Tests: Remove class member cog + other sma... - ks129
3ea33bc Error Handler: Changed CommandNotFound error ... - ks129
28e962b Test Helpers: Added new attribute to MockContext - ks129
[python-discord/bot] branch deleted: str\-join\-tag
Connected!
Connected!
[python-discord/bot] Checks Successful on PR: #1430 Add logging and restart config to docker compose
GitHub Actions run 810022916 succeeded.
Connected!
Exactly what the name is, brought up by Arnav in ot0.
Letโs keep this PR open and add more names on this one.
Letโs keep this PR open and add more names on this one.
I made it a draft to leave it up for discussion
"John Lennon",
"Ringo Starr",
"George Harrison"
Added some famous figures to stars.json
Duplicate of #1561 I think
Closing in favor of #1561. Please add names there.
The Weeknd and Tom from MySpace please
I donโt like Tom from MySpace as he isnโt really a star, I donโt mind the others. Do you wanna add them @dawnofmidnight ?
Description
Since the .quiz command currently only has the "General" category which is pretty much only geography and history questions, we propose to add "Math" and "Science", 30 (or more) questions each which would be randomly picked.
Reasoning
Because it only has "General", and we NEED MORE!
Proposed Implementation
Additional Details
Would you like to implement this yourself?
- [ x] I'd like to implement this feature with the cat dev team
- [ ...
Why do you still pass a bot reference here? It isnโt used anywhere afaik.
I think this is a good opportunity to change all the strings to preferentially use " to go along with the style guide https://pythondiscord.com/pages/contributing/style-guide/#quote-marks
Thanks a lot for doing that, really appreciate it! Just a few things.
Why are you using log.logProcesses here? This function doesnโt appear to even be documented, I assume this is a typo.
This should be promoted to a constant.
Same as previously, the reference to the bot isnโt used anywhere.
Yeah it was autocomplete

Some weird spacing here when the archive get's split into more than one message, wasn't present when it was in just 1 embed. Rest LGTM

Some weird spacing here when the archive get's split into more than one message, wasn't present when it was in just 1 embed. Rest LGTM
I think this is a good opportunity to change all the strings to preferentially use
"to go along with the style guide https://pythondiscord.com/pages/contributing/style-guide/#quote-marks
Did that in https://github.com/python-discord/sir-lancebot/pull/718/commits/a6cc40ff3b323dff112d7f8c339e124f3a6d9980.
[python-discord/sir-lancebot] New comment on issue #719: Add "Math" and "Science" category in \.quiz
Sounds good! I think the Math and Science categories would go well in this server.
[python-discord/sir-lancebot] New comment on issue #719: Add "Math" and "Science" category in \.quiz
How about a programming category as well, since its a programming server? I wouldn't say python specific questions, more general knowledge of programming mixed in with some actual programming techniques.
[python-discord/sir-lancebot] New comment on issue #719: Add "Math" and "Science" category in \.quiz
that's an incredible idea!!
What do you think about adding spaces around the - in the f-strings here? It was a bit confusing to read right now
I realize this isn't in your PR, but doesn't list.index already return an int? Might as well remove this casting to int here.
[python-discord/sir-lancebot] New comment on issue #719: Add "Math" and "Science" category in \.quiz
update: currently have 30 questions in math, 10 questions in science, and 2 in cs. more coming
Noticed a few straggler 's in:
bot/__init__.pyL67, L72bot/exts/evergreen/reddit.pyL87bot/exts/halloween/halloweenify.pyL29, L30bot/exts/valentines/lovecalculator.pyL26, L64, L81, L84, L88, L89bot/utils/pagination.pyL286
This approach does not produce the same result. The strings before the condition get implicitly joined, and the conditional then switches between
f"Invalid genre `{genre}`. "
f"Maybe you meant `{display_possibilities}`?"
and the empty string instead of the previous behavior where it only displayed the invalid genre if there were no possibilities
Proposal
When a duration is specified for !ban like: !ban 3D You are now banned. It will become a temporary ban for the specified duration.
!ban with no provided duration: !ban You are now banned. should still result in a permanent ban.
Reasoning
Myself and other moderators will sometimes be typing out the ban when we realize we want it to be a tempban. We then need to backtrack and change it to tempban, which is a nuisance.
Additionally, the !mute command works with a ...
Closes #1563
Apply temporary ban if duration is specified while banning a user.
Screenshots
Applying a ban with duration

Proof in #all-logs

Earlier it used to send a 404 HTTPError since the equipment was set as outfit and outfit as equipment.
{"detail":"Invalid option provided: lightsaber.png not found."}
hey so like thanks ducks wont be fucked now
@Numerlor I'm curious if you still plan on (or already are) working on this.
@Numerlor I'm curious if you still plan on (or already are) working on this.
I have it mind, but haven't worked on it beyond some experimenting with the previous PR. It'll be a bit before I can fully pay attention to figuring out how to make this work nicely so anyone's free to pick it up if they want to
Hi! Thanks for your contribution.
- Standard server icons should use our regular blurple colors, and the icon must match the relative size of all the existing animations (this one is much smaller). Only special events should use other colors.
- Text is usually a bad idea for a server icon. It's not going to be possible to read any of this stuff at a small resolution.
- The snakes are not aligned correctly in the final frame, and the final frame must always look the same as the first fram...
You must consider it in the context in which it will be displayed. It'd be too small to make out most of what's going on.
That being said, I do think the idea of an animation from the logo to some code and then back to the logo is promising. However, it may need some additional "twist" to make it more interesting than just rendering some lines of code.
There's lots of dead space in the current animation, which would have to be filled in. Since it'd be too small to make out details, the code...
It is pretty common for us to run the !unban command with a reason at the end, that is currently just silently ignored, causing a loss of information on the long term. The command should accept this argument and append **Unbanned:** {reason} to the end of the active ban infraction.
Docstring should be updated to correlate with this new feature. Using the ban command will not always end up as a permanent ban.
Yes, i know that was only a little example, i just tried something and not the final animation.
Author will not be able to complete tag. This PR is now up for grabs. Ask a core developer if you'd like to take over.
I still donโt like the use of things here. Perhaps object is a better word?
This snippet could get more explicit variable names too, it is a bit hard to follow right now. Also using the integer 420 would be less noisy than [1, 2, 3] and keep the same behavior.
I think there's merit in using specifically lists, as it is something that confuses a lot of people.
For integers and strings this works only if the value is cached and shouldn't be relied on.
I've kept it using the list given what zig said
be9cb47 EH Tests: Created test cases set + already hand... - ks129
8229d21 EH Tests: Created test for CommandNotFound er... - ks129
28e8321 EH Tests: Remove class member cog + other sma... - ks129
3ea33bc Error Handler: Changed CommandNotFound error ... - ks129
28e962b Test Helpers: Added new attribute to MockContext - ks129
5312544 Add the ignore update merged option to tag spee... - Akarys42
[python-discord/.github] New branch created: tag\-speedrun\-ignore\-update\-merged
[python-discord/bot] branch deleted: is\-vs\-==
Connected!
#698215203740975144 message if it's useful for investigation
We'll merge this for the time being, should be fixed in Reddit migration to Sir-Lancebot.
Connected!
It looks good in the context of the issue, though it creates inconsistency with pban and vban
Hi! This is a request for this PR. Totally 1000% is this request is out of scope for this PR though.
Could we have an option to essentially allow !clean user <id> 30M which would clean a users messages from all channels. It would only target messages that have been made during the specified duration. So in the example here, it would clean all the messages the user has posted in the past 30 minutes from all channels.
I can provide reasoning for this here or in the mod channels if you pre...
Proposal
- Currently
!pbancan be provided a duration to specify how many days of messages to purge (ranging from 1 to 7) with the default being 1 day. I don't think we have every actually used a duration other than 1 day, which is the default. - In the spirit of consistency, we would like the option to pass in a duration for allow tempbanning of the person in addition to purging messages.
- So we want to remove the purge_days argument (always make it purge 1 days work of messages) and...
[python-discord/sir-lancebot] Pull request opened: #720 Add a 5 second cooldown per user to \.catify
Relevant Issues
Discussed here.
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
This PR adds a 1 use every 5 seconds cooldown per user to the .catify command to avoid spamming it.
##Screenshots

Did you:
- [x] Join the [*...
Connected!
i'd suggest using the self._fetch_member() function here, to get the a new member object, since we don't have the member intent enabled, the cache doesn't have an updated version of the avatar.
You can use this new member object in the rest of this function then, replacing ctx.author.
Maybe throw in a colour here to to make the embed nicer? :D
Connected!
a2059de chore: Redirect output to bot-commands channel ... - ToxicKidz
ded578e fix: Add a missing return statement - ToxicKidz
0fa28ac chore: Don't send a message when redirecting ev... - ToxicKidz
91cd758 Merge branch 'eval-redirect-output' of https://... - ToxicKidz
f1e2692 Merge branch 'main' into eval-redirect-output - ChrisLovering
Connected!
We will need a cool down, we can edit the channel 2 times before we hit a 10min rate limit cooldown.
The command can have a cooldown of 5min to avoid the rate limit.
description=f"```{user_data['bio']}```\n" if user_data["bio"] else "",
Might as well go with implicitness here as it seems like what's done generally in this repo
I think this docstring should be changed, "opens an error" doesn't sound right
This import could just be from discord.ext.commands import BucketType...which would mean we might as well just use commands.BucketType.x because we've imported commands.... not sure about what to do here, you can decide whether to change it
Connected!
The .keys here is unnecessary
This docstring hasn't been updated.
Should "Earth" be capitalized because it's a proper noun?
Do we want the cooldown for the entire command or do we want the cooldown per channel?
It does return a list, so I'll just change the return annotation to List[Dict[str, Any]].
@RohanJnr whichever count cooldown pertains to.
Description
Since both the ping and uptime commands are a similar 'category' of command it would make sense to merge both into one file/cog, this should be a simple change and there is no additional context.
Reasoning
The reasoning is to make the code more concise and navigable.
Would you like to implement this yourself?
- [x] I'd like to implement this feature myself
- [ ] Anyone can implement this feature
8e4d2fc feat: merge ping and uptime cogs - vcokltfre
[python-discord/sir-lancebot] New branch created: vcokltfre/feat/ping\-uptime\-merge
Relevant Issues
closes #721
Description
Both the ping and uptime commands have been merged into a cog called "ping" which I believe is the most fitting name for it, though if there is a better name I am open to changing it. This has been tested locally and is working correctly, though of course anyone reviewing should see for themselves.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
-...
There is also a rather large diff on bot/exts/halloween/hacktober-issue-finder.py; have you tested this? (is it possible to be tested now, when it's not-hacktober)
return await resp.json()
log.error(f"no issues returned by the GitHub API, with url: {response.url}")
await ctx.send(f"ERROR: no issues returned by the GitHub API, with url: {response.url}")
return
I think we can merge the text here and just send one message; and just do a return instead of explicitly return None to stay consistent with how it's used in the rest of the codebase
I agree with the first part, but if the function is meant to return something, so we should explicitly return None,
Plan 1 to handle rate limits.
Store the number of times an off-topic channel has been edited as times_edited and also the datetime instance for the last edit
data structure:
{
channel_id: {
"times_edited": int,
"last_edit": datetime
}
}
or the above can be done using a Class ( I have not decided which one I want to use yet).
Conditions before editing a channel via the reroll command or the daily channel name updater task,
- if...
@Shivansh-007 discussion for this issue is now closed, you are free to work on this issue if you still want it.
Noticed you'd moved to using pathlib in some other places, so let's do it here (and on L35) too. (nice variable name here ๐ค )
Doesn't let me comment there, but change L22 to be of the same format as everywhere else;
with Path("bot/resources/pride/drag_queen_names.json").open("r", encoding="utf8") as f:
Looks like random.choice is used to retrieve items from this list anyways, so there isn't any reason to shuffle this as well
If you go with plan one, can you store that information in an async redis cache? How will you handle the daily non-deleting rerolls (since those also count towards the rate limit)?
If you're worried that plan one would slow down development too much, you can go with plan 2 for now and we can plan to migrate to plan 1 later. The underlying logic for the actual deletion-reroll should be unaffected.
if role not in ctx.author.roles:
Was this meant to be "Arguments must be non-empty string."?
[python-discord/sir-lancebot] New review comment on pull request #583: Add the stackoverflow command
Can we type hint to bot.Bot here? Also in the setup function.
This is a great command, thanks! Just a couple of suggestions
[python-discord/sir-lancebot] New review comment on pull request #583: Add the stackoverflow command
from discord import Embed, HTTPException
instance: Optional[Callable] = None,
timeout: Optional[int] = None,
ctx: Optional[commands.Context] = None,
scheme: Optional[str] = None,
unit_count: Optional[Dict[str, int]] = None,
time_start: Optional[datetime.time] = None,
is_first_error: Optional[bool] = None
Nitpick
if word not in cache:
instance: Optional[Callable] = None,
word: Optional[str] = None
To make this consistent with other commands, please make purgeban not take any argument for purge days, but instead take only ban days. If time exists, don't permaban.
Please also do the same thing for voiceban, where if a time is supplied, it won't be permanent.
How will you handle the daily non-deleting rerolls
I did mention it as daily channel name updater task.
@Shivansh-007 discussion for this issue is now closed, you are free to work on this issue if you still want it.
Sure, I will implement this feature according to the discussion we had here and in #dev-contrib.
[python-discord/sir-lancebot] New review comment on pull request #583: Add the stackoverflow command
Reddit comments emoji can be used for this.
[python-discord/sir-lancebot] New review comment on pull request #583: Add the stackoverflow command
nitpicking
"time. If this issue persists, please contact the staff or send a message in #dev-contrib."
[python-discord/sir-lancebot] New review comment on pull request #583: Add the stackoverflow command
This is against the code style we follow on python discord which can be viewed here.
Nitpicking, but am not a fan of this color, we can probably keep it the default color (even 8bitify uses that).
Noticed a few straggler 's in:
bot/__init__.py: L72bot/exts/evergreen/snakes/_utils.py: Starting 20 lines
Noticed a few lines which don't follow our codestyle:
bot/exts/christmas/advent_of_code/_cog.py: L75, L78, L113bot/exts/christmas/hanukkah_embed.py: L20, L67, L72, L95, L100bot/exts/evergreen/cheatsheet.py: L64, L69bot/exts/evergreen/connect_four.py: L280bot/exts/evergreen/game.py: L339bot/exts/evergreen/movie.py: L82- `bot/exts/eve...
Another thing I'd forgotten to comment last night; as we've changed all the commands.Bot type hints to bot.bot.Bot, you can also probably change the type hints for commands.Command to bot.command.Command as we seem to be using a subclass which allows root aliases.
Tested as well as I could, seems to work well :thumbsup:
In #718, all commands.Bot type hints were changed to Bot from bot/bot.py; we should probably use that here (and in the setup function L143) too to stay consistent
Description
When giving argument python in subcommand get of command snakes, bot returns Wikipedia page of Python programming language instead of returning result related to python snake.
Steps to Reproduce
Type .snakes get python
Expected Behaviour
An embed which contains information about Python snake retrieved from Wikipedia.
(Not including link of most suitable Wikipedia page but can be found by using a search engine with keywords python genus Wikipedia)...
So we already have the help channel DM's that sends the user a DM whenever they claim a help channel. But why not also send a DM to the person who is helping in the channel as well. We could also make this toggleable just incase someone doesn't want to receive the DM's.
Two things. 1) what kind of information would you want to put in this DM? Is there something specific? 2) How would you know if someone is helping in that channel? It's not uncommon that someone might ask the opener about something to clarify, and then they leave the channel since they don't know.

so something similar to this, but it would probably not have the "your message", and the title and description would need to be changed. And for your second question, maybe we could have a command that the person who is helping can use for example something like !remember or something like that, and it would only send the user the DM if they type that command.
Also I would be happy to try to implement this by myself but I will see since I haven't really worked with this repo before.
[python-discord/sir-lancebot] New comment on issue #719: Add "Math" and "Science" category in \.quiz
update: currently have 30 questions in math, 30 questions in science, and 16 in cs/python. also did a revamp of the original code so it's compatible with image urls, multiple possible answers, etc.
Hi! Would it also be okay to have it as Optional[Callable] instead?
wrapper does not return a callable, command_wrapper does.
Wouldn't this be a nice place to use collections.Counter?
Pylance complains: can't assign str | None to str in __init__ (__init__ of the Cache class does not expect the argument to be None)
"""Load the Poem Generator cog."""
The docstrings for the setup function have been made uniform across the repo in #718 , let's follow that here.
Oh, and probably a good idea to re-raise the error if it wasn't one of the errors we're specifically handling
I'm assuming setting error.handled = True marks the error as handled so the global error handler do anything about it.
Ah right, didn't realize that
I am not sure if this is actually required. Cuz some help channels only last for a few minutes and it could easily get annoying if a user is involved in multiple help channels.
That's why I think it would be smart to have it as a command so it's optional but if you don't think it's necessary then I respect that 100%.
Looks good, tested locally too!
Tested and works well, except for one small issue.
if 1 <= squares <= MAX_SQUARES:
raise commands.BadArgument(f"Squares must be a positive number less than or equal to {MAX_SQUARES}")
if not math.sqrt(squares).is_integer():
raise commands.BadArgument("Squares must be a perfect square")
The "less than max squares" check should be done before the perfect square check, to avoid computing the root of any unnecessarily large inputs
Suggestion: What do you think about setting squares to the next greatest perfect square, if the inputted number wasn't a perfect square?
425b4f1 Prevent accidental addition of users to talentpool - SebastiaanZ
[python-discord/bot] New branch created: sebastiaan/prevent\-accidental\-addition\-talentpool\-cache
Bug Description
When asking for a review for a user that isn't currently nominated using the !talentpool get_review command, the user is added to the talentpool watched_users cache, causing their messages to be relayed to the talentpool watch channel.
Steps to reproduce
Use !talentpool get_review , where `` is the ID of a user with no active nomination. The command will correctly reply that the user does not have an active nomination, but their ID will nonetheless be added a...
That's one deadly bug right here. Thanks seb!
Why make ot_channel_index optional if we're gonna raise an error if it wasn't passed?
If it is invoked in an OT channel then it will reroll that channel's name.
[python-discord/bot] branch deleted: sebastiaan/prevent\-accidental\-addition\-talentpool\-cache
smart, didn't notice that part
Connected!
Its still draft ๐ฌ but thanks for reviews.
Hi! I designed a 8 bit version of lemoji, I was wondering if it would be added to the server!
Idk why, I just thought pixel art looked tacky
- Cat
I like the idea of a pixel art emoji. It's fun; let's do!
(Cat, who opened the issue, is working on it in #media-branding)
I still think you should slice before counting lines, but regardless you should probably add cases for the 50 chars and the 3 lines scenarios.
Connected!
Connected!
In #718, all commands.Bot type hints were changed to Bot from bot/bot.py, we should change the type hint here and in the setup function.
You're still going over the character limit for commit titles :)
Keep them concise. Any details of context or reasoning can go into the body.
[python-discord/bot] Checks Successful on PR: #1430 Add logging and restart config to docker compose
GitHub Actions run 820242289 succeeded.
Connected!
Same as ban but removes all their messages of the last 24 hours.
"Current day" can be misleading.
If duration is specified, it temporarily bans that user for the given duration.
If duration is specified, it temporarily voice bans that user for the given duration.
GitHub Actions run 820267088 succeeded.
GitHub Actions run 820277305 succeeded.
GitHub Actions run 820277304 succeeded.
Did test the others, missed out on this one.
GitHub Actions run 820672698 succeeded.
GitHub Actions run 820674990 succeeded.
GitHub Actions run 820680466 succeeded.
cf110bc feat: Add the .mosaic command - ToxicKidz
544a05b chore: Fetch the member and use Colours.blue in... - ToxicKidz
390c053 chore: Prefer double quotes over single quotes - ToxicKidz
f6175b5 chore: Use the name AvatarModify instead of Pfp... - ToxicKidz
d964a03 Merge branch 'main' into feat/mosaic-command - ToxicKidz
Connected!
Description
Fixes the check on the .mosaic command, which is missing a not.
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 the contributing guidelines?
Connected!
This can be an opportunity to add some more related tests, but you don't have to.
[python-discord/sir-lancebot] New branch created: change\-to\-fetch\-user
Description
This is because discord.py would populate the user portion of the fetched member with cached information which would cause the avatar url not to be updated as we had intended with that function.
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 the [contributing guidelines](https://pythondiscord...
[python-discord/forms-frontend] New branch created: codemirror
async def _fetch_user(self, user_id: int) -> t.Optional[discord.User]:
e929d6b Update return type hint to reflect new behaviour. - ChrisLovering
CodeMirror 6 is currently the only editor with responsive support, this is the reasoning for using the beta. Currently, this has hard-coded Python, in the future, we can add more languages, but this is not critical right now.
1750932 Scheduler is an instance instead of subclassing - mbaruh
be9cb47 EH Tests: Created test cases set + already hand... - ks129
8229d21 EH Tests: Created test for CommandNotFound er... - ks129
28e8321 EH Tests: Remove class member cog + other sma... - ks129
3ea33bc Error Handler: Changed CommandNotFound error ... - ks129
28e962b Test Helpers: Added new attribute to MockContext - ks129
I think that this can't be used anywhere else so I'll just leave it.
It is gradually becoming a more common pattern to use a combination of the Scheduler class with an async redis cache to persistent scheduled tasks across restarts. Both a Scheduler and a redis cache are initialized in a cog, and there's a function to reschedule tasks on load. It is currently used in the ModPings and Stream cogs, and I foresee it being used in a couple more places in the near future as well.
I created a class that abstracts that combo away, to create the interface of a ...
Relevant Issues
Closes #719
Description
PART ONE:
After gathering a database of questions and answers, I incorporated them into the json file. Some questions requiring images are supplemented with an "img_url" entry, and some requiring dynamic generation (e.g. Math Q1, a random system of linear equations with two unknowns) have an "dynamic_id" entry, which will come into use later.
[PART TWO](https://github.com/Objectiviti...
converting to draft because i have to fix some linting fails
GitHub Actions run 821065726 failed.
GitHub Actions run 821068761 succeeded.
GitHub Actions run 821076896 succeeded.
REGARDING THE CS AND PYTHON QUESTIONS:
We... just didn't get that much questions, so I didn't add them into the database. Our list can be found here https://docs.google.com/document/d/1qIbapQUMLD40s5yzrqXZ7n0-6p1z3azpz1O_rPOWTv4, and once we get 30 questions on each I might open a new PR
GitHub Actions run 821111890 succeeded.
GitHub Actions run 821115327 succeeded.
GitHub Actions run 821115328 succeeded.
The lack of a newline makes Discord ignore bot.exts.moderation.modlog. This bug also shows itself while displaying the failures in batch_manage.
This prevents embeds from looking like this:
when a user edits a message with the content
a\`\`\`
b
\
`\`\`
Connected!
Could be a pattern constant IMO like we do in other parts of the repo.
Since you've written this, I wonder if the duckpond cog can be refactored to use it?
I'm really not sure about this section. If you know that you're holding the last message, why not iterate over the messages before it until the API call limit and breaking upon an unrelated message?
I actually think it's safe in that channel to just not have a limit.
What you wrote here is an async for over the message history starting from message with no limit, with the timedelta being a breaking condition.
ea900a4 (infractions): Apply tempban if duration is spe... - Shivansh-007
9c3ef7c (infractions): Remove purge days & add duration... - Shivansh-007
3272605 (infractions): Apply temporary voice ban if dur... - Shivansh-007
ce1fd8e (infractions): Modify voice ban tests according... - Shivansh-007
d47dca4 Apply request grammar changes. - Shivansh-007
This can be an opportunity to add some more related tests, but you don't have to.
Tests for the new feature I added in this PR, or the complete pban and ban command?
Connected!
Connected!
Yep, except that it doesn't do unnecessary API calls by deferring the breaking condition to Discord
Probably, although that would be pretty much out of scope for this PR wouldn't it?
I'll still approve regardless of this, but I try to apply relevant changes whenever I add a utility function like that. No one will think to PR it separately afterwards.
For what you added.
Alright, I will do that.
Alright, should be good then.
28a2862 Block Sentry Action For Dependabot - HassanAbouelela
You should use subtests here. You'll find an example in the test module's README.
Was this addressed? doesn't seem so.
This channel will be like this for a while
[python-discord/bot] New branch created: extract\-metabase\-data
Metabase generates report from site and metricity data. Quite often we export these reports to csv, transform them and the pipe into an int e.
This cog aims to reduce the time taken for that, by giving admins the ability to export data from a report directly into a hastebin.
The auth flow is cached, as the login endpoint is ratelimitted. We want to ensure that we use a valid session token until it expires to reduce the number of calls to this endpoint."
I think overall the tests look ok. I probably wouldn't use dictionaries to define test cases (there's always the option of just using tuples and unpacking the items in the subtest loop). I think some of the docstrings could be improved both in terms of grammar and content. Keep in mind that the docstring summary is shown to the user if the test fails, so it's fairly important that it manages to explain what exactly is not working as expected. Having the test break and fail to explain why is f...
[python-discord/bot] New review comment on pull request #836: Tags cog unit tests and tags cog fixes
This change may no longer be necessary after 688908d1d996708525b9125a20e7c72b4413b252, what do you think? That commit was already merged into your branch, and adds the same kv pair below.
[python-discord/bot] New review comment on pull request #836: Tags cog unit tests and tags cog fixes
I'm guessing from_dict is used because you cannot pass the footer text to the embed constructor. An alternative approach would be to build the embed before the list, though this is probably ok.
[python-discord/bot] New review comment on pull request #836: Tags cog unit tests and tags cog fixes
I'm not sure what the difference between these two is, and why one is easier to test than the other (based on the commit message that adds this diff). Would you be able to expand on that please?
You're right, zip won't work. What's needed is a Cartesian product (itertools.product). Up to you if you want to make that change.
Looks like you are correct. You're talking about this, right? https://github.com/python-discord/bot/pull/1297/files#diff-f64697ccedd0a53137e360dba5f9f39c7f7a7b2fa76e29153024d1eb7a1d51c0R228
Other than the redaction, this looks good and works locally.
Yeah that's the one. The if statement right below it switches the message.
That does help with the nesting, thanks. 27223522
6a8d1ed Bump url-parse from 1.4.7 to 1.5.0 - HassanAbouelela
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/url\-parse\-1\.5\.0
[forms-frontend] Branch dependabot/npm\_and\_yarn/url\-parse\-1\.5\.0 was force-pushed to `52e7a27`
[forms-frontend] Branch dependabot/npm\_and\_yarn/url\-parse\-1\.5\.0 was force-pushed to `2db665b`
2db665b Bump url-parse from 1.4.7 to 1.5.1 - HassanAbouelela
