#dev-log
1 messages ยท Page 54 of 1
I wanted to say that it may make more sense to check whether the ID matches the configured PyDis ID, but in practice it probably makes no difference.
Build 20201001.8 succeeded
Requested by
GitHub
Duration
00:01:05
Build pipeline
Seasonal Bot
The BotSource cog has some special handling for Alias that won't be needed anymore.
Should we remove it too?
Build 20201001.4 succeeded
Requested by
GitHub
Duration
00:02:49
Build pipeline
Bot
[python-discord/bot] branch deleted: bug/backend/1181/wait\-for\-deletion\-404
I tried to look through history to see if the context in the docstring ever referred to an actual name, but it doesn't seem to be the case. Either way, that's fine, just something I noticed.
Build 20201001.5 succeeded
Requested by
GitHub
Duration
00:04:27
Build pipeline
Bot
Connected!
Build 20201001.9 succeeded
Requested by
GitHub
Duration
00:01:03
Build pipeline
Seasonal Bot
Using apply_infraction from InfractionScheduler rather than doing it manually allows us to handle HTTP errors while reducing code duplication.
Specifically, discord.Forbidden is handled when the bot tries to superstar someone they do not have permissions to.
This should address #905. There's only one instance of it unhandled on Sentry (which this PR fixes), and other potential places with discord.Forbidden is also handled in their respective cogs. Therefore, there is no need t...
Description
This proposes porting the CustomHelpCommand class from the server's Python Bot. This would mean either replacing the current implementation for SeasonalBot or extending it to fit the port.
Reasoning
Most command groups often make use of ctx.send_help like .snake or .cogs which don't utilize the help embeds. A common pattern that's used for...
Build 20201001.8 succeeded
Requested by
GitHub
Duration
00:02:51
Build pipeline
Bot
Build 20201001.7 succeeded
Requested by
GitHub
Duration
00:03:00
Build pipeline
Bot
Build 20201001.9 failed
Requested by
GitHub
Duration
00:00:56
Build pipeline
Bot
I aproof this, even though i don't know what the integration intent is.
@thomaspet Next time when you don't understand thing fully, don't approve it, please.
@thomaspet Next time when you don't understand thing fully, don't approve it, please.
We don't use on_guild_integrations_update, so I don't need to know what it does. The comment is a slight joke.
Build 20201001.10 succeeded
Requested by
GitHub
Duration
00:00:58
Build pipeline
Seasonal Bot
Build 20201001.11 succeeded
Requested by
GitHub
Duration
00:00:57
Build pipeline
Seasonal Bot
Cool! Can I try this one?
Sure, go for it! If you have any issue, you can always ask us at #dev-contrib.
Build 20201001.12 succeeded
Requested by
GitHub
Duration
00:00:54
Build pipeline
Seasonal Bot
I have quickfix for this can I work in this issue too
27bd1a3 Authenticate GitHub API requests for the Hackto... - Den4200
Build 20201001.13 succeeded
Requested by
GitHub
Duration
00:03:10
Build pipeline
Seasonal Bot
Connected!
Build 20201001.10 succeeded
Requested by
GitHub
Duration
00:02:47
Build pipeline
Bot
This seems a bit over engineered imo.
valid_zodiac_name = ", ".join(self.zodiac_fact).replace("Leo, ", "Leo,\n")
Quick and dirty, given Leo is always written this way, and contains a space. So if it somehow ends up at the end it breaks.
So a better solution might just be to go by index
", ".join(names[ :len(self.zodiac_fact) // 2]) + ",\n" + ", ".join(names[len(self.zodiac_fact) // 2: ])
This can be written a bit cleaner with 2 variables for first and last part and add them afterwards.
[python-discord/bot] branch deleted: bug/fun/1183/pond\-ignore\-dm
Build 20201001.15 succeeded
Requested by
GitHub
Duration
00:00:52
Build pipeline
Seasonal Bot
Build 20201001.11 succeeded
Requested by
GitHub
Duration
00:04:46
Build pipeline
Bot
Build 20201001.14 succeeded
Requested by
GitHub
Duration
00:01:48
Build pipeline
Seasonal Bot
Connected!
Did you read the message, or just click merge? It's a dirty solution that will break if the order of the keys ever change, or the way they are written. It's pretty error prone.
Build 20201001.12 succeeded
Requested by
GitHub
Duration
00:02:47
Build pipeline
Bot
Did you read the message, or just click merge? It's a dirty solution that will break if the order of the keys ever change, or the way they are written. It's pretty error prone.
I just read the code and clicked commit ๐ , just noticed u have written something at comment also
[python-discord/bot] branch deleted: feat/backend/1159/remove\-alias\-ext
Closing because the cog was removed in #1159/#1198
Closing because the cog was removed in #1159/#1198
Build 20201001.13 succeeded
Requested by
GitHub
Duration
00:04:39
Build pipeline
Bot
Connected!
As @Numerlor said, we can just wait for Python 3.9, there isn't really any urge for it right now.
The selection of intents you've disabled looks reasonable.
I've looked for status, raw_status, and activities attribute access and couldn't find anything else, so you seem to have it covered for the most part. However, you need to adjust on_member_update in the stats cog since it is keeping track of presences.
Moving this to the site repo, since that is where the rule text is stored.
When using !rule 6, the embed contains the string #python-general as a reference to the channel. Let's make it a link.
In #rules, it's already a link.
Build 20201001.16 succeeded
Requested by
GitHub
Duration
00:00:58
Build pipeline
Seasonal Bot
Sounds nice. Will the descriptions be written and stored in the bot, or will they be fetched from GitHub? In the case of the latter, it may be preferable, but I'd rather not overcomplicate things for such a simple feature. Unless it's a simple unauthorised request to get the description, I don't think we should fetch them from GH.
For some reason I feel seasonalbot had a similar feature actually. Can anyone confirm or deny?
[python-discord/bot] New comment on issue #1177: Bug: \` chars are not escaped when parsing \!source
It's safe regardless because of the "allowed mentions" feature. We have to explicitly allow mentioning a certain role when sending a message. The only ones whitelisted by default are mod+ roles (which users can mention normally anyway).
In any case, markdown should be escaped just for the sake of readability.
How do you propose I do it @MarkKoz?
Remove it completely? Fetch invite and just update online/offline?
Probably has to be gutted. I don't think the event will even be dispatched for status updates if the intent is disabled. Besides, doing an API request (to fetch an invite) so frequently doesn't sound good. That being said, you may be able to fetch the invite and poll periodically. @jb3 may have more to say.
The stat breaks anyway since the reporting is often incorrect.
I think it is a nice stat to have, so periodically polling the invite every 10 minutes or something feels pretty okay and is well within the ratelimits.
I think this should be inside Markdown files in bot repo and these should be loaded on startup.
I've needed this before. If the VC gets into a heated argument very few people are going to pay attention to #voice-chat, and I've historically had to ping several of the users and wait for them to respond to that. While I could manually go about server muting them, it would make more sense to have something to do that automatically.
I think there should also be consideration for drawing a users attention. The !shh command immediately draws attention because all conversation stops and it'...
[python-discord/bot] New comment on issue #1177: Bug: \` chars are not escaped when parsing \!source
I can work on this, can I get assigned?
Build 20201001.1 succeeded
Requested by
Joseph Banks
Duration
00:04:34
Build pipeline
Site
Connected!
Thank you for contributing to Python Discord!
Please check out the following documents:
- Join the Discord server! - If you have not already, join the Discord server and introduce yourself in our #dev-contrib channel.
- Python Discord Contributor Wiki - A set of resources about setting up our services
- Python Discord Code of Conduct - Code of conduct for our commu...
Build 20201001.14 failed
Requested by
GitHub
Duration
00:00:52
Build pipeline
Bot
Build 20201001.15 succeeded
Requested by
GitHub
Duration
00:02:29
Build pipeline
Bot
I can work on this. can I get assigned?
this should be pretty easy, just replace this line:
description=f"Link",
with this line:
url=f"{self.base_pep_url}{pep_number:04}"
Thank you for contributing to Python Discord!
Please check out the following documents:
- Join the Discord server! - If you have not already, join the Discord server and introduce yourself in our #dev-contrib channel.
- Python Discord Contributor Wiki - A set of resources about setting up our services
- Python Discord Code of Conduct - Code of conduct for our commu...
Build 20201001.16 succeeded
Requested by
GitHub
Duration
00:02:47
Build pipeline
Bot
Hey!
This issue still persists and I can work on it.
Can I get assigned?
Thanks
The reason why this happens is because our index page is actually private. Therefore the wiki system does not expose private pages and hides it.
If you visit a page like https://pythondiscord.com/pages/code-jams/code-jam-7/ then you will see the breadcrumbs are correctly filled in, even when the user is not authenticated.
I'm not sure whether we should consider this a bug, since we hope to have a site index at some point in the future which will resolve this issue when the index becomes...
@Akarys42 Sounds nice
I wonder though if we'd like to take a step further and allow interleaving code blocks and text. This would allow you to do something such as:
!e
This is how you assign:
```py
x = 1
```
And then you can print it:
```py
print(x)
```
By concatenating the code blocks and then running it as usual. This should still be a fairly simple change, and it would include your idea as a private case.
If that's good then I wouldn't mind writing it.
Quickly done and works quite nicely! If you're unsure about any of my comments, feel free to ask here or on Discord. I'm happy to see you contributing!
@staticmethod
async def fetch_data(url: str) -> dict:
The method isn't using the self attribute and can therefore be a static method.
embed.add_field(name="Followers", value=f"[{user_data['followers']}]({user_data['html_url']}?tab=followers)")
embed.add_field(name="\u200b", value="\u200b") # zero width space
embed.add_field(name="Following", value=f"[{user_data['following']}]({user_data['html_url']}?tab=following)")
embed.add_field(name="Public repos",
value=f"[{user_data['public_repos']}]({user_data['html_url']}?tab=repositories)")
embed...
return await ctx.send(embed=discord.Embed(title=f"The profile for `{username}` was not found.",
colour=0xff0022))
Added period and slightly altered the sentence.
Build 20201001.17 failed
Requested by
GitHub
Duration
00:00:24
Build pipeline
Bot
Thank you for contributing to Python Discord!
Please check out the following documents:
- Join the Discord server! - If you have not already, join the Discord server and introduce yourself in our #dev-contrib channel.
- Python Discord Contributor Wiki - A set of resources about setting up our services
- Python Discord Code of Conduct - Code of conduct for our commu...
This really isn't worth a PR. The existing line gets the point across absolutely fine.
Build 20201001.2 succeeded
Requested by
GitHub
Duration
00:02:14
Build pipeline
Site
Relevant Issues
Closes #171
Description
I've created a Cog (SaveThePlanet) and a JSON file (save_the_planet.json).In the setup method, the JSON is loaded and turned into a discord embed object from the dict. Then the embed objects are added to a global list of embeds. The Cog has a command (.save_the_planet) to respond with a random one of those embeds.
Reasoning
I think this imple...
Build 20201001.18 failed
Requested by
GitHub
Duration
00:00:50
Build pipeline
Seasonal Bot
Build 20201001.19 failed
Requested by
GitHub
Duration
00:00:52
Build pipeline
Seasonal Bot
Description
Right now, we have at least 2 commands, #464, and .hacktoberstats that take an argument which is a discord username. We should make a function in bot/utils to get a user's GitHub account if it is linked to their discord. So that the user doesn't need to type that extra argument.
Reasoning
It would make using commands like #464 or .hacktoberstats better, because the user would just have to link their GitHub account to their discord, and then when they don't e...
Can I get assigned to this?
The suggestion u propose also require one step and and with command also user need to do one step in order to link ,I don't think it will make huge difference
It isn't really possible to get discord connections without OAuth2 afaik, and for that we'd need to set up site for that beforehand and quite frankly am not sure if it's worth it as for many people it would be faster to type the command than to go through process of OAuth2
Postgres backup completed!
I use return to "end" the command there since if user_data has a message key, it means that the user doesn't exist and user_data won't have any of the other keys I use further on and so instead of having to handle KeyErrors I just used return
for bot/exts/info/information.py, flake8 said that the line length was too long so I had to re-wrap the lines because of the spelling change formated => formatted.
I hope having the commits on master was fine because they are really just minor changes
Thank you for contributing to Python Discord!
Please check out the following documents:
- Join the Discord server! - If you have not already, join the Discord server and introduce yourself in our #dev-contrib channel.
- Python Discord Contributor Wiki - A set of resources about setting up our services
- Python Discord Code of Conduct - Code of conduct for our commu...
Build 20201002.1 succeeded
Requested by
GitHub
Duration
00:02:49
Build pipeline
Bot
This might be redundant since those lines don't really take a long amount of time to execute and we might not see the bot typing for a time period large enough to notice, if at all. That said, this is definitely a cool addition and I'll add it anyways
Also, inline comments should be used sparingly.
Oh okay, I'll do this. It's just that I don't have a habit of commenting code and this is a first for me, I always thought that open source projects are "heavily" commented
hey, i am ew were can u tell me what to do?
Build 20201002.2 failed
Requested by
GitHub
Duration
00:01:42
Build pipeline
Bot
b87f316 Add missing blank line to satisfy the linting gods - Senjan21
Hey @ramansrivastava, welcome to our projects! This issue is already being worked on by @ks129, but feel free to grab any other issue that you want to resolve. Also, if you have any question, you can always ask us at #dev-contrib on our Discord server.
Alright. This isn't really the way to go, though. The return value is set as None and this may return a Message object, it seems. You could have this function on this line and have a simple return on the next line. That will return None.
Build 20201002.3 succeeded
Requested by
GitHub
Duration
00:03:38
Build pipeline
Bot
More often than not, that heavy commenting is docstrings. Inline comments aren't used that frequently.
Adjusted the cog in 93ce90d @MarkKoz
Is there anything else that should be adjusted?
I think it's long enough to start wondering if the bot really saw the message. It's always nice to get some confirmation.
Build 20201002.1 failed
Requested by
GitHub
Duration
00:01:04
Build pipeline
Seasonal Bot
Build 20201002.2 succeeded
Requested by
GitHub
Duration
00:00:59
Build pipeline
Seasonal Bot
All done @gustavwilliam!
Instead of calling keys, and converting all to a list twice, create an extra variable for it. I also would suggest agaisnt hardcoded slicing, not because there could be more or less zodiacs, but for good practice. Since the original goal was to slice in the middle, there should be code that illustrates that intent. 7 is a magic number nobody reading this will know at the top of their head is the middle of all zodiacs (or at least close to it)
names = list(self.zodiac...
Hi, thanks for your contribution, I think it looks great. I've edited the PR description to include screenshots of the change.
However, because the PEP 0 URL is different from the others, it receives individual treatment with the embed being built here:
Invoking !pep 0 therefore still produces this:
 which can be shortened for aliases (.saveplanet / .saveearth), or a group with subcommands (.save planet / .save earth)?
This comment doesn't add any information or guidance to reading the code.
I don't think we need to convert them all to embeds and keep them in memory like this, the operation of convert to embed on the fly with built in methods is probably a bit more readable, and doesn't add anything worth considering in form of response time.
Either or, this should probably be in the init, in case we reload the cog (and not the extension)
hey i am new here and want to contribute here what should i do?
"Closes #454 "
command take 1 category name or many or none and it gives embed with emoji count and random emoji, if you give valid category and invalid category together bot will replace the invalid category and shows the output but if u give only invalid category bot will show the error
command invoke with 1 category
command invoke with more than 1 category

In order to allow backticks in an in-line markdown codeblock, I believe the appropriate approach is to use double-backticks, e.g.:

This produces:

But you could also build the escaped argument separately and store it in a shorter-named variable.
Hey @Anubhav1603, thanks for the PR! You seem to have a failed linting, please make sure to run pipenv run precommit on your local copy.
bot/exts/evergreen/emoji_count.py:42:32: ANN001 Missing type annotation for function argument 'ctx'
bot/exts/evergreen/emoji_count.py:55:26: ANN001 Missing type annotation for function argument 'ctx'
bot/exts/evergreen/emoji_count.py:65:24: ANN001 Missing type annotation for function argument 'ctx'
Build 20201002.4 succeeded
Requested by
GitHub
Duration
00:01:01
Build pipeline
Seasonal Bot
If we use double backticks it will again break if the argument provided contains a double backtick.
I agree with getting rid of the codeblock itself
I'll commit that for now, if others have an issue, we can discuss further.
Build 20201002.7 succeeded
Requested by
GitHub
Duration
00:02:32
Build pipeline
Bot
"""Generates an embed with the emoji names and count."""
Why is this variable called error_msg? It doesnโt sound like an error message to me.
We usually use bot.constants.ERROR_REPLIES for that.
It doesnโt get send here, something like 'Emoji embed built' would make more sense, or move it where it is actually sent.
Build 20201002.5 succeeded
Requested by
GitHub
Duration
00:00:52
Build pipeline
Seasonal Bot
Build 20201002.6 succeeded
Requested by
GitHub
Duration
00:00:55
Build pipeline
Seasonal Bot
Build 20201002.7 succeeded
Requested by
GitHub
Duration
00:01:00
Build pipeline
Seasonal Bot
Build 20201002.8 succeeded
Requested by
GitHub
Duration
00:01:00
Build pipeline
Seasonal Bot
Build 20201002.9 succeeded
Requested by
GitHub
Duration
00:01:00
Build pipeline
Seasonal Bot
i think i should remove this part for now whats your suggestion?
I more or less have the same comments as Senjan. I am curious if we should hardcode Github related info though, or make them variables from Constants etc. Just in the off-chance we ever switch hosting platform again.
I have hardcoded link though
Build 20201002.10 succeeded
Requested by
GitHub
Duration
00:00:58
Build pipeline
Seasonal Bot
The suggestion u propose also require one step and and with command also user need to do one step in order to link ,I don't think it will make huge difference
I think a lot of people already have done that step though.
It isn't really possible to get discord connections without OAuth2 afaik, and for that we'd need to set up site for that beforehand and quite frankly am not sure if it's worth it as for many people it would be faster to type the command than to go through process of OAuth2
We couldn't just grab their username from the Discord API?
OK, I'll remove the underscores.
Build 20201002.11 failed
Requested by
GitHub
Duration
00:00:56
Build pipeline
Seasonal Bot
It isn't really possible to get discord connections without OAuth2 afaik, and for that we'd need to set up site for that beforehand and quite frankly am not sure if it's worth it as for many people it would be faster to type the command than to go through process of OAuth2
We couldn't just grab their username from the Discord API?
No, the discord API doesnโt give this sort of data without an explicit consent from the user, through a web interface.
So you think it should convert responses when the user types the command?
Because of these your checks are failing
bot/exts/easter/save_the_planet.py:2:1: I100 Import statements are in the wrong order. 'from pathlib import Path' should be before 'from discord.ext import commands' and in a different group.
bot/exts/easter/save_the_planet.py:2:1: I201 Missing newline between import groups. 'from pathlib import Path' is identified as Stdlib and 'from discord.ext import commands' is identified as Third Party.
bot/exts/easter/save_the_planet.py:3:1: I201 Missing...
So have it like this?
[
{},
{},
...
]
Hello @ChrisGallardo, thanks for the PR! Although, can you run pipenv run precommit on your local copy to enable the precommit hook and automagically lint the files locally?
Because of these your checks are failing
bot/exts/easter/save_the_planet.py:2:1: I100 Import statements are in the wrong order. 'from pathlib import Path' should be before 'from discord.ext import commands' and in a different group. bot/exts/easter/save_the_planet.py:2:1: I201 Missing newline between import groups. 'from pathlib import Path' is identified as Stdlib and 'from discord.ext import commands' is identified as Third Party. bot/exts/easter/save_the_planet.py:3:1...
Because of these your checks are failing
bot/exts/easter/save_the_planet.py:2:1: I100 Import statements are in the wrong order. 'from pathlib import Path' should be before 'from discord.ext import commands' and in a different group. bot/exts/easter/save_the_planet.py:2:1: I201 Missing newline between import groups. 'from pathlib import Path' is identified as Stdlib and 'from discord.ext import commands' is identified as Third Party. bot/exts/easter/save_the_planet.py:3:1...
What is your username on discord @ChrisGallardo? ๐
This is what it told me:
Commit failed - exit code 1 received, with output: 'Check for merge conflicts................................................Passed
Check Toml...........................................(no files to check)Skipped
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Mixed line ending........................................................Passed
Trim Trai...
What is your username on discord @ChrisGallardo? ๐
myPetWiiUReggie
Nice! You can mark my comments as "resolved" and they'll disappear.
Hello @ChrisGallardo, thanks for the PR! Although, can you run
pipenv run precommiton your local copy to enable the precommit hook and automagically lint the files locally?
That's what @Xithrius told me to do on #dev-contrib and so that's what I did.
10a65fe Reminder: no feedback message when no mention - Akarys42
[python-discord/bot] New branch created: reminder\-no\-mention
Remove the and will mention x other(s) message when no mention is attached to the reminder.
I'm trying making the changes here on GitHub.
Build 20201002.8 succeeded
Requested by
GitHub
Duration
00:02:47
Build pipeline
Bot
Build 20201002.12 failed
Requested by
GitHub
Duration
00:01:00
Build pipeline
Seasonal Bot
Build 20201002.13 succeeded
Requested by
GitHub
Duration
00:00:52
Build pipeline
Seasonal Bot
Build 20201002.10 failed
Requested by
GitHub
Duration
00:00:47
Build pipeline
Bot
Build 20201002.9 succeeded
Requested by
GitHub
Duration
00:04:09
Build pipeline
Bot
Connected!
I'm not sure if there is a good way to get it currently, current help command is, just a standard command so info on it wouldn't give us much, since you have changed the converter to work better for that, it is possible that you don't really need to do much. I'd remove it for now and see what .source help gives
last time I checked the only way to get linked accounts is by using a self-bot, but as this is against the discord ToS so it is not a option.
from looking at the discord.py docs, what we would use is this: Profile.connected_accounts, but as stated in User.Profile():
This can only be used by n...
Build 20201002.11 succeeded
Requested by
GitHub
Duration
00:02:44
Build pipeline
Bot
[python-discord/bot] Pull request review submitted: #860 discord\.py 1\.3\.x Functionality Migrating
Works fine locally, good stuff.
12cbfe7 (Aliases, discord.py 1.3.x Migration): Replaced... - ks129
61a93c1 (Snekbox, discord.py 1.3.x Migration): Replaced... - ks129
88b4c72 (Patches, discord.py 1.3.x Migration): Removed ... - ks129
1a14f4f (Off-Topic Names, discord.py 1.3.x Migration): ... - ks129
a4a4b98 (Reddit, discord.py 1.3.x Migration): Replaced ... - ks129
Build 20201002.12 succeeded
Requested by
Joseph Banks
Duration
00:04:23
Build pipeline
Bot
Connected!
Build 20201002.13 failed
Requested by
GitHub
Duration
00:00:53
Build pipeline
Bot
Build 20201002.14 failed
Requested by
GitHub
Duration
00:00:52
Build pipeline
Bot
I don't see why this would fail considering you never touched the infraction info code.
Build 20201002.15 succeeded
Requested by
GitHub
Duration
00:03:00
Build pipeline
Bot
Thanks. It's fine if the source branch is master; doesn't matter on our end.
I remember making this suggestion in the original PR but approving anyway. Nice to see it come around eventually.
It'd be nice for it to work on individual words e.g. events for events team without just reducing the threshold. That's probably too complicated. This is still fine.
I'd prefer Scrags' as per #dev-core, but this is fine.
Since this is all repeated in the other command, it should all be in a separate function. At this point, I think you should make it a converter. It'll allow you to get rid of allowed_strings("l", "last", "recent") since you'll be able to internalise that into the converter.
Since d.py 1.3, commands can be invoked by calling the function e.g. await self.infraction_edit(ctx, ...)
[python-discord/bot] branch deleted: reminder\-no\-mention
Build 20201002.16 succeeded
Requested by
GitHub
Duration
00:04:40
Build pipeline
Bot
Connected!
Closes #1137 and #1139
I think this also closes #909
I just changed the default for use_cached to False, and didn't change it to set to True manually anywhere as I couldn't find anywhere that it was needed, antispam was the main one I checked but doesn't seem to try to fetch deleted messages from what I can see. Would be nice if somebody could confirm this
Build 20201002.17 succeeded
Requested by
GitHub
Duration
00:03:39
Build pipeline
Bot
You're correct that antispam sends the attachments before deleting the messages. However, setting use_cached to false decreases the likelihood of successfully sending deleted attachments for all callers of the function. This is because a message can be deleted by the author while the bot is trying to process/handle the message. That being said, I don't know if it's really worth potentially making two requests per attachment via the idea to try the proxy and then the normal if the proxy fails.
You must use sub_clyde for the username.
@thomaspet so should it also load the json on response, or store that in memory?
From bulk_update docs
If objs contains duplicates, only the first one is updated.
This is currently implicit, so you need to detect and respond with an error for duplicate IDs when doing a bulk patch.
Is this explicitly specified so you can set a custom min_value? I feel like this should have been a DB-level constraint to begin with.
Have you considered using SQL instead to check which users exists? It may be faster. It could be a single query: select id from users where id in (1, 2, 3, ...) limit 1 and then check if the returned length is 1. The Django way to do is with a filter and a slice.
Same thing about IntegrityError applies to this.
I believe this should catch IntegrityError and raise a ValidatioError since DRF doesn't handle it by default. This may be something that can be handled at a more global scale with a custom error handler (which I think is ideal) if you want to look into it further.
Build 20201002.14 succeeded
Requested by
GitHub
Duration
00:00:59
Build pipeline
Seasonal Bot
Woohoo finally figured out this linting business
Now I need to add more responses
Make this an async generator using yield from instead of extending and returning a list.
Considering customising the pagination style on the API side to avoid having to parse URLs. An ideal style would be one that only returns page numbers rather than entire links.
Leave some space between these to make it more readable.
await self.bot.api_client.post("bot/users", json=created)
Hey!
I can work on it. Can I get assigned?
Thanks
# User_data will not have a message key if the user exists
Capital letter.
What do you mean by "is clickable"? If you mean that the link is "complete" with the https part, maybe mention that instead.
Nicely done with fixing the things from my last review. Here are just a few minor things.
Build 20201002.18 succeeded
Requested by
GitHub
Duration
00:03:05
Build pipeline
Bot
Build 20201002.15 succeeded
Requested by
GitHub
Duration
00:00:52
Build pipeline
Seasonal Bot
Everything looks and works fine!
The only thing is the output of roles are not in the given order because of the switch to sets. It's nothing major, but I'll let you decide if we want to keep the sets or switch back to lists.
f791bc3 fix spelling typos in bot/ python files - hedythedev
2bfa1c2 Merge pull request #1 from python-discord/master - hedythedev
bb423b8 fix line length in bot/exts/info/information.py - hedythedev
90238cc Merge branch 'master' into master - Den4200
685d983 Merge pull request #1207 from hedythedev/master - Den4200
Build 20201002.19 succeeded
Requested by
GitHub
Duration
00:04:29
Build pipeline
Bot
Connected!
Build 20201002.16 succeeded
Requested by
GitHub
Duration
00:00:52
Build pipeline
Seasonal Bot
Build 20201002.17 succeeded
Requested by
GitHub
Duration
00:03:40
Build pipeline
Seasonal Bot
3e4661e Only request the identify scope with Discord on... - jb3
[python-discord/site] New branch created: joseph/reduce\-discord\-scopes
if my memory serves me right this should be good now
Closes #341
By default, AllAuth requests both identify + email from Discord on an attempted login.
We don't have any use for this email and so we discard it immediately, but there is no reason why we need to request this scope at all.
This PR will change the Discord authenticate screen to only state that it is requesting the basic user details of a user.
Build 20201002.1 succeeded
Requested by
GitHub
Duration
00:02:06
Build pipeline
Site
Build 20201002.2 succeeded
Requested by
GitHub
Duration
00:02:22
Build pipeline
Site
I think it's starting to look quite good! These changes are very minor
colour=discord.Colour.red()))
This default color is generally used for error messages from SeasonalBot. You could also do from discord import Colour, so you'll be able to do Colour.red(), instead of having to include discord. every time.
I think this newline is a bit unnecessary.
colour=0x7289da,
What's the reasoning behind this color? Something blurple like this may make more sense.
await ctx.send(embed=discord.Embed(title=random.choice(NEGATIVE_REPLIES),
description=f"The profile for `{username}` was not found.",
This would be more consistent with the current way of sending a random negative reply as the title of the embed.
You'll have to import random and NEGATIVE_REPLIES for this:
from bot.constants import NEGATIVE_REPLIES
import random.
If you decide to do go through and update all of them, I think updating the emojis on the server would be reasonable as well. It doesn't require more than a couple of seconds.
For other reviewers, see these for references:
Scopes
https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes
Prompt
https://discord.com/developers/docs/topics/oauth2#authorization-code-grant
prompt controls how the authorization flow handles existing authorizations. If a user has previously authorized your application with the requested...
This PR looks good to me! My only suggestion would be to possibly rename the tag to communities instead of guilds, but either way this tag looks good.
The word communities is used too repetitively, but I'm not sure what word could replace it.
Should the converter return the infraction id or the infraction dictionary itself? I'm thinking of something like
class InfractionLookup(Converter):
async def convert(self, ctx: Context, arg: str) -> t.Optional[dict]:
although I'm not sure whether the infraction_id parameter reflects its purpose concisely.
Return the full infraction data as a dictionary. Otherwise, you'd need to make a redundant request to get the data within the command. This is cause to get the ID, the converter has to make an API request in the case that the user wants to use the most recent infraction.
Postgres backup completed!
Build 20201003.1 succeeded
Requested by
GitHub
Duration
00:04:25
Build pipeline
Site
Logging should show something useful. Embed sent isn't good logging. Also could you make code to smaller blocks?
embed = discord.Embed(
color=Colours.orange,
title="Emoji Count",
timestamp=datetime.datetime.utcnow()
)
This is pretty pointless logging
This is too pointless logging
is it make much difference?
thats y i am using trace for logging
This is current style. Other cogs use same style for embed building.
Even when trace, for developers this add a lot of log messages to console, what maybe makes like error searching harder.
Iโd just like to mention that I put together a little document some time ago of another PyDis timeline, maybe that could help you to complete this one.
This timeline is based on your document, but we've boiled it down to what we think is most important.
Build 20201003.2 succeeded
Requested by
GitHub
Duration
00:00:58
Build pipeline
Seasonal Bot
Build 20201003.3 succeeded
Requested by
GitHub
Duration
00:00:58
Build pipeline
Seasonal Bot
I think this timeline shouldn't plain HTML, but YAML (entries) + Markdown (information) instead and this should dynamically load timeline items.
This timeline is based on your document, but we've boiled it down to what we think is most important.
Alrighty, fisk wasn't sure if it was.
I think this timeline shouldn't plain HTML, but YAML (entries) + Markdown (information) instead and this should dynamically load timeline items.
Seeing how close the 100k are, we might as well go for the faster solution, and maybe refractor later.
Build 20201003.4 succeeded
Requested by
GitHub
Duration
00:00:49
Build pipeline
Seasonal Bot
Remove all logging-related things from site, because PyDis use now Sentry. Removed URL, viewset, model, tests. Also removed site internal logging into DB. Closes #347 .
Build 20201003.2 failed
Requested by
GitHub
Duration
00:01:31
Build pipeline
Site
Build 20201003.3 succeeded
Requested by
GitHub
Duration
00:02:08
Build pipeline
Site
Build 20201003.1 succeeded
Requested by
GitHub
Duration
00:02:41
Build pipeline
Bot
Build 20201003.5 succeeded
Requested by
GitHub
Duration
00:00:59
Build pipeline
Seasonal Bot
Description
Currently it is only filtering out 'invalid' labeled PRs, we should also filter out 'spam'
Reasoning
According to the website:

Proposed Implementation
Add another -label: when constructing the query to the github API to filter out 'spam' labels
Would you like to implement this yourself?
- [x] I'd like to implement this feature myself
-...
Sounds good to me, thanks for the issue!
Relevant Issues
closes #474
Description
for hacktoberstats, prs with spam labels doesnt count as well
Reasoning

Did you:
- [x] Join the Python Discord Community?
- [x] If dependencies have been added or updated, run
pipenv lock? - [x] Lint your code (
pipenv run lint)? - [x] Set the PR to **a...
Thank you for contributing to Python Discord!
Please check out the following documents:
- Join the Discord server! - If you have not already, join the Discord server and introduce yourself in our #dev-contrib channel.
- Python Discord Contributor Wiki - A set of resources about setting up our services
- Python Discord Code of Conduct - Code of conduct for our commu...
Build 20201003.6 succeeded
Requested by
GitHub
Duration
00:01:04
Build pipeline
Seasonal Bot
Build 20201003.7 succeeded
Requested by
GitHub
Duration
00:01:08
Build pipeline
Seasonal Bot
Yup, did those @gustavwilliam
After some minor testing, I have discovered that stripping the "speak", "connect", "see", etc permissions for a voice channel does not trigger them to apply until a user leaves and rejoins the voice channel. That is, if you strip someone's permission to speak via editing the channel (like we do currently for text channels) they can continue to speak until they've left the channel. New users are denied the permission on join normally.
This means if we are going to implement this, the bot w...
Description
We can use this library for command. This command can convert any language to english and represent translation on embed
Proposed Implementation
We can have .translate language will be optional argument which will be default to english
- [x] I'd like to implement this feature myself
- [ ] Anyone can implement this feature
I donโt think this would be a good idea, since itโs an English speaking server (rule 4).
umm ok but rule 4 is for conversation only right and this command is just a showcase i can make this command to return translation in english only
Since there shouldn't be conversations in other languages, this command won't really bring any value to the community. If you wish to translate something, feel free to use Google Translate or similar services instead.
Yeah, this is too much of a pain for moderation, isn't considered a "fun" command, and isn't something that's genuinely useful in our community. Since there's no compelling reason to add it and it brings potential downsides, I'll have to say no to this proposal, sorry.
The bulk_create() method actually can take a keyword argument called ignore_conflicts, if set to True, then it will ignore errors such as ID already exists error(basically, ignore duplicates) and only create new users.
from docs:
On databases that support it (all but Oracle), setting the ignore_conflicts parameter to True tells the database to ignore failure to insert any rows that fail constraints such as duplicate unique values. Enabling this parameter disables setting the primary key on each model instance (if the database normally supports it).
should I use this instead? what do you think?
[python-discord/bot] New branch created: joseph/add\-socket\-stats
This adds a command which can be used by Core Developers to observe the types of events received by the bot.
It will present the number of events received per second and the number of events for each t value in Discord dispatch payloads.
Build 20201003.2 succeeded
Requested by
GitHub
Duration
00:02:46
Build pipeline
Bot
Build 20201003.3 succeeded
Requested by
GitHub
Duration
00:02:51
Build pipeline
Bot
Build 20201003.4 succeeded
Requested by
Joseph Banks
Duration
00:04:17
Build pipeline
Bot
Connected!
12cbfe7 (Aliases, discord.py 1.3.x Migration): Replaced... - ks129
61a93c1 (Snekbox, discord.py 1.3.x Migration): Replaced... - ks129
88b4c72 (Patches, discord.py 1.3.x Migration): Removed ... - ks129
1a14f4f (Off-Topic Names, discord.py 1.3.x Migration): ... - ks129
a4a4b98 (Reddit, discord.py 1.3.x Migration): Replaced ... - ks129
Build 20201003.5 succeeded
Requested by
GitHub
Duration
00:02:43
Build pipeline
Bot
It was due to the fact that I have removed 3rd field which had informations about user's status, I have since added the test back and changed the index to 2 in 764f35f as currently, infractions will be in 3rd field and not 4th
@mbaruh I'll work on your proposed zipped mouth lemoji now! ๐ค
With this change, it will now be necessary for developers to enable the members priviledged intent in the dev portal for their bots, otherwise the devbot exits on start-up:
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not ...
Looks good to me! ๐
Since the !server cmd always fetches the main guild invite, the presence counts will be very off elsewhere.

Do you think there's something we could do about this, or is it not worth worrying about? It would be nice to also use the prod guild for the member_count, but then devbots cannot fetch it because they're not in it.
Maybe it could just say, e.g.:
:green_circle: Approximately
23,687members online
We could iterate through guild invites to generate that section.
Actually, to expand on that we could iterate on startup to find a permanent invite..
Logically this does not look right to me. How will any reason_override or additional_info show anywhere?
Additionally, an empty string seems like a better default for additional_info than None due to the way it's used.
Should this be passed reason still and instead have reason_override assigned to reason if provided?
Works just fine; have you considered also trying a direct substring search? That would allow for e.g. "Core Dev" to match, but it'd only make sense if the search term is n chars long. Perhaps needlessly complex, as Mark says.
This PR will have conflicts with https://github.com/python-discord/bot/pull/1196 and should probably wait until we start using 1.5.0; some of the presence tracking will no longer be possible.
with open(Path("bot/resources/easter/save_the_planet.json"), 'r', encoding='utf8') as f:
Seems like the wrong path is used.
embed_data = []
I didn't quite understand what json_embeds was meant to do without analysing the rest of the code. Something like embed_data would make this a lot more clear. (Remember to update all references to this variable name)
return_embed = Embed.from_dict(random.choice(self.json_embeds))
await ctx.send(embed=return_embed)
I think splitting this up into two lines makes it a bit more readable and easy to understand. If you don't like the variable name return_embed, feel free to choose your own.
"""Responds with a random tip on how to be eco-friendly and help our planet."""
A simple typo.
I don't see sending yet another request to the API just for some stats a nice thing to do.
We can instead make the invite link a config variable and use both approx presence count and approx member count rather than currently having hardcoded invite link, approx presence count and actual server size.
However as we grow bigger, approx member count will be more out of sync with reality I'd assume, however if we need such modularity it sounds like a good trade.
use both approx presence count and approx member count
Yeah, I wasn't aware this was possible, I assumed the current solution uses the ctx guild because it cannot get the info from the invite. I'm in favour of doing this then, as long as the invite gives us all we need.
there are some references to tags left in some of the docstrings, there also looks to be some code left that handles them:
# Handle tag file location differently than others to avoid errors in some cases
if not first_line_no:
file_location = Path(filename).relative_to("/bot/")
else:
file_location = Path(filename).relative_to(Path.cwd()).as_posix()
Yeah that makes more sense.
Ok, I wasn't sure about that either.
Yeah that sounds better.
I'm so sorry it took this long to get reviews. I tried my best, but I'm not able to approve as confidently as I'd like.
Conceptually, the approach taken makes sense to me. The functionality is exposed via a very nice API, but I found the internals to be fairly complex in some places, and I had trouble "running" the code in my head. My testing indicates that everything is functional and that this indeed resolves #795.
I will leave it to you whether you trust my review or would prefer to ...
On the outside, the API is super clean.
I think this is the point where things get really difficult to reason about. But it does make sense.
With locks being a WeakValueDictionary, after lock goes out of scope here, the instance will be removed from the dict and garbage collected, correct?
The local lock shadows the outer function name. I think that the function could have a more descriptive name. It's only intended to be used from within this module, right?
That's convenient, but no. I think it is best for the client to be notified of duplicates via an error response. Otherwise, the client may not realise that only a partial update occurred due to some being skipped (e.g. in the case there are duplicate users but the fields they modify are different).
Oh, this is for create. Well, I'm a bit conflicted. On one hand, I don't like the idea of silently skipping things. On the other hand, it'd allow the syncer to sync as many users as it can rather than completely failing just cause 1 user is duplicated.
Therefore, I now think that if the user is in the DB already, then ignore duplicates. However, if the request data contains the user multiple times, then that's an error. Does that sound like a reasonable compromise?
It would be nice if you could add some empty lines in the code to make it a bit less dense, but overhaul this PR is on point ๐
This noqa isn't needed. It was here because flake8 doesn't handle function calls with strings (allowed_strings) very well.
You should raise an exception (probably BadArgument). This makes more sense for a converter. It also means you won't need to do if infraction is None: return in the command later.
Ty @vivax3794 for info
It could be qualified with utils. if you find that more readable.
Probably both. It could be a property. I think I just based this off the code Ves wrote in a comment.
I wanted this to be very flexible. There's no technical reason any hashable type shouldn't be allowed, and I think having prettier logs isn't an excuse for such restriction.
Well, this actually does get shown to users via the LockedResourceError. So maybe you have a point.
With locks being a WeakValueDictionary, after lock goes out of scope here, the instance will be removed from the dict and garbage collected, correct?
Not quite. It will get garbage collected once there are no more decorators holding references to the lock instance. The dictionary itself doesn't count as something holding a reference.
The local lock shadows the outer function name. I think that the function could have a more descriptive name. It's only intended to be used from within...
Build 20201003.8 succeeded
Requested by
GitHub
Duration
00:02:46
Build pipeline
Seasonal Bot
Connected!
Build 20201003.10 succeeded
Requested by
GitHub
Duration
00:01:00
Build pipeline
Seasonal Bot
@gustavwilliam I addressed your suggestions in a43a650e57093f2154f073ecc703f2a7bf274659
intents=intents,
Can you add a comma here? It doesn't change the execution of the code, but it's recommended by PEP 8, and leads to nicer diffs in GitHub.
intents=intents,
Can you add a comma here? It doesn't change the execution of the code, but it's recommended by PEP 8, and leads to nicer diffs in GitHub.
I have to import it in utils/__init__.py to support that. I tried it out and it felt too verbose, just cause of the length.
import function as func_utils is another option, but feels redundant to do it everywhere the module is imported. On the other hand, it'd also feel redundant to actually name the module func_utils when it's already in the utils package.
intents=intents,
Can you add a comma here? It doesn't change the execution of the code, but it's recommended by PEP 8, and leads to nicer diffs in GitHub.
Sorry for posting that three times, GitHub has been acting up for me.
Shouldn't this be checking if reason_override or additional_info are None? Otherwise it will send None to the user.
81711d7 Created file for moderation utils tests + added... - ks129
1549690 (Moderation Utils Tests): Added imports, modifi... - ks129
fa6a0ae (Moderation Utils Tests): Created tests for ha... - ks129 [98f7a37](https://github.com/python-discord/bot/commit/98f7a3777152b32bfda24f9d5add938479827c85) (Moderation Utils Tests): Created tests for no... - ks129
4a746fc (Moderation Utils Tests): Created tests for `no... - ks129
reason = infraction["reason"] if reason_override is not None else reason_override
I think something along the lines of this would be a better way of setting the reason for the infraction.
Lemojis for the different seasons. The first two ones, possibly only ones needed, will be winter and autumn.
Build 20201003.6 failed
Requested by
GitHub
Duration
00:02:30
Build pipeline
Bot
Build 20201003.7 succeeded
Requested by
GitHub
Duration
00:02:46
Build pipeline
Bot
[python-discord/bot] branch deleted: bug/util/795/reminders\-dupe\-delete
ef24f6d Reminders: remove duplicate deletion in schedul... - MarkKoz
96729f9 Reminders: remove _delete_reminder function - MarkKoz
4d5dedc Reminders: fix reminder_id type annotation - MarkKoz
b3e1ebf Decorators: more accurate return type for checks - MarkKoz
da33c33 Decorators: clean up imports - MarkKoz
Build 20201003.8 succeeded
Requested by
GitHub
Duration
00:04:17
Build pipeline
Bot
Connected!
Adds png and svg versions of lemon_zipped_mouth. It looks like this:

And in a conversation:
Can this PR be marked as Low Effort or Spam? I'm not very happy with the work I did.
Can this PR be marked as Low Effort or Spam? I'm not very happy with the work I did.
Wait there is already a .speedrun command, but it gets data from speedrun_links.json not the API. Should there be a new command, or switch it to use the API?
The command .speedrun is indeed already implemented.
But it doesn't use the API @MarkKoz mentioned
I think we can make it better with the API
You're correct that antispam sends the attachments before deleting the messages. However, setting
use_cachedto false decreases the likelihood of successfully sending deleted attachments for all callers of the function. This is because a message can be deleted by the author while the bot is trying to process/handle the message. That being said, I don't know if it's really worth potentially making two requests per attachment via the idea to try the proxy and then the normal if the proxy fa...
The feature is already working really well like that, I think it is better to focus on new features instead.
That's a good idea I suppose, will do so.
With 397d29a it should now display stats for the configurated invite link.
Build 20201003.9 succeeded
Requested by
GitHub
Duration
00:02:48
Build pipeline
Bot
Overview
Here are the first and most important seasonal lemojis:
lemon_s_autumn:

lemon_s_winter:

And here they are, as used in a discord channel:
Naming
The current filenames are lemon_s_autumn and lemon_s_winter. The _s_ is meant ...
Winter and autumn lemojis are added in #81.
Just one minor tweak and a few typos.
"title": "Choose renewable energy",
Typo!
def __init__(self, bot: commands.Bot) -> None:
self.bot = bot
self.embed_data = []
with open(Path("bot/resources/easter/save_the_planet.json"), 'r', encoding='utf8') as f:
self.embed_data = [embed for embed in json.load(f)]
This would be the a perfect place to use a list comprehension.
"value": "Make sure you only use paper when absolutely necessary. When you do, make sure to use recycled paper because making new paper causes pollution. Find ways to plant trees (Hacktober Fest!) to combat losing them.",
Typo.
This is how the new lemoji_happy looks:

As used in a channel:
This lemoji was used as the base for lemon_s_winter.
Build 20201004.1 succeeded
Requested by
GitHub
Duration
00:00:53
Build pipeline
Seasonal Bot
[python-discord/bot] New branch created: Den4200/fix/rules
The suggestion wasn't necessarily a new cog, it could be a class in the utils module that'd provide one public method for the cog to use (send number, get embed/text)
This can use a more descriptive name instead of using the comment to explain its purpose, making it a class variable is probably also more fitting
I feel like setting the max size in the init is a better place for it but it does split up the params into two different places
Description
This PR has a few improvements for the !rules command. Instead of using the splat operator (*), we are now using the Greedy converter to allow members to add extra text after the rule indices. I've also removed duplicate rule indices by using sets, and then sorting them afterwards.
Screenshots
Text after rule indices:

Before duplication removal (note ...
Build 20201004.1 succeeded
Requested by
GitHub
Duration
00:02:46
Build pipeline
Bot
How many choices should the user make?
While it is a relatively simple contribution, our team don't consider it low effort or spam as it's directly addressing an issue ticket we wanted to be resolved. Your solution wasn't super involved because it didn't need to be, and that's a good thing. As we appreciate the contribution, there's no reason for us to mark it invalid.
Do this before getting invalid indices to avoid having to iterate through duplicates during the search and avoid sorting again. Example
rules = sorted(set(rules))
invalid = ', '.join(str(i) for i in rules if i < 1 or i > len(full_rules))
if invalid:
...
Postgres backup completed!
I didn't split that to different functions without reason: In some reason, when putting stats increasing to any other function, then this don't actually increase stat sometimes, and I need to only increase stat when this success.
Max size should be set only once, so I moved this to __init__ (90103c5).
Build 20201004.2 succeeded
Requested by
GitHub
Duration
00:02:44
Build pipeline
Bot
Build 20201004.2 succeeded
Requested by
GitHub
Duration
00:01:01
Build pipeline
Seasonal Bot
Build 20201004.3 succeeded
Requested by
GitHub
Duration
00:00:56
Build pipeline
Seasonal Bot
right, so if the number of duplicates is more than 1, then send an error message and also stop the creation process?
How about we ignore the duplicates and instead send a warning message, notifying the client that duplicates were found and skipped?
note: The only client we have now is the python bot, and I don't think there will be a problem with multiple duplicates.
Build 20201004.4 succeeded
Requested by
GitHub
Duration
00:00:57
Build pipeline
Seasonal Bot
Build 20201004.5 succeeded
Requested by
GitHub
Duration
00:02:44
Build pipeline
Seasonal Bot
Connected!
Description
This error traceback is printed every time I click on a reaction after running the help cmd
Ignoring exception in on_reaction_add
Traceback (most recent call last):
File "/home/hedy/.local/share/virtualenvs/seasonalbot-S5lMGbTO/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "/mnt/c/Users/hedyh/codeproj/seasonalbot/bot/utils/decorators.py", line 79, in guarded_listener
return await listener(*ar...
Build 20201004.6 succeeded
Requested by
GitHub
Duration
00:00:58
Build pipeline
Seasonal Bot
Build 20201004.7 succeeded
Requested by
GitHub
Duration
00:02:59
Build pipeline
Seasonal Bot
Connected!
The bug looks to be here: https://github.com/python-discord/seasonalbot/blob/master/bot/exts/halloween/candy_collection.py#L138
if I am not mistaken it is since that is the wrong use of next(), the traceback went away when the line was switched to:
msg = await channel.history(limit=1, before=o).next()
Okay, this is a great start, and there's some pretty good code in here, but we need to figure out a few things.
@python-discord/core-developers, I want you guys to chime in on this with your opinions:
-
The last time we discussed this system, I remember people raising concerns about the name "Guides". Should it be called Guides, or something more generic? If we should call it something else, what do we call it? Maybe something like Content?
-
@ks129 How GitHub-Flavored Markdown compati...
This is pretty old fashioned. Please use pathlib instead.
Hmm, interesting. I'm not sure this will work, but it's a fun idea. I'm worried that this will just show the last time we built the docker container rather than the actual mtime of the file, since the files don't persist through redeployments - but I'm not sure. Maybe I'm wrong.
We should verify whether this works.
you can read files with pathlib too - something like Path(full_path).read_text() would make this whole context processor unnecessary.
Not quite. It will get garbage collected once there are no more decorators holding references to the lock instance.
Ok, that's what I was thinking but failed to express properly.
These are exactly the options I considered but didn't like any of them enough to propose them. Eh, it's fine the way it is, it's just the name function within the context of a decorator misleads, but it's not like you can't just look up where the name is defined.
No, the
lockfunction is a perfectly valid decorator on its own. It's useful if you need to lock on a constant value rather than a dynamic one via an argument.
I did not realize that, thanks for explaining.
Did you consider using a TemplateView here? It would do away with all of the boilerplate code:
class ResourcesView(TemplateView):
template_name = "resources/resources.html"
This all looks ok to me. I've tested the bot's core functionality and everything seems to work on 1.5.0. The intents seem to be setup correctly and I cannot think of anything that we missed ~ if we did, then it shouldn't be anything critical.
Regarding the documentation, I have added a short section to the bot contrib guidelines. It may make more sense to have it on the [bot account setup page](https://pythondiscord....
c90e50a Deps: bump 'discord.py' to 1.5 & re-lock - kwzrd
7e92832 Add intents setup to the bot - Senjan21
85e31b8 Remove Custom Status and Status from create_us... - Senjan21 [d2fe88a](https://github.com/python-discord/bot/commit/d2fe88adb94c9dc3d84ff560c5246a023c72d9a8) update member status info in server command - Senjan21 [4e695bc`](https://github.com/python-discord/bot/commit/4e695bc1c8ea48056e4fe155fca2c518c50277a9) Remove failing unit tests - Senjan21
[python-discord/bot] branch deleted: discordpy\-15
Build 20201004.3 succeeded
Requested by
GitHub
Duration
00:05:15
Build pipeline
Bot
Connected!
[python-discord/seasonalbot] New branch created: discordpy\-15
270cbeb Deps: bump 'discord.py' to 1.5 & re-lock - kwzrd
After https://github.com/python-discord/bot/pull/1196, we should make sure SeasonalBot is also ready for the upcoming gateway intents changes. This is a draft PR to action the dependency upgrade.
Amongst @python-discord/core-developers we need to decide whether we will require the priviledged members intent as we do for the Python bot. If we do not use it, the (default) member converter will not work, and it will therefore not be possible to convert user IDs into Member objects, e.g.:
Woah, I didn't know about TemplateView ๐
. Now this use this.
Build 20201004.8 succeeded
Requested by
GitHub
Duration
00:00:49
Build pipeline
Seasonal Bot
I've assigned you @Anubhav1603.
Feel free to ask any clarification questions if needed, and since it'll likely involve a decent amount of prose-like information, be sure to have at least another set of eyes go over the text for spell-checks/grammar to avoid needing to do so during code review.
Seems like this doesn't work. Have you tested it with users who have submitted invalid PRs? I tried this out with a user who had opened 4 PRs marked as invalid on the cpython repo.
Expected result
This is the result using the current version of the command. Since the PRs are marked as invalid, they aren't counted.
Actual result
SeasonalBot tells me that the person has contributed with 4 PRs.
Steps to reproduce
- Run bot with the PR version
- Send `.hackstats itz...
#Description
I have added Linepaginator and added check for animated emoji, so now if embed description limit exceeds bot automatically creates new embed and add pagination emojies to it
- [x] Join the Python Discord Community?
- [x] If dependencies have been added or updated, run
pipenv lock? - [x] Lint your code (
pipenv run lint)? - [x] Set the PR to allow edits from contributors?
Build 20201004.9 succeeded
Requested by
GitHub
Duration
00:00:55
Build pipeline
Seasonal Bot
Unless anyone is keen on fixing this, we should simply disable the command for now.
Build 20201004.4 succeeded
Requested by
GitHub
Duration
00:02:33
Build pipeline
Bot
Current system
At the moment, the colors and names of the labels on the repo seem a bit messy. This is the full list:
New system
I'm proposing a new system, which will look a lot like the one used in the Python Bot. All labels should preferably use the color coding from that repo as well, in order to keep things consistent.
Here are the proposed prefixes:
a:โย areap:โ prioritys:โ statust:โ typem:โ meta
Specific labels
Area:
- ...
Closes #1104
If the message contains both plaintext and code blocks, the text will be ignored.
If several code blocks are present, they are concatenated.
Implementation rationale
- The issue with inline code is that it's used often inside an explanation to mark certain keywords.
For example:
You can use the
joinfunction to concatenate a collection of strings:strings = ('abc', 'xyz', 'asdf') print(' '.join(strings))
If we allow text to be added around...
Build 20201004.5 succeeded
Requested by
GitHub
Duration
00:02:50
Build pipeline
Bot
2553a1d Sort rules before determining invalid indices. - Den4200
Good catch, addressed in 2553a1d
Overall, I agree with the proposal. A few niggles to mention or make note of.
Type:
t: bugโ Something isn't working
t: featureโ New feature or request
t: questionโ Request for clarification or further information
These terms are very dev-centric, while this repo is primarily asset-related. Due to this, I'd suggest using more suitable terms that effectively stay in line with your intentions, but feel more applicable to the situations we'd encounter here:
- prop...
Build 20201004.6 succeeded
Requested by
GitHub
Duration
00:02:42
Build pipeline
Bot
Build 20201004.7 succeeded
Requested by
GitHub
Duration
00:02:36
Build pipeline
Bot
Sets cannot take in dicts as they are hashable, so I could use a list and check before appending or I convert the dict to a tuple to storing it in the set().
I see no value in turning area into a. single letters are not good descriptors.
the labels we have here are the organization-level labels that we designed together with several core devs and I do not see the use in rolling a completely different convention here.
However, I do agree that we should change the labels to make sense in the context of branding. So my counter-proposal is for you to come up with labels that follow the established conventions but change the meta info to be relev...
I found that, if no fields are provided, a validation error is thrown.
How does the IntegrityError get triggered?
single letters are not good descriptors.
I believe this was part of the proposal purely to bring it in line with our other repos, as they use single-letter tag types.
These terms are very dev-centric, while this repo is primarily asset-related. Due to this, I'd suggest using more suitable terms that effectively stay in line with your intentions, but feel more applicable to the situations we'd encounter here:
Very fair point. I've updated the original comment to reflect this
Build 20201004.1 succeeded
Requested by
GitHub
Duration
00:02:15
Build pipeline
Site
Look alright to me. I think the variable naming in the method could be overall improved, it's a little bit all over the place (perhaps better to use either index or pick in both genexps, full_rules could be fetched_rules and rules could be picks or picked_rules) but that's minor.
I'm also triggered by the way this string is formatted. :rage:
https://github.com/python-discord/bot/blob/ff7c34aee21493efbc78a9b6521dd9c0f48d4a72/bot/exts/info/site.py#L116-L118
@lemonsaurus Just like @scragly said, this seems to be the convention only in bot repos (both SeasonalBot and Bot). I would have nothing against using the full names โ like type, status and area โ instead. However, I don't think we should skip that meta-part of the tag describing the category. To me, saying status: stale makes much more sense than simply stale.
[python-discord/site] New branch created: remove\_django\_wiki
both SeasonalBot and Bot
No, just bot, lol. I checked after I posted, hence the edit.
I also noticed that the annotation for LinePaginator.paginate's first arg is violated - it wants a list but we give it a tuple. That's not caused by this PR's diff though, and the annotation is probably needlessly strict.
This PR simply annihilates django-wiki and everything related to it.
- All 263 are still passing
- Smoke tested OK, website still seems to work fine.
This does not remove all the related tables from the database in production. A seperate issue exists to do this, see https://github.com/python-discord/admin-tasks/issues/37
Aha, right. I suppose we've discussed doing this but never completed this issue:
https://github.com/python-discord/organisation/issues/268
Right, so seasonalbot appears to be more in line with our organization labels. Here's how the organization default labels look:

Anyway, ultimately this is the kind of labels I want on all our repos - including on bot. So let's come up with a set for this repo that make sense, and follow the organisation label conventions.
Sounds good to me. Any reason that priority normal isn't included?
Sounds good to me. Any reason that priority normal isn't included?
Superfluous
I guess. Would most issues and PRs simply be without any label?
I believe that would be the intention; only truly low and high priority stuff would be worth the note making them the exception.
Note: Remember to target dewikification with this PR
After some discussion in #dev-core, we've decided we're going to continue to disentangle and simplify the site, and that the dewikification project provides a good opportunity to do this. Let's remove everything related to OAuth and notifications from the stack, too.
The primary purpose these served was to allow us to use a members pydis role to determine what they could access. This is a fundamentally good idea, but without th...
Here are the labels that I propose we have on this repo.
Specific labels
area: lemojiโ Related to lemojisarea: emotesโ Related to all emotes, except for lemojisarea: eventsโ Related to events, like Code Jams or Hacktoberfestarea: pydisโ Related to the standard branding of PyDis- (
area: documentationโย Documenting workflows and conventions) good first issuehelp wantedinvalid
All default labels from...
statustype
Possibly r...
self.embed_data = json.load(f)
I missed this last time, but since the loaded json is already a list, we can simply do this.
This will probably be my last change request.
You still have references to django-nyt here
and there
which cause the app to not start. Other than that, it looks good.
cce6610 Remove references to django_nyt - lemonsaurus
Description
Let the .8bitify not just work on avatars, but if the user uploads an image, 8bitify that instead.
Reasoning
It would let users 8bitify more than just their avatar.
Proposed Implementation
I think the ideal way to do this is to first check if the user passed any extra arguments to .8bitify, and if so, skip the getting the avatar and instead use the image URL they passed.
Additional Details
Maybe also fix #431 while I'm at it.
Would you ...
9b63db3 Replace map with a more pythonic list compreh... - Den4200
bfcd468 Remove duplicates from given rule indices and s... - Den4200
6cc110c Use Greedy converter instead of the splat ope... - Den4200
dcad46f Use url argument instead of setting it outside. - Den4200
2553a1d Sort rules before determining invalid indices. - Den4200
[python-discord/bot] branch deleted: Den4200/fix/rules
Build 20201004.8 succeeded
Requested by
GitHub
Duration
00:04:22
Build pipeline
Bot
Connected!
Where does it remove those other cogs? This code was responsible for it, but you removed it
for cog in tuple(self.cogs):
try:
self.remove_cog(cog)
except Exception:
pass```
[python-discord/site] branch deleted: remove\_django\_wiki
Can I try to implement it? I think I will start with just a single player in #seasonalbot-commands though.
0d6fe3e Remove django-allauth from Pipfile. - lemonsaurus
b648783 Remove django-allauth from settings. - lemonsaurus
a2357c0 Remove files related to django-allauth. - lemonsaurus
517310e Remove allauth references from the home app. - lemonsaurus
892661e Remove the login feature from the templates. - lemonsaurus
[python-discord/site] New branch created: remove\_oauth
This strips out everything related to django-allauth. This means we can no longer log in, which makes sense because without the wiki, there's really not much of a reason to log in anyway.
Our plan is to continue to push the site towards being more or less just a simple static page, and this is another step on that road.
The pages the user has access to.
This is no longer a concern, since we're stripping out auth.
Beyond that, I'm not sure I understand what this would be, but it sounds a bit like a sitemap. Sitemaps are ugly. Let's not make one.
Instead of doing this, let's just do a search function, which there is already an issue for here: https://github.com/python-discord/site/issues/366
Build 20201004.10 succeeded
Requested by
GitHub
Duration
00:01:04
Build pipeline
Seasonal Bot
Looks good to me! Nicely done.
7909c4d Add space between dice in roll command - gustavwilliam
[python-discord/seasonalbot] New branch created: space\-out\-dice
Description
The .roll command now has a single space between the outputted dice, when more than 1 roll is specified. The code behind the command is also a lot more refined.
Reasoning
Previously, when given a number greater than 1, the .roll command sent the dice without space between them. This resulted in it looking quite strange.
Screenshots
Current:
Proposed:
Did you:
- [x] Join the Python Discord Community?...
Build 20201004.11 succeeded
Requested by
GitHub
Duration
00:00:54
Build pipeline
Seasonal Bot
I don't like this. You've turned 6 lines into 3, and introduced more complexity. I don't mind your code, but I prefered when it was 6 lines - it had better readability.
Our code style is to not have a newline after docstrings for functions and coroutines, by the way. I'm not sure why the linter let this through, I guess it's not set up with the same flake8-docstrings rules as we have on bot.
While I'm not fond of the general logic in the code โ looping and creating new string objects every time โ I still get your point about readability. I'll revert to the original solution, with the slight alterations needed to add the spaces.
Also, there is no newline after the docstring. I still had this part on top:
if num_rolls > 6:
num_rolls = 6
oh okay, just misread that then. my bad.
6969fc1 Revert and update roll command - gustavwilliam
Build 20201004.12 succeeded
Requested by
GitHub
Duration
00:00:57
Build pipeline
Seasonal Bot
I see what you're saying. Either way, I pushed a new commit that returned to the original logic and simply added the spaces. Sadly didn't see that you added that "for the record" part before finishing it.
If you add spaces the preferable approach for me would be to use random.choices + the join function on a genex and ditch the loop and concatenations.
This will also allow you to avoid the strip at the end.
Yeah you're right, this isn't much better. Let's use a helper function. Maybe something like this?
def _get_random_die() -> str: # _ prefix since it's an internal helper.
"""Generate a random die emoji."""
die_name = f"dice_{random.randint(1, 7)}" # 1, 7, not 6. it's not inclusive.
return getattr(Emojis, die_name) # No point in the third arg, this isn't gonna fail.
# We only support num_roll between 1 and 6.
if 1 <= num_rolls <= 6:
dice = " ".join(get_rand...
I wish to design a new lemoji that has an expression of being angry and sad at the same time. This would be useful because many times people are very angry about something, but they are also sad about that very thing (You can't honestly say you have never experienced that feeling). Currently, I expect it would be a merge of :lemon_enraged:, :lemon_grumpy:, and :lemon_pensive:.
Build 20201004.13 succeeded
Requested by
GitHub
Duration
00:00:52
Build pipeline
Seasonal Bot
@gustavwilliam sorry about that, it was because of the syntax, should have looked at the +-is:draft for reference. the latest commit should fix it, i will further test it later
I think this would be great. Assigning you to it now.
Sure. Request another review or send a message when you think it's ready and I'll have a look.
Build 20201005.1 succeeded
Requested by
GitHub
Duration
00:00:58
Build pipeline
Seasonal Bot
Build 20201005.2 succeeded
Requested by
GitHub
Duration
00:00:55
Build pipeline
Seasonal Bot
sounds fine to me. go ahead.
Updated and expanded book for Python 3. Has 30 new major guidelines added compared to the 1st edition.
Thank you for contributing to Python Discord!
Please check out the following documents:
- Join the Discord server! - If you have not already, join the Discord server and introduce yourself in our #dev-contrib channel.
- Python Discord Contributor Wiki - A set of resources about setting up our services
- Python Discord Code of Conduct - Code of conduct for our commu...
I'd like to implement this
Build 20201005.1 succeeded
Requested by
GitHub
Duration
00:02:13
Build pipeline
Site
I'd like to implement this
Could we have this as a global constant instead so that it is consistent with other cogs? Also, we should be using pathlib.Path.open instead.
with Path("bot/resources/easter/save_the_planet.json").open('r', encoding='utf8') as f:
EMBED_DATA = json.load(f)
I think we should use our RandomCycle utility to make sure these don't repeat in a row.
We would then open and read the embed data like so:
with Path("bot/resources/easter/save_the_planet.json").open('r', encoding='utf8') as f:
EMBED_DATA = RandomCycle(json.load(f))
And then this line would look like so:
...
Hello @WillDaSilva, this was already fixed. Sorry, we should've closed this issue.
If @adityaprakash-bobby isn't opposed, I'd like to implement this.
Looks good to me - tested on iOS and desktop. Thanks!
Build 20201005.3 succeeded
Requested by
GitHub
Duration
00:00:51
Build pipeline
Seasonal Bot
Hi @WillDaSilva, I think it's completely fine if you would like to implement this. To be honest, with university going online and 2 jobs, I've forgotten about this. Sorry to the seasonalbot folks about ignoring this!
Build 20201005.4 succeeded
Requested by
GitHub
Duration
00:02:54
Build pipeline
Seasonal Bot
Connected!
No problem @JackyFWong, I hope your studies are going well!
@WillDaSilva, I've assigned you.
Your return typehint for this method no longer matches what you're returning.
def embed_builder(self, emoji: dict) -> discord.Embed:
I've been playing around with alternatives for NamedTuple for the Channels class. I think it would be best to leave it as a named tuple, as its attributes are used all over the codebase as ints. It could be changed to an IntEnum, whose attributes subclass int, but some errors arise from that since the attributes don't behave exactly like ints do. Changing it to an IntEnum would require calling int on most/all of its uses, which is undesirable. Changing it to a regular Enum would...
Relevant Issues
Closes #393
Description
At startup, before the bot sends the "Connected!" message in the dev_log channel, a list of the available channels is obtained, and the channels defined in constants.py is checked against it. For every constant which refers to a channel which does not exist, an error message is logged which includes the channel name, and its ID.
Reasoning
As mentioned on #393, changing the kind of class that Channels is would probably be more ...
Build 20201005.6 succeeded
Requested by
GitHub
Duration
00:00:57
Build pipeline
Seasonal Bot
Postgres backup completed!
I don't think we should do
EMBED_DATA = RandomCycle(json.load(f))
Unless you can index it by key as well. In the off chance we want to select a specifc embed with a new (non random) command.
My changerequests seems to have been done something about, I'm pleased to accept when other requests have been addressed
I considered at first amending FORMATTED_CODE_REGEX, but that would over-complicate it and could create bugs with the original function of the command.
I don't see what's overcomplicated. You can just delete the previous matching code and regex and use yours. It looks like it will for just fine for one match too. You may not get all the extra info for logging easily, but that isn't really important and can be discarded in my opinion.
Few other remarks I don't like, which aren't part of the PR so i can't comment on
- Change the a variable name
a, that's not descriptive at all
for a in ctx.guild.emojis:
I'm pretty sure all other commands return None, and should have a descriptive function name.
"ec" is not a good functon name, we use name, and aliases for what the command it self should be called
async def ec(self, ctx: commands.Context, *, emoji: str = None) -> Optional[str]:
- why are ...
Why not make the embed builders return a Linepaginator, instead of embed + message. Just do the split and ect before returning.
Can't this be done just above this? If you use a defaultdict you dont need to add a list to the dict at all, it will create one if it doesnt exist
emoji_dict = defaultdict(list)
for emoji in emojis:
emoji_dict[emoji_prefix].append(emoji)
etc
I can probably look at this, if you assign it to @tagptroll1
I can probably look at this.
Not sure I understand. The pattern I added doesn't deal with inline code at all. Meaning if someone were to send:
`print("hi")`
as a message, the pattern I added won't catch it.
Build 20201005.7 succeeded
Requested by
GitHub
Duration
00:01:02
Build pipeline
Seasonal Bot
Build 20201005.8 succeeded
Requested by
GitHub
Duration
00:00:59
Build pipeline
Seasonal Bot
Build 20201005.9 failed
Requested by
GitHub
Duration
00:00:53
Build pipeline
Seasonal Bot
This will spam the logs based on how many emojis exist..
Just do the log first, then logic as to what you want to ignore instead of not ignore.
log.trace(f"Emoji Category {'' if category_query else 'not '}provided by the user")
for emoji in ctx.guild.emojis:
emoji_category = emoji.name.split("_")[0]
if category_query is not None and emoji_category not in category_query:
continue
emoji_dict[emoji_category].append(emoji)
renamed emoji_category to ca...
@gustavwilliam thanks for your review, I confirmed that it works now

Build 20201005.10 succeeded
Requested by
GitHub
Duration
00:00:58
Build pipeline
Seasonal Bot
@vivax3794 if I do that flake8 tells me:
bot/exts/halloween/candy_collection.py:138:25: B305 `.next()` is not a thing on Python 3. Use the `next()` builtin. For Python 2 compatibility, use `six.next()`.
It's a flake8 false positive. When you call channel.history, you get an instance of discord.iterators.HistoryIterator back and that class does implement a next method. You'll need to add an ignore/noqa for flake8 here.
Build 20201005.11 succeeded
Requested by
GitHub
Duration
00:01:02
Build pipeline
Seasonal Bot
Sounds good. I'll have a look later today.
error_comp = ', '.join(key for key in emoji_dict)
It will index keys implictly
With that last suggestion I believe it looks as long as you've done extensive testing locally.
Build 20201005.12 succeeded
Requested by
GitHub
Duration
00:00:58
Build pipeline
Seasonal Bot
We don't have too much time until the 7th so I propose that for now we keep use the privileged Guild Members intent. It doesn't make things worse in any way (we're disabling other intents, so we'll already see less traffic). In the future we may want to disable it but there should probably be more conversation w.r.t. that (CC: @scragly).
I mostly copied the setup from bot (see description for PR link), but I've disabled typing events everywhere (this only disables the event, bot can stil...
Build 20201005.13 succeeded
Requested by
GitHub
Duration
00:00:56
Build pipeline
Seasonal Bot
Build 20201005.14 succeeded
Requested by
GitHub
Duration
00:01:07
Build pipeline
Seasonal Bot
Build 20201005.2 failed
Requested by
GitHub
Duration
00:02:08
Build pipeline
Site
Looks good, if we want to disable members intents we can do it at later date.
When we do various streams for the community, we often build frame assets that we can use for the streams.
For example, here are the ones I'll be using for the Summer Code Jam 2020


 string together those functions with error handling, and fetch the image bytes.
Did you:
- [x] Join the Python Discord Community?
- [x] If dependencies have been added or u...
Build 20201005.15 succeeded
Requested by
GitHub
Duration
00:00:58
Build pipeline
Seasonal Bot
If that does happen, we can deal with it when it happens. I don't think we need to be preemptive here about this.
03aadc2 Update branding to Python Discord - jb3
[python-discord/forms-frontend] New branch created: branding/update\-favicons
Updates the branding on the site to use Python Discord icons.
b474b35 Update favicon sizing information - jb3
[python-discord/forms-frontend] branch deleted: branding/update\-favicons
And I can import RandomCycle with this?
from bot.utils import RandomCycle
Build 20201005.16 succeeded
Requested by
GitHub
Duration
00:01:07
Build pipeline
Seasonal Bot
776825d fix(statsd): Gracefully handle gaierro - tagptroll1
[python-discord/bot] New branch created: fix/tagp/graceful\-stasd\-connect
Per issue #1185 the bot might go down if the statsd client fails to connect during instantiation. This can be caused by an outage on their part, or network issues.
If this happens getaddrinfo will raise a socket.gaierror.
This PR catched the error, sets self.stats to None for the time being, and handles that elsewhere.
In addition, fallback logic was added to attempt to reconnect, in the off-chance it's a temporary outage
Thank you for contributing to Python Discord!
Please check out the following documents:
- Join the Discord server! - If you have not already, join the Discord server and introduce yourself in our #dev-contrib channel.
- Python Discord Contributor Wiki - A set of resources about setting up our services
- Python Discord Code of Conduct - Code of conduct for our commu...
Hi @dolphingarlic, are you still interested in working on this?
Build 20201005.1 succeeded
Requested by
GitHub
Duration
00:02:53
Build pipeline
Bot
You're right. However, I think there's still room to reduce redundancy. The original regex has a block named capture group that'd let you ignore inline blocks by checking if the block group is non-empty. You could also check if the delim is three back ticks. So I think you can easily narrow this down to only 1 regex by modifying the original.
If there are more than 2 matches with a block, then join them. otherwise, pick the first match.
Hi, I'm still interested in working on this. I've just been overwhelmed by finals/IOI/IMO lately and haven't found the time or energy to address the reviews :grimacing:
I'll definitely be able to work on this in a few (~3) weeks though
Ok so you're saying we shouldn't be sticking to a fullmatch anyway.
I don't mind, the reason I didn't go that route is that it would slightly repurpose the current logging.
Is there a way for this to still be a 404? Will raising NotFound work? Is that idiomatic?
Don't forget to update the view docs since you've changed the paginator.
cfb9237 Rewrite roll command - gustavwilliam
Build 20201005.17 succeeded
Requested by
GitHub
Duration
00:00:52
Build pipeline
Seasonal Bot
Alright, I used your code @lemonsaurus with some minor alterations. This looks good to me; especially compared to the last version we tried out.
If you ran it and it worked, then it seems good to go.
[python-discord/forms-frontend] New branch created: react/add\-list\-key
It's not about whether there are 1 or 2 or 3 duplicates. I'm suggesting it should depend on whether they are in the request or in the DB. Example: a request's data has two users with the ID 1. This should be an error. Another example: a requests data has one user with ID 1 and the DB has a user with ID 1. This should be skipped.
I don't know if this is worth the added complexity. I thought it'd make the API more robust. But it's also an option to just document that "duplicates will be skip...
As is suggested by the compiler and https://reactjs.org/docs/lists-and-keys.html#keys lists should contain keys to allow ReactDOM to understand which elements have changed when state is updated.
This PR introduces that in two places: the route generator for react-router-dom and the FormListing items on the LandingPage component.
both. either. We're going to do lots of streaming, and we will need frames for these streams. It'd be nice to have some options.
The end goal is to have a folder in this repo with some streaming assets, including several different kinds of frames.
Alright, sounds good!
We don't want to create this function every time the roll command is used, so move it up into the cog.
We're not actually using this part of the code - but we might use it for the dewikification project, so all right. I guess this change is fine.
Setting self.stats to None is not a solution because all the code that tries to send stats will get an AttributeError.
@scragly I think you're the only one familiar with this stuff. Can you review this? If you approve, just merge it.
Fair enough, but it's just trace logging; not particularly important. What you did is fine, but, if possible (seems like it is), I'd rather not have 2 almost-identical regular expressions in the code.
Setting self.stats to None is not a solution because all the code that tries to send stats will get an AttributeError.
Did i miss anymore usages of it? I did a project search for it, and only found usage in bot.py and a mock in helpers.py
Yeah, it's used by many cogs, usually as self.bot.stats. For example, see the help channel cog.
ebf41d3 Move _get_random_die to me a separate function - gustavwilliam
Yeah, it's used by many cogs, usually as
self.bot.stats. For example, see the help channel cog.
Jeez, now that's a facepalm from me. I did a search for self.stats, and found it really odd that was all the stats we tracked
Build 20201005.18 succeeded
Requested by
GitHub
Duration
00:00:51
Build pipeline
Seasonal Bot
ca761f0 fix(bot): Not assign stats to None - tagptroll1
897e714 fix(bot): redundant false checks on self.stats - tagptroll1
Build 20201005.3 succeeded
Requested by
GitHub
Duration
00:02:42
Build pipeline
Bot
Noticed I somehow opened this through my work account... Apologies, reopening on correct account
Per issue #1185 the bot might go down if the statsd client fails to connect during instantiation. This can be caused by an outage on their part, or network issues.
If this happens getaddrinfo will raise a socket.gaierror.
This PR catched the error, sets self.stats to None for the time being, and handles that elsewhere.
In addition, fallback logic was added to attempt to reconnect, in the off-chance it's a temporary outage
Build 20201005.4 succeeded
Requested by
GitHub
Duration
00:02:41
Build pipeline
Bot
Ok, that is fine, no worries. Just making sure the PR hasn't been abandoned.
I can write a custom validation class to return a 404 response which can be used wherever needed or I could simply do
err = ValidationError({"id": f"User with id {user_data['id']} not found."})
err.status_code = 404
raise err
This looks fine. Besides creating a migration, I don't think anything has been missed.
This feels redundant. It can be replaced with a call to retry_statsd_connection if you do self.stats = AsyncStatsClient(self.loop, LOCALHOST) inside the function. Maybe after an if attempt == 1. Or you could set it before you call the function.
Relevant Issues
Closes: #136
Description
OMDB was only used for the snake movie command. I replaced its usage in that command, and while doing so streamlined the construction of the embed.
Did you:
- [x] Join the Python Discord Community?
- [x] If dependencies have been added or updated, run
pipenv lock? - [x] Lint your code (
pipenv run lint)? - [x] Set the PR to allow edits from contributors?
No, it is bot.utils.randomization.RandomCycle.
Build 20201005.19 succeeded
Requested by
GitHub
Duration
00:00:51
Build pipeline
Seasonal Bot
This is not what I meant before, you should do this instead.
with Path("bot/resources/easter/save_the_planet.json").open('r', encoding='utf8') as f:
EMBED_DATA = RandomCycle(json.load(f))
Moved to the global scope.
Did you test the changes? The bot fails to start.
from bot.utils.randomization import RandomCycle
I'd like to implement this command myself. There are plenty of other issues to work on, though ๐
This is how it would look like:
FORMATTED_CODE_REGEX = re.compile(
r"(?P<delim>(?P<block>```)|``?)" # code delimiter: 1-3 backticks; (?P=block) only matches if it's a block
r"(?(block)(?:(?P<lang>[a-z]+)\n)?)" # if we're in a block, match optional language (only letters plus newline)
r"(?:[ \t]*\n)*" # any blank (empty or tabs/spaces only) lines before the code
r"(?P<code>.*?)" # extract all code inside the ...
7a817f8 fix(bot): refactor of connect_statsd - tagptroll1
3e37bf8 fix(bot): better fallback logic - tagptroll1
Build 20201005.6 succeeded
Requested by
GitHub
Duration
00:02:20
Build pipeline
Bot
Build 20201005.21 succeeded
Requested by
GitHub
Duration
00:00:41
Build pipeline
Seasonal Bot
[python-discord/bot] New branch created: joseph/verification
233f635 Support users with alternate gating methods - jb3
This PR extends the verification cog to support users joining through alternate gating methods.
It will send a separate DM for any user verifying through a gating method which is not !accept and will completely disable the welcome DM.

Build 20201005.7 failed
Requested by
GitHub
Duration
00:00:50
Build pipeline
Bot
Build 20201005.8 succeeded
Requested by
GitHub
Duration
00:02:51
Build pipeline
Bot
[python-discord/forms-frontend] branch deleted: react/add\-list\-key
I think you can merge the pop operation into this since it will silently fail if the key doesn't exist. I don't have the docs on hand so please confirm.
Pretty sure this must be awaited.
Addressed in 880b936faf83d8fa3d7489e1f9eaab89b93af1b8
Indeed, you can, addressed in 880b936faf83d8fa3d7489e1f9eaab89b93af1b8
feels like a good place for a block comment explaining what happens. this line in particular is a bit opaque.
a little unclear now that we technically have two gating systems.
Looks great overall. Couple nitpicks, but nothing that needs to block merge. fix if you want.
Not sure I love using pop as delete. just do cache.delete if you don't need it.
This was changed in 880b936faf83d8fa3d7489e1f9eaab89b93af1b8, but yep.
Build 20201005.9 succeeded
Requested by
GitHub
Duration
00:02:46
Build pipeline
Bot
This should be member.id
2020-10-05 16:42:18 | bot | ERROR | Unhandled exception in on_member_join.
Traceback (most recent call last):
File "/home/mark/repos/python/bot-pydis/.venv/lib/python3.8/site-packages/discord/client.py", line 333, in _run_event
await coro(*args, **kwargs)
File "/home/mark/repos/python/bot-pydis/bot/exts/moderation/verification.py", line 546, in on_member_join
await self.member_gating_cache.set(raw_member.id, True)
AttributeError: 'dict' obj...
Or raw_member["id"] I suppose.
Addressed in 8d6d3ef56d29c2eff372c858fa0a228eeefdbfb8
Addressed in 406da780c06a6797b860d816c4a418def9a3f116
Addressed in ea3217effacc02e06444ea0b21985cd7439a13e7
Addressed in ceffe46a0d5136308c8f0684c2c406dd34e758fb
Addressed in 082e26342eb3faf104523334cdb87e07eda03db3
Build 20201005.10 succeeded
Requested by
GitHub
Duration
00:02:37
Build pipeline
Bot
Build 20201005.11 succeeded
Requested by
GitHub
Duration
00:02:18
Build pipeline
Bot
Build 20201005.12 succeeded
Requested by
Joseph Banks
Duration
00:06:02
Build pipeline
Bot
Connected!
That's not quite right because you specifically need to check if there is more than 1 code block. Currently you check if theres more than 1 match. A match could be an inline code block too, so you end up with a case of code being blank if the input has two inline code blocks.
I believe it needs to be something like this
matches = list(FORMATTED_CODE_REGEX.finditer(code))
blocks = [match for match in matches if match.group("block")]
final = blocks if len(blocks) > 1 else matches[0]
code = textwrap.dedent(', '.join(final))
Anyone else have an opinion on if this is better than 2 separate regular expressions?
Ok, I really overestimated the importance of the logs then
You need to change retry_statsd_connection since you renamed the function
The sixth attempt will wait over 18 hours, which is too excessive. 5 attempts will only be a bit over 4 minutes. I don't think an exponential function is good, because waiting 4 minutes is not that long, but the next best is 18 hours, which is too long.
This should be named as a private method.
Should it be called Guides, or something more generic? If we should call it something else, what do we call it? Maybe something like Content?
"Guides" feels like it is a bit restrictive on what kind of content can be in there. "Content" sounds too generic, but it's decent. How about "articles"?
I'm not sure if we need contributors and last modified dates on the guides.
No, I don't think it's strictly necessary. However, it has some benefits. Knowing the authors means you can go ...
Looks good to me, nice work!
Thank you for your constribution,
Here are a few pointers I came across while reviewing it.
None of my comments are meant as rules for what you must change, they are open for debate.
f6af25b Add Cog and add a couple responses - ChrisGallardo
8060d2c Merge branch 'master' into save_the_planet - ChrisGallardo
a5a032f Fix errors - ChrisGallardo
e47875c Merge branch 'save_the_planet' of https://githu... - ChrisGallardo
7a3d22f Take @thomaspet's suggestion for SaveThePlanetCog - ChrisGallardo
Build 20201006.1 succeeded
Requested by
GitHub
Duration
00:03:04
Build pipeline
Seasonal Bot
Connected!
81711d7 Created file for moderation utils tests + added... - ks129
1549690 (Moderation Utils Tests): Added imports, modifi... - ks129
fa6a0ae (Moderation Utils Tests): Created tests for ha... - ks129 [98f7a37](https://github.com/python-discord/bot/commit/98f7a3777152b32bfda24f9d5add938479827c85) (Moderation Utils Tests): Created tests for no... - ks129
4a746fc (Moderation Utils Tests): Created tests for `no... - ks129
