#dev-log
1 messages ยท Page 96 of 1
[python-discord/sir-robin] New branch created: feat/zen\-command
Is there a reason this one uses lowercase f formatting instead of uppercase? There does seem to be a difference https://discord.com/developers/docs/reference#message-formatting-timestamp-styles.
This also shouldn't be in backticks
This PR adds two main things.
Miscellaneous cog
This is used to group commands that are small & unique but unrelated usages.
This is where I have ported the original code to.
Error handling cog
The zen implementation relies heavily on an error handling cog. I have implemented a simple one that
can be extended as this project grows. I do not think this PR s...
@MaskDuck Could you please make sure it's the format that doesn't include the day of the week?
March 31, 2022 [time]
I don't think we need this. It introduces a few problems. Let's just stick with the basic message, and keep the actual error in logs.
What are the problems you are referring to?
I think because it runs on a server where we wouldn't beable to see the logs easily unless you have direct access, could cause unhandled errors to be harder to spot. This gives us a way to see them, so we can create issues and add handlers.
The codebase has nothing to hide from its users. I even took this snippet from the main bot here. I would expec...
Fair point, we don't even have Sentry set up just now.
Dear Griff,
Excellent work.
I've made a minor suggestion but everything else looks good to me. I've also tested the code.
Please handle MissingRequiredArgument too, or make the pep_number argument of the pep command optional.
:pleading_face:
Ah yeah, I'll stick that handler on too
Currently, you get an ugly unexpected error message.
494250e remove unused var, split long line - ShakyaMajumdar
For those of us running our own snekbox instances, an informational endpoint would be useful. This could list the api version, the current version of snekbox, and perhaps the installed packages.
104e648 Add handler for MissingRequiredArgument - GDWR
Additions
Added another handler for MissingRequiredArgument errors, so &pep doesn't have a horrible error.
Before

After

4eabfbc docstrings and annotations - ShakyaMajumdar
Added another handler
[python-discord/sir-robin] branch deleted: feat/zen\-command
Connected!
A minor detail but with this change this should link to https://peps.python.org/pep-0000
Just in-case, can we specify allowed_mentions=AllowedMentions.none()?
What's the point with the second argument?
Can we set a to 1 by default? There should be at least one blank space.
I also believe that b is exclusive, so 3 means that the maximum number you can get back is 2 - consider bumping that one as well.
All seems good to me ๐
f1894e5 Remove unnecessary config constant - MarkKoz
af3c145 Add util function to send an infraction using a... - MarkKoz
780074f Add command to resend infraction embed - MarkKoz
fa797ce Fix superstarify reason displaying the incorrec... - MarkKoz
44451dc Disallow resending hidden infractions - MarkKoz
Can this be done globally instead of on a per-command basis?
GitHub Actions run 2071506040 succeeded.
Not all places need a minimum of 1 space to be syntactically valid.
I think 2 spaces is good enough, 3 becomes a bit too bad
Many calls to this function generally look like (parenthesize if cond else unparse)(foo, bar). Not having the second argument with a default value would need more code for handling the different number of args in those places.
They are the same page, so it doesn't really matter.
+ f"{space()},{space()}".join(unparse(kwarg, True) for kwarg in keywords)
f"({space()}{f'{space()},{space()}'.join(unparse(arg, True) for arg in args)}"
[python-discord/bot] branch deleted: feat/timeit\-command
Connected!
Yeah, that's why they get "\n".join-d
GitHub Actions run 2071556384 succeeded.
Yeah, putting the spaces before the semicolon.
Can't have spaces between the op and =, x + = 1 is not valid
await x is an expression, so there cannot be a semicolon here
Also cannot have semicolons here, function calls are expressions
There is a space in front for the first iteration of the loop, but not the next iterations
resolved in 8c224a52be5000af380465a9d71a55997750fccd
resolved in 8c224a52be5000af380465a9d71a55997750fccd
resolved in 8c224a52be5000af380465a9d71a55997750fccd
resolved in 8c224a52be5000af380465a9d71a55997750fccd
resolved in 8c224a52be5000af380465a9d71a55997750fccd
resolved in 8c224a52be5000af380465a9d71a55997750fccd
resolved in 8c224a52be5000af380465a9d71a55997750fccd
resolved in 8c224a52be5000af380465a9d71a55997750fccd
It can yes, but we might want to ping users. For this command, considering we take in user input we can do it specifically here.
1916cea sanitize messages sent - ShakyaMajumdar
resolved in 1916ceabe0a618b5f76cccac07afd656a39a40f1
I'll close this issue as I agree with Chris that members hoisting themselves isn't something we're worried about. There will always be people at the top of the online members list, who they are doesn't really matter.
[bot-core] Branch bump\-d\.py\-and\-add\-BotBase was force-pushed to `a114d63`
The logic here isn't quite correct, as this will currently subtract 1 from the total even if the reply was to a bot or themself, in which case it wasn't counted in the first place.
@jonathan-d-zhang are you interested in continuing this? If not i'd be happy to take over.
GitHub Actions run 2072445825 succeeded.
@wookie184 oops, I kinda forgot about this yeah, you can take over if you'd like
GitHub Actions run 2072537414 succeeded.
Maybe also a timestamp for the time it was deleted? Because after a few days, the Discord message only shows the date, not the time and it'd be nice to have that at a glance
Tested, looks good. Thanks for the PR!
GitHub Actions run 2072554304 succeeded.
Maybe also a timestamp for the time it was deleted? Because after a few days, the Discord message only shows the date, not the time and it'd be nice to have that at a glance
Oh I only just saw this now.
I wouldn't mind having the full timestamp in the embed footer for deletion time, but I think that can be scoped in a separate issue since this PR is currently ready to be merged.
There are a couple other log embeds I want to slightly change cosmetically as well.
I think that can be scoped in a separate issue
For sure. We can create a separate issue for that, including the other cosmetic changes you mentioned. You can assign me to that if you'd like, I wouldn't mind working on it ๐
GitHub Actions run 2072710512 succeeded.
I've made a couple of changes, feel free to request changes on any of them if you think anything should be reverted to previous wording or changed further
Included it, I also mentioned the mypy docs as I think that's probably one of the best places to go for an introduction to type hinting.
I changed to link the docs. I'm not sure mentioning pyright adds much here, and a link I added mentions other type chackers.
9e966f0 feat: add created at field for message deleted ... - MaskDuck
Connected!
GitHub Actions run 2072783536 succeeded.
Connected!
While working on Sir Robin, we were porting the Source command as we wanted that functionality.
During this, we needed to duplicate the converters.py and also the source.py cog. To me it feels like this would be a...
Also, if this is done an issue should be created on Sir Robin to change how it is being used.
GitHub Actions run 2073056330 failed.
[bot-core] Branch bump\-d\.py\-and\-add\-BotBase was force-pushed to `0168aba`
[bot-core] Branch bump\-d\.py\-and\-add\-BotBase was force-pushed to `40ef2a1`
I reverted this and only made async-redis cache optional. The solution I had for stats was hacky and messed with pylance enough that it couldn't pick up that it had parent class methods.
Making statsd optional has been dropped now, see comment above.
[bot-core] Branch bump\-d\.py\-and\-add\-BotBase was force-pushed to `53bc8f6`
[bot-core] Branch bump\-d\.py\-and\-add\-BotBase was force-pushed to `5a02b3b`
GitHub Actions run 2073490479 failed.
GitHub Actions run 2073558953 failed.
Connected!
Connected!
GitHub Actions run 2074853978 succeeded.
@Bluenix2 - Added function to convert to kebab-case. (suggested here #dev-contrib message).
Code adopted from:
https://github.com/python-discord/site/blob/main/pydis_site/apps/resources/templatetags/to_kebabcase.py
Fix the generation of the whitespace by modifying a single character in the source code.
Relevant section of the pep: https://peps.pythondiscord.com/pep-9001/#tabs-or-spaces
We recommend placing at least one space wherever possible
Sounds like it should be possible, but would require some unformatting which is a bit hacky. At this point it might just be easier and faster to wait for CPython to implement the PEP. Thoughts?
changed explicitly silenced to explicitly garbage collected ,hope its not offensive btw
Awesome! Let's get this merged, thank you.
3b152a1 add ast.FloorDiv support - JelleZijlstra
41a4138 Fix the error for *args and **kwargs parame... - thatbirdguythatuknownot
d4fa1d7 Fix KeyError for ast.JoinedStr - thatbirdguythatuknownot
b03b690 Merge pull request #35 from thatbirdguythatukno... - wookie184
dd90f0a Merge branch 'main' into patch-2 - wookie184
[python-discord/sir-robin] branch deleted: fix/formatter
Connected!
3328aeb Fix the problem of the formatter generating no ... - thatbirdguythatuknownot
b3c9da9 Add missing comma remove in a merge conflict - ChrisLovering
3b152a1 add ast.FloorDiv support - JelleZijlstra
41a4138 Fix the error for *args and **kwargs parame... - thatbirdguythatuknownot
d4fa1d7 Fix KeyError for ast.JoinedStr - thatbirdguythatuknownot
b03b690 Merge pull request #35 from thatbirdguythatukno... - wookie184
dd90f0a Merge branch 'main' into patch-2 - wookie184
Connected!
Connected!
This change takes us further away from PEP 20, by removing the phrase explicitly silenced, which is a reference to the original zen. So.. no.
e90457b Fix trailing indented lines - Bluenix2
[python-discord/sir-robin] New branch created: fix/indented\-empty\-lines
When formatting code, you may notice trailing lines with indents. This was because of yield n * " " + space().join(curr_chunk) which would generate an indent even if curr_chunk was empty.
dbc832e Merge pull request #25 from python-discord/feat... - HassanAbouelela
1254b01 Update miscellaneous.py - GDWR
53757f6 Merge pull request #28 from python-discord/fix/... - Xithrius
3b152a1 add ast.FloorDiv support - JelleZijlstra
41a4138 Fix the error for *args and **kwargs parame... - thatbirdguythatuknownot
[python-discord/site] branch deleted: remove\-resource\-suggestion\-template
I disagree, it was there because it's a good resource, and it still is, I don't think who created it is that relevant.
Formatted code can become longer than its input, this means that the message sent may go over the 2000-character limit.
This PR ports over the bot service file and puts it to good use in the blurple formatter.
3744548 Fix import order according to isort - Bluenix2
7159e2f Rewrite send_to_paste_service() docstring to ... - Bluenix2
This doesn't seem to be used anywhere
e345ae5 Remove unused logger from blurple formatter - Bluenix2
Ah, yes you're are right. This was left from another attempt I made - oops. Fixed in e345ae5d64afbf7f93a6dc637665009c9451568d
Looks right, and seems to work
Minor, but makes things a little clearer IMO:
"favorite-froot-is-lemon"
Code adopted from:
Thanks for the PR, this works nicely! Just two small things, other than that this seems good.
This function can be removed, and _to_kebabcase renamed to to_kebabcase, there's not much point having a second function if all it does is call the first.
Current behaviour seems ๐, will mark this as resolved
Connected!
GitHub Actions run 2080696625 succeeded.
I agree. I had a nice conversation with @mustafaquraish who explained when separating the logic out would make sense. It was very helpful! Just pushed the updated code for your review.
Thanks for making those changes, this seems good to me now!
โฆconstants.
Fix the f-string output to follow PEP 9001.
Fix parenthesized expressions by adding whitespace to the beginning and end of the expression.
Fix inf/nan constants not appearing correctly.
Looks fine, tested out locally.
[python-discord/sir-robin] branch deleted: fix/indented\-empty\-lines
Connected!
[python-discord/sir-robin] branch deleted: hastebin\-blurple
3b1a28e Port hastebin to Sir Robin and add it to blurpl... - Bluenix2
7159e2f Rewrite send_to_paste_service() docstring to ... - Bluenix2
e345ae5 Remove unused logger from blurple formatter - Bluenix2
59ed88f Merge branch 'main' into hastebin-blurple - D0rs4n
7cb1604 Merge pull request #40 from python-discord/hast... - D0rs4n
Connected!
this pr migrate one of the discord bots channel pin (the ssl error stuff), but a bit sightly modified.
GitHub Actions run 2082542418 failed.
GitHub Actions run 2082544832 failed.
GitHub Actions run 2082547355 failed.
GitHub Actions run 2082553377 succeeded.
Thank you so much for the PR! I really appreciate it! I just have a few comments regarding the PR below.
Subheadings rather than bolded
#### How to fix SSL Certificate issue on Mac
description: A guide on fixing an SSL certificate error.
Navigate to your `Applications/Python 3.6/` folder and double click the `Install Certificates.command` to fix this.
We could perhaps do an inline code block to emphasize it.
306a906 Update pydis_site/apps/content/resources/guides... - Shom770
GitHub Actions run 2082589798 failed.
Excellent work, friend. Minor nitpick.
# Now, replace any non-alphanumerics that remains with a dash.
This would be more accurate since numbers are not being replaced.
Fixed formatting of assert statements in the blurple formatter.
#959231863698882621 message
Migrates [this](#discord-bots message) message by the Python bot on how to personalize your Discord bot status, as part of the pin migration program described in issue https://github.com/python-discord/site/issues/695.
GitHub Actions run 2082683144 failed.
Makes sense! Thank you for the suggestion :) Just pushed the update.
GitHub Actions run 2082723942 succeeded.
Connected!
GitHub Actions run 2082751484 succeeded.
Hey all, @doublevcodes are you still interested in this? I saw this message from last year: #dev-branding message
I know the topic of Ramadan branding comes up fairly often. I also see you were never actually assigned to this issue.
Is this up for grabs?
I suspect there is still some nice way to make statsd optional, but we can revisit it later.
For consistency
"""Add the given ``cog`` to the bot and log the operation."""
7d00aec Use imperative mood in docstrings - ChrisLovering
In #42 we tried to make statsd optional while adding it, however the way we attempted to do so made it so that editors wouldn't detect that the async statsd client inherited methods from stats client base.
It seems like it should be possible by using the Attributes keyword in the class/init docstring, adding a docstring after the attr, or using #: on the line before it.
However all of these methods result in the follow error when building the docs
Handler for event 'doctree-read' threw an exception (exception: type object 'BotBase' has no attribute 'all_extensions')
I spent quite a while googling around trying to figure out why this happens but didn't manage to get anyw...
a6ab7b1 Bump d.py version and add new requirements for ... - ChrisLovering
1e6556a Add async_stats subclass of statsd - ChrisLovering
8bd3706 Add BotBase that will act as a base for all our... - ChrisLovering
9079605 Remove unneeded kwargs in BotBase - ChrisLovering
b8a2450 Provide a bot.all_extensions instance attribute - ChrisLovering
[python-discord/bot-core] branch deleted: bump\-d\.py\-and\-add\-BotBase
f4c4ea9 Update changelog with latest changes - ChrisLovering
[python-discord/bot-core] New branch created: 5\.0\.0\-changelog
84b3086 Bump version to 5.0.0 - ChrisLovering
[python-discord/bot-core] branch deleted: 5\.0\.0\-changelog
562552b Bump all dev deps to latest versions - ChrisLovering
[python-discord/bot-core] New branch created: update\-all\-deps
[python-discord/bot-core] New tag created: v5\.0\.0
964f9cc Add ignore for typing.Any in flake8 - ChrisLovering
[python-discord/bot-core] branch deleted: update\-all\-deps
50fab95 Migrate site_api tests from bot - ChrisLovering
[python-discord/bot-core] New branch created: add\-api\-test
This ports the api tests over from bot, since I will be removing them in https://github.com/python-discord/bot/pull/2118
In https://github.com/python-discord/bot-core/pull/52 we ported some test over from bot.
We should have our test suite run in CI, for each PR.
5dc3304 Move the creation of BotBase's AsyncResolver to... - ChrisLovering
[python-discord/bot-core] New branch created: move\-creation\-of\-AsyncResolver
[bot-core] Branch move\-creation\-of\-AsyncResolver was force-pushed to `6751058`
There is a deprecation notice that this must be created within an async function. This isn't a breaking change.
[python-discord/bot-core] branch deleted: move\-creation\-of\-AsyncResolver
[python-discord/bot-core] New tag created: v5\.0\.1
GitHub Actions run 2083350683 succeeded.
GitHub Actions run 2083362800 succeeded.
Putting this here for reference if needed in the future:
from typing import Optional
import requests
from bs4 import BeautifulSoup
from discord import Embed
from discord.ext import commands
from bot.bot import Bot
RESOURCES_URL = "https://www.pythondiscord.com/resources/"
SITE_TOPICS_TITLE_CASE = []
def get_topics():
"""Scrape Python Discord website for updated list of topics to include in embed."""
topics_split = []
topics_title = ""
dont_c...
GitHub Actions run 2083590659 succeeded.
GitHub Actions run 2083704531 succeeded.
GitHub Actions run 2083705453 succeeded.
GitHub Actions run 2083708331 failed.
GitHub Actions run 2083716951 succeeded.
GitHub Actions run 2083718183 succeeded.
Hey @minalike
I don't think I'll have time for this anymore. Life calls ๐ . I'd be open to letting anyone else do this, although I did come up with some initial ideas in the #dev-branding channel.
How is the comment true if escaped_string[-1] is '?
Does this ever fail? Why is it here?
Ia it just because "this should be True unless there's a bug..."?
The comment, and the code implementation, contradict each other here.
No, they don't after close inspection. This code was just copied from ast._Unparser.
Going to fix it if I can offer an alternative.
Code was just copied from ast._Unparser to fix the whitespace in f-strings.
Should we really have space here inside of the string?
PEP 9001 does it.
Both spaces matter. Example, when ((1 + 2) * 3) is done.
Awesome, thank you going through with this PR!
Summary
Following python-discord/bot#2079 it was discussed having an API allowing the bot to fetch possible filters so that implementations don't need to scrape it.
This new API could power different future bot features like having interaction-based URL builder.
Description
Currently resources are loaded from a folder of yml, [then a number of different steps in processing are applied](https://github.com/python-discord/site/blob/main/pydis_site/apps/resources/views/resources...
16b0444 Fix bug where having channels without categorie... - wookie184
[python-discord/metricity] New branch created: fix\-channel\-sync
If category.channel is None then channel.category and channel.category.id in BotConfig.staff_categories will be none. This field isn't nullable, so we get an error. We can fix this by casting the result to a bool. This assumes all channels that don't have a category are not staff channels.
Looks good to me.
Could maybe use a comment explaining why the bool cast is necessary though.
Looks good to me.
Could maybe use a comment explaining why the bool cast is necessary though.
[python-discord/metricity] branch deleted: fix\-channel\-sync
e592060 Replaced resources.md with Resources Cog - iamericfletcher
c0f0a1a Merge branch 'main' into 2079 - wookie184
fc0ddf2 Merge pull request #2117 from iamericfletcher/2079 - wookie184
GitHub Actions run 2086069531 succeeded.
Connected!
GitHub Actions run 2086083905 succeeded.
GitHub Actions run 2086085179 succeeded.
GitHub Actions run 2086087685 was cancelled.
GitHub Actions run 2086089563 succeeded.
[mypy's documentation](https://mypy.readthedocs.io/en/stable/builtin_types.html) contains useful information on type hinting, and for more information check out [this documentation page](https://typing.readthedocs.io/en/latest/index.html).
It's not in a code block on the line above, so shouldn't be here either. Apostrophe to indicate ownership.
Connected!
GitHub Actions run 2086095858 was cancelled.
GitHub Actions run 2086100959 succeeded.
GitHub Actions run 2086112576 succeeded.
[sir-lancebot] Branch redirect\-aoc\-commands was force-pushed to `535b0d3`
GitHub Actions run 2086122950 failed.
[sir-lancebot] Branch redirect\-aoc\-commands was force-pushed to `2a50a31`
Force push to deal with conflicts and rebase to main.
GitHub Actions run 2086145274 succeeded.
GitHub Actions run 2086146048 succeeded.
Running locally on Windows I get this error.
metricity.database[24544] INFO Initiating connection to the database
Ignoring exception in on_guild_available
Traceback (most recent call last):
File "C:\Users\wookie184\AppData\Local\pypoetry\Cache\virtualenvs\metricity-iF629sR3-py3.9\lib\site-packages\discord\client.py", line 373, in _run_event
await coro(*args, **kwargs)
File "C:\Users\wookie184\Documents\GitHub\metricity\metricity\bot.py", line 218, in on_guild_available
...
Connected!
GitHub Actions run 2086155135 succeeded.
bit of a long shot, but could you try adding this to the dunder init before anything asyncio related is called. We had to do this in the bots for aiodns on windows, might work here too.
if os.name == "nt":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
bit of a long shot, but could you try adding this to the dunder init before anything asyncio related is called. We had to do this in the bots for aiodns on windows, might work here too.
if os.name == "nt": asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
That didn't seem to make a difference
bit of a long shot, but could you try adding this to the dunder init before anything asyncio related is called. We had to do this in the bots for aiodns on windows, might work here too.
if os.name == "nt": asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())That didn't seem to make a difference

I'll take a look at i...
0551c40 Pin discord.py version to pre-asyncio changes - ChrisLovering
[python-discord/metricity] New branch created: pin\-d\.py\-version
There are 1 failures, 0 warnings, and 0 notices.
94482c9 Don't overwrite flake8 default ignores - ChrisLovering
You may have dismissed my first review, but I insist on giving you my opinion.
0551c40 Pin discord.py version to pre-asyncio changes - ChrisLovering
94482c9 Don't overwrite flake8 default ignores - ChrisLovering
38faed0 Merge pull request #16 from python-discord/pin-... - ChrisLovering
[python-discord/metricity] branch deleted: pin\-d\.py\-version
On Mar 31, 2022 around 03:00 UTC there were a couple help channels that should have closed due to lack of activity but stayed open for several hours until they were closed by a staff member.
#help-dumpling: #help-dumpling message
#help-mushroom: #help-mushroom message
As of now I'm not sure what may have caused this. Sometimes users will "bump" their help chan...
Here's a simple unblurplifier (unformatter) that turns PEP 9001 code back into valid Python. Is it hacky? Yes, but at least it works well enough to qualify for "if it's stupid but it works, it ain't stupid". Also has an option to format the output with Black so it looks like proper Python code rather than a total mess.
import re
import black
import_context_code = """
import importlib
class ImportContext:
def __init__(self, name: str):
self.name = name
de...
Without logs it is unfortunately very challenging to debug this. Even with the existing logging, I think it would be difficult. It would require much more detail, most of which is under trace logging. Maybe we should increase the log level?
This has been suggested several times over the years. It has been rejected (e.g. [here](#community-meta message)) on the grounds of defeating the educational purpose of the message โ to teach users how to format code themselves; automatic formatting removes incentive to learn.
I'm still in agreement with this view. I can't speak for others, but based on history, it is likely other developers and staff also agree. However, you're...
Connected!
@MarkKoz
imo maybe create an embed and also ping them to tell them about formatting code spaces
If their code is anything longer than a single line that embed would become really big.
As well as what Mark pointed out, there's also the issue that it may be less clear who the original message was from if it's re-sent as a bot message, and makes it harder to reply to/mention them. They would also lose the ability to edit the message.
Well, I was planning to account for most of that ๐
The main idea with it was that 3/4 of the time, the actual message from the bot alerting the user about their lack of backticks, is often larger than the code snippet itself.
And then 1/2 the time, the user either ignores it, or says that they don't understand.
Then there's also when a user asks a question, and like 3 or 4 people respond with !code.
The purpose of this was to avoid all of that by actually showing their code as an example as to how it is to be formatted.
I understand t...
i agree.
we could make edition simple with the newly released modal?
Would there be a way to make that configurable? As in for contributors that don't want to see that level of detailed logging, would they be able to toggle it?
Yes, it's already configurable in dev, via the use of our trace loggers and debug flag.
What Mark was referring to was the logging level in production, since we pin it to info only. We could bump this down to debug/trace but it would mean a lot of logs would come in for the bot, and log rotation would be far quicker than before.
This is a hard one to debug since we need the extra logging, but also don't know what causes it to happen, so don't know when to enable the extra logging.
The main idea with it was that 3/4 of the time, the actual message from the bot alerting the user about their lack of backticks, is often larger than the code snippet itself.
And then 1/2 the time, the user either ignores it, or says that they don't understand.
Maybe this would be better solved by refining that message then? I think that whatever our solution is it's important it explains how they can format it properly so they can do that in the future.
Then there's also when a us...
I like your idea wookie, using the ephemeral message and I do think that solution is a lot cleaner when compared to what I was suggesting.
I haven't been bothering with dpy after it went down, and I haven't looked back at it since it came back up, so I was not entirely aware of how the new system will work, so it slipped my mind that it was a thing. But yes.
As for the disadvantages that you listed:
- People not reading the message may be rectified if the bot also mentions them to get th...
For me, I agree with Mark's initial point about "defeating the educational purpose of the message". However, I do see another use case for this.
When I am writing code on my phone in help channels (because I am sometimes an "on-the-go" helper), it is really annoying to find backticks and to format code correctly in comparison to PC. If this were an opt-in feature, much like our help DM notifications, it ...
GitHub Actions run 2091197683 succeeded.
GitHub Actions run 2091204859 failed.
GitHub Actions run 2091225447 succeeded.
Description
Port &blurplify command from sir-robin to sir-lancebot, now that April fools is over. Contribution to this command can continue here.
Reasoning
There seems to be interest in contributing to this feature, so removing &blurplify altogether would be less than ideal.
Proposed Implementation
Shouldn't be very difficult. The code itself is already written, it should only be a matter of finding the right spot, pasting the code, testing, and PR'ing.
Additio...
One thing we need to brainstorm, is a way to reference PEP 9001 somehow. As of now we plan on keeping peps.pythondiscord.com live. Perhaps we could hyperlink it in the help embed for this command.
@Bluenix2 What do you mean by "if someone wants it to be inf"?
Now that April Fool's is over, there was discussions on removing the &pep and &zen commands. However, I, along with others, thought it would be a shame to completely get rid of them. It was suggested that PEP 9001 be immortalized somehow. Specifically by moving the link into the &blurplify command which is planned to move to sir-lancebot (see here). As for &zen, to avoid confusion, there should be some sort of indication w...
What about putting all of these as subcommands on a aprilfools or some sort of parent command? That way they can't be run as easily by using the wrong prefix.
I am in favor of
- removing
&pep - keeping
&zen(already some of us have gotten used to using&zen Xto refer to a specific line in the modified Zen poem) - Change Sir Robin's version of the
zencommand to have a link to PEP 9001 somewhere - Add footer to Sir Robin's
zenembed saying "From April Fools 2022" or similar
It's been removed in favor of using the source instead.
[python-discord/bot] New review comment on pull request #2089: Feat: add ability to snooze reminders
Just a minor nit pick, why not have
snooze_button = SnoozeButton(self)
self.add_item(snooze_button)
as
self.add_item(SnoozeButton(self))
just seems like an unnecessary variable assignment but please let me know if there's a reason for this.
I don't have much to contribute to the discussion since I'm still relatively new to programming. Still, I find the API interaction with bot and vice-versa fascinating and am excited to take on this issue if approved!
[python-discord/bot-core] New branch created: minor\-fixes\-to\-BotBase
[bot-core] Branch minor\-fixes\-to\-BotBase was force-pushed to `985c0ba`
[bot-core] Branch minor\-fixes\-to\-BotBase was force-pushed to `68f45fd`
Sentry Issue: SITE-24
InvalidRegularExpression: invalid regular expression: quantifier operand invalid
File "django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
DataError: invalid regular expression: quantifier operand invalid
(17 additional frame(s) were not displayed)
...
File "django/db/backends/utils.py", line 66, in execute
return sel...
dd6dd65 Parse infraction search reason as regex before ... - ChrisLovering
[python-discord/bot] New branch created: parse\-regex\-before\-querying\-site
Previously this would raise an error within site due to the invalid regexp.
Closes #2125
GitHub Actions run 2097153082 failed.
GitHub Actions run 2097240485 succeeded.
Could I be assigned to this now? I'm willing to work on it
So, to implement this, I think the best way to approach would be slash commands; using the autocomplete feature would show all matching docs to the input and since it can show several matches I wouls say it removes most if not all typing errors when trying to get a documentation. Could I get some feedback on this please
From a UX point of view, I find the suggestions on slash commands to be too slow to be considered good, but itโs better than the alternative of providing no suggestions.
That said, we arenโt porting commands to slash commands just yet.
[python-discord/bot] branch deleted: parse\-regex\-before\-querying\-site
f4a3de4 Parse infraction search reason as regex before ... - ChrisLovering
Connected!
GitHub Actions run 2098433335 succeeded.
GitHub Actions run 2102103908 succeeded.
description: How to personalize your discord bot status
A very minor nitpick. You don't need to accept this if you don't want, just figured I'd point it out haha.
Thank you so much for the PR! I really appreciate it! I have a few comments below.
Perhaps instead of having each status/type be a different codeblock, for the first part we could use subheadings and then the code like
#### Setting 'Listening' Status
```py
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="a movie"))
and for the second part we could put it into bullet points?
This part would be unnecessary as it is already in the title.
GitHub Actions run 2106647161 failed.
Connected!
Connected!
Connected!
Connected!
Using nltk the bot could automatically detect topics ( https://towardsdatascience.com/topic-modelling-in-python-with-nltk-and-gensim-4ef03213cd21 for a comprehensive intro) and either automatically suggest to move to a topical/ot channel or it could suggest to check a specific resource that might relate to the topic at hand. Of course there should be a timer (maybe 2 minutes) to avoid spamming.
@jb3 we need your help here
Contributors who do not have access to the host machines, and DevOps team
members with system access that prefer not breaking the entire system when
their Java application deployment fails, we need a place to test changes to
the repository.
Hi @MarkKoz, do you want to sit together with us and work on this?
King Arthur is still connected to Kubernetes, so this will probably have to wait a while.
Yes, but I will likely be learning more than doing due to lack of experience. We'll just need to figure out a good time to work on it.
We don't need Docker to deploy this because it's a cool and good Golang app that we can just gobble onto the machine
8407e12 Add meeting notes for today - jchristgit
[python-discord/infra] New branch created: add\-meeting\-notes\-for\-today
@jb3 thanks to your dictatorship regime I am incapable of merging these
changes myself.
I hope you are aware that you are impairing the hard work of German citizens
with your actions.
@jb3 thanks to your dictatorship regime I am incapable of creating a merge commit myself.
edd3aec Disable fqcn-builtins lint - jchristgit
[python-discord/infra] New branch created: remove\-authoritarian\-linter\-rule\-ruining\-my\-pull\-requests
Closing in favour of #69 which also removes the new problematic linting rule caused by not pinning ansible-lint
Sorry @jb3, I take back all my negative claims I have made to you this evening. I wish you the best of luck in your university exams.
[python-discord/infra] branch deleted: remove\-authoritarian\-linter\-rule\-ruining\-my\-pull\-requests
My immediate reaction to 1 is that it's a wall for people unfamiliar with git right off the bat. "Learn the basics" seems vague and a person's reaction might be that it's a daunting task they will need to undertake before even touching the specific project they want to work on, when really all that's expected is to use a few commands.
What I would consider doing here is, instead of making 1 a point of its own, to just make a preliminary note that development is being done with a versioning...
https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/bot/#issues has a link to the channel, could use it here as well.
My immediate reaction to 1 is that it's a wall for people unfamiliar with git right off the bat. "Learn the basics" seems vague and a person's reaction might be that it's a daunting task they will need to undertake before even touching the specific project they want to work on, when really all that's expected is to use a few commands.
What I would consider doing here is, instead of making 1 a point of its own, to just make a preliminary note that development is being done with a versioni...
You have the source code on your local computer, now how do you actually run it? We have detailed guides on setting up the environment for each of our main projects:
GitHub Actions run 2112740518 succeeded.
GitHub Actions run 2112872507 succeeded.
GitHub Actions run 2113260086 succeeded.
fwiw, I have a PR open on sir-lance to change AoC, might be worth implementing here and closing the sir-lance PR.
[bot-core] Branch minor\-fixes\-to\-BotBase was force-pushed to `5935159`
forcepush to rebase main
I kind of disagree. Our set-up guides are very long. I think keeping them focused will make them less intimidating and implicitly communicate that people should look for non-set up info elsewhere.
What do you think about a little blurb at the top that says something like "This page is for setting up the env. For info on how to get started.." and points to ./contributing?
I took that out because most staff don't need to see it, and all non-staff don't need to see it.
Maybe we could add it to staff on-boarding, or some other internal doc?
GitHub Actions run 2116923107 succeeded.
fwiw, I have a PR open on sir-lance to change AoC, might be worth implementing here and closing the sir-lance PR.
Sure, I'll do it, I was planning to do some work on that, this weekend.
We could hyperlink "fork" to pydis-guides/contributing.md here to provide a really quick and inline link somewhere users may have a question.
GitHub Actions run 2117553945 succeeded.
GitHub Actions run 2117662118 succeeded.
I shortened/cut/merged the first 3 steps
I like that it's easy to see the main links for each step at a glance. Tbh if anything I want to do the same for the creating an issue step.
What kind of versioning would you like to see? Off the top of my head, the snekbox version could just be the commit hash and the API version could be something like semver.
Thanks for the suggestion, but I don't think lowercasing Discord would be in line with the casing in other guides.
For example:
- https://www.pythondiscord.com/pages/guides/python-guides/discordpy/
- https://www.pythondiscord.com/pages/guides/python-guides/discord-embed-limits/
What do you think?
I suggest including the following (rephrasing it, below is a draft):
If you want to change the bot status, it is suggested to not do it during the on_ready event, since it would be called many times and making an API call on that event has a chance to disconnect the bot.
Instead, set the desired status using the activity / status kwarg of commands.Bot, for example
bot = commands.Bot(command_prefix="!", activity=..., status=...)```
GitHub Actions run 2144324015 succeeded.
GitHub Actions run 2144386714 failed.
As of recently, every use of bulk deletion (clean, antispam, purge ban) has proper logging by first storing the messages which are about to be deleted.
If this issue has some sort of benefit e.g abstracting away some of the logic, I suppose we can keep it, but otherwise I suggest we close this.
GitHub Actions run 2144443777 failed.
GitHub Actions run 2145045933 succeeded.
Doc item doc_item.symbol_id='disnake.StoreChannel' present in loaded documentation inventories not found on site, inventories may need to be refreshed.
GitHub Actions run 2151188952 succeeded.
+ f"{space()},{space()}" * (len(elts) == 1)
Why is this necessary? We don't mutate it do we?
This could be a list comprehension (in case that using a for loop wasn't a conscious decision; if you forgot about them).
What do we want to do with this PR (asking others in the events team and core developers)? The event is over already.
I believe the plan is to migrate this to sir-lancebot, so do we merge this first and then move forward with that?
I didn't announce the end of the event until April 4, so I think this PR is fair game to merge.
For other pending issues for blurplify perhaps they should be transferred to sir-lancebot and then stalled until the feature is ported.
@Bluenix2 quote_types can't be modified properly if a list comprehension was used.
Last space() in the f-string is already implemented below that line.
This will require a major revision to be thread-safe. Any ideas for it?
You can add a lock (and a comment) inside of the command that calls this, that would be more light-weight than a threading lock.
Looks good to me! Though before this gets merged, you could implement some of Volccy's feedback.
Looks good to me! Though before this gets merged, you could implement some of Volccy's feedback.
Which ones? I thought I implemented them all
Create an asyncio.Lock and store it in an attribute on the cog. Then, inside of the command enter it using async with self._the_asyncio_lock_name: during the line that runs the formatter with to_thread() (such that the lock is held while it is running).
Connected!
GitHub Actions run 2156933435 succeeded.
As this PR currently is, the resulting URL would be: pages/guides/python-guides/discordpy_help_command/
I think it would be better if this file were titled custom-help-commands.md or something similar. But I believe @Shom770 has plans to rearrange the structure of the discord-bot pin pages once they are all migrated, so I think it's fine if he tweaks the name in a subsequent PR since the URL is likely to change anyway.
[python-discord/site] New comment on pull request #711: add article discussing free hosting services
@Robin5605 @Diabolical5777 and I have discussed adding this content as a section to the existing page which recommends VPS Services.
Having this content on a page where we recommend good VPS options is a better option than having it on its own page because ultimately we want to fast-track the users to the good stuff.
@Robin5605 would you please take on this task?
CC: @Shom770
On [Apr 10, 2022 03:01:49](#help-lollipop message) an occupied help channel was made available again without it going dormant. As a result the original claimant never got the Help Cooldown role removed.
Service logs:
2022-04-11 03:31:47 | bot.exts.help_channels._cog | INFO | Moving #help-lollipop (696432394974265374) to the In Use category.
2022-04-11 03:13:20 | bot.exts.help_channels._cog | INFO | Making #help-lollip...
[python-discord/site] New comment on pull request #711: add article discussing free hosting services
It was [decided](#dev-contrib message) that @Diabolical5777 would continue the work on this instead.
What does "this" refer to?
Not a huge fan that we're showing off internal attributes, but I take it that this was part of the original pin?
Additionally, this entire line is composed as one sentence. Can it be split up?
Can you remove the double-space here?
GitHub Actions run 2162272089 succeeded.
Sorry I think you misunderstood me here, I meant adding new lines like this:
'''
---
You can handle...
GitHub Actions run 2163387219 succeeded.
9d289c3 Adjust filtering settings for the AoC link viewset - D0rs4n
[python-discord/site] New branch created: patch/aoclink
Due to some changes in logic, I had to adjust the filtering settings in the AoC viewset.
GitHub Actions run 2163806743 succeeded.
Connected!
GitHub Actions run 2165630142 succeeded.
GitHub Actions run 2166139186 succeeded.
Looks good to me ๐
Will need a new commit/rebase for netlify to trigger again
GitHub Actions run 2166721560 succeeded.
GitHub Actions run 2166883799 succeeded.
GitHub Actions run 2168648229 succeeded.
In the resource page there is listed no books for free general intermediate so here is a suggestion.
https://inventwithpython.com/beyond/ -> written by the author of automate boring stuff with python AL Sweigart
Also for project ideas a free intermediate/basic book which has a lot of projects in it is:
https://inventwithpython.com/bigbookpython/ -> Al Sweigart
Cool, thanks for the suggestion. The ATBS website isn't amazing but it's a lot better than this one. I wonder why.
I will post transfer this issue to the meta repo and post it in #community-meta for other input.
GitHub Actions run 2174406316 succeeded.
[python-discord/forms-backend] Checks Failed on PR: #159 Bump flake8-annotations from 2.7.0 to 2.9.0
GitHub Actions run 2174407425 failed.
Can you put these as actual docstrings with double quotes: "?
First, a basic walkthrough can be found [here](https://gist.github.com/InterStella0/b78488fb28cadf279dfd3164b9f0cf96) by Stella#2000 on subclassing the HelpCommand. It will provide some foundational knowledge that is required before attempting a more customizable help command.
GitHub Actions run 2175845561 succeeded.
Updated, are single quotes not docstrings?
GitHub Actions run 2175851235 succeeded.
Currently the or-gotcha tag embed looks like:
While the embed is helpful, the first thing the eye is drawn to the first code block, and not the actual text around it. It's very tempting to just look at just the code examples, so I think adding a comment to the first code block to the following might make it clear at a glance that it's meant to be the incorrect way to do it:
# Incorrect
if favorite_fruit == 'grapefruit' or 'lemon':
print("That's a weird favorite frui...
They are, that's why I mentioned that separately from making them actual do strings. That said, they should use double-quotes as that is what we use everywhere!
Rebased onto main. Made resources cog use async setup too, since it was added after this PR was opened.
GitHub Actions run 2177130864 succeeded.
GitHub Actions run 2177145627 succeeded.
4f2a2fd Wait for mod log to load when syncing defcon se... - ChrisLovering
[python-discord/bot] New branch created: improve\-thread\-bump
GitHub Actions run 2177222295 succeeded.
Blocked by #2118
This uses the site api added in https://github.com/python-discord/site/pull/663 to store bumped threads, rather than redis.
This also adds a 10 max lines limit to the paginator when listing, as the embeds can be quite large.
GitHub Actions run 2177227872 succeeded.
GitHub Actions run 2177277503 succeeded.
bdcaf92 Only call unarchive threads if there are thread... - ChrisLovering
Once merged, run the below to send all threads in redis to site.
for thread_id, _ in await bot.get_cog("ThreadBumper").threads_to_bump.items():
await self.bot.api_client.post("bot/bumped-threads", data={"thread_id": thread_id})
GitHub Actions run 2177283042 succeeded.
GitHub Actions run 2177306251 succeeded.
Issue
Every mute, tempban or anything that has a timer always 1 second off.
Example
@ERROR was muted for 1 hour (59 minutes, 59 seconds).
Changes included in this PR
I recommend upgrading to python:3.11.0a7-slim, as this image has only 44 known vulnerabilities.
Some of the most important vulnerabilities in your base image include:
| Severity | Priority Score / 1000 | Issue |
| :------: ...
The vulnerabilities mentioned effect inbound requests only.
As this project does not include a web server that deals with inbound requests, these vulnerabilities do not effect this project.
As it says on the tin.
Currently moderators+ are able to use !slowmode to get and set the slowmode for a given channel.
Let's add support for threads as well!
The proper way to remove a slowmode from a channel is to use !slowmode reset [channel]
However, many moderators often go for !slowmode [channel] 0s
It would be nice to allow this, as it's quite intuitive for most mods.
The current error:
This should likely be kept actually, since it's testing that the syncers are getting instantiated on cog load, so still a useful test.
This and the others below are missing a _ after test
I found several typos in your commit messages if you care to fix them.
cog_unload is still needed to call self._session_scheduler.cancel_all().
cog_unload is still needed to call self.scheduler.cancel_all().
cog_unload is still needed to call self.scheduler.cancel_all().
class MyHelp(commands.HelpCommand):
async def send_bot_help(self, mapping):
"""
This is triggered when !help is invoked.
This example demonstrates how to list the commands that the member invoking the help command can run.
"""
filtered = await self.filter_commands(self.context.bot.commands, sort=True) # returns a list of command objects
names = [command.name for command in filtered] # iterating through the commands ...
Is there any @python-discord/core-developers who can give some insight into how to move forward here?
Please store images in the static directory for content. See https://github.com/python-discord/site/blob/1005229e825a5f2449168bcae2b85667c5799265/pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md?plain=1#L43 for an example of referencing an image in the static directory.
I'll be honest in that I don't think I fully understand all 3 things this fixes, and the fact that they are in one PR and not 3 doesn't help, but I think this looks good!
Thank you for this โค๏ธ
I think we should consider squash-merging this because of 2e0f128ed05e7905ac6d8fb6968a850b5ecb8860
575e86a Reconnect to redis session on setup if it is cl... - ChrisLovering
[python-discord/bot-core] New branch created: redis\-reconnect\-on\-setup
[bot-core] Branch redis\-reconnect\-on\-setup was force-pushed to `9149897`
[bot-core] Branch redis\-reconnect\-on\-setup was force-pushed to `aca37f5`
Why not create the dummy inside _connect_statsd if maximum attempts were reached? Also is this dummy just going to void requests? it won't error or anything?
I read the commit message but I'm not sure I follow why it can't be an Event right away
Since _connect_statsd calls itself on failure up to 8 times, so that would cause the dummy to be created up to 8 times.
We need to create the dummy before erroring since the callback is done with a loop.call_later, so in theory some cogs could already be loaded and trying to use statsd.
The dummy does just void and stats, no errors.
It was done since the class could be instantiated from another event loop to what calls .start(), so this ensures that the Event is always created within the same event loop.
GitHub Actions run 2184647570 succeeded.
[python-discord/bot-core] branch deleted: minor\-fixes\-to\-BotBase
[python-discord/bot-core] branch deleted: redis\-reconnect\-on\-setup
[python-discord/bot-core] New tag created: v5\.0\.2
[python-discord/bot-core] New tag created: v5\.0\.3
87edeff7347f011c2317cd4b3681bea5bbe07185
267f6d94cb10a45f873ea1d0e22f812267be5e69
GitHub Actions run 2184931500 succeeded.
eec5a13cdd430b8010af2c8dca7228d969558e03
a4cd6bc18ec2298cc73567c1796238c4aa27b615 not sure how CI is passing, maybe some dep caching oddity?
6846a4b726cba5da17206b84a3ebd430448a2080
Yup, it can now d62c17b87490500b0d256a2148eb360fe89b81cf
ff6e42c01e924a8f61553615f1bdf918550b3fd6
ff6e42c01e924a8f61553615f1bdf918550b3fd6
ff6e42c01e924a8f61553615f1bdf918550b3fd6
Good point, moved in 21acc03ca5a053881a529ed21e437060205684ac and https://github.com/python-discord/bot-core/pull/61
Yea agreed. This could be changed to just post to #defcon instead.
Forcepush was just to fix spelling in commit messages as pointed out. Only commits ff6e42c01e924a8f61553615f1bdf918550b3fd6 and after need to be reviewed.
c92fc31 Remove unused instance var from OTN cog - ChrisLovering
GitHub Actions run 2184961247 succeeded.
GitHub Actions run 2185011858 succeeded.
Oops! This got 2 empty lines
GitHub Actions run 2185160175 failed.
Can I work on this issue?
Absolutely, Assigned!
Good luck! If you have any questions, don't hesitate to ask!
9b21f52 Remove old task cancellations from modpings cog... - ChrisLovering
9b21f52e1f35face7ec552bd81ff1850c04dbe22
GitHub Actions run 2185792837 succeeded.
1fa0bbb Add discord.Thread to slowmode cog channel conv... - ichard26
[python-discord/bot] New branch created: slowmode/add\-better\-thread\-support
[bot] Branch slowmode/add\-better\-thread\-support was force-pushed to `af1fa49`
Important as we (further) rollout threads and forum channels!
Resolves GH-2131.

Top is with the patch and the bottom is without ๐
GitHub Actions run 2185999296 succeeded.
GitHub Actions run 2186134763 succeeded.
Hi Chris,
Thank you for your tremendous efforts in getting the bot up to date. I am sure the rest of the team is filled with excitement at the prospect of using all the new features and maintaining a slimmer code base thanks to your work on bot-core.
I went through every commit and every line. Looks like everything is order. Notwithstanding, there are many changes, and it is easy for my eyes to miss something. Unfortunately, I did not run any of the code, nor do I really have time to do...
Hi Chris,
Thank you for your tremendous efforts in getting the bot up to date. I am sure the rest of the team is filled with excitement at the prospect of using all the new features and maintaining a slimmer code base thanks to your work on bot-core.
I went through every commit and every line. Looks like everything is order. Notwithstanding, there are many changes, and it is easy for my eyes to miss something. Unfortunately, I did not run any of the code, nor do I really have ...
Just noticed this. How come this is not passed to the constructor? I realise BotBase does not accept it as an argument, but why not?
Using the synchronous resolver probably doesn't have a huge impact. Is switch to the async resolver worth the cost of implementation?
48f7742 Allow passing an api_client kwarg to BotBase - ChrisLovering
[python-discord/bot-core] New branch created: BotBase\-api\_client\-kwarg
[bot-core] Branch BotBase\-api\_client\-kwarg was force-pushed to `355aa8c`
Yea agreed, it should. Raised bot-core/pull/63 for this.
Is that trailing underscore supposed to be there?
Shouldn't it be something like this (not sure how exactly sphinx wants it)?
api_client: The `APIClient` instance to use for the bot.
- Feature: Allow passing an `api_client` to `BotBase`.`__init__` to specify an `APIClient` instance to use.
Yea, it "names" the object, allowing for the hyper linking at the end of the docstring.
[bot-core] Branch BotBase\-api\_client\-kwarg was force-pushed to `4ea49b5`
[bot-core] Branch BotBase\-api\_client\-kwarg was force-pushed to `8cff0d1`
I'm not 100% sure if this was the solution you guys were looking for, but it works.

GitHub Actions run 2186618238 failed.
This isn't necessarily the expected behavior. This behavior means that any invalid duration will reset the slowmode, while the behavior outlined in the issue is to just make an exception for "0s".
You could check for the value of the string, or you could make use of the converters and make the delay a union of DuraitonDelta and a Literal["0s"]
I guess netlify deployments have just been broken for a while now?
a4eda4a Adjust filtering settings for the AoC link viewset - D0rs4n
[python-discord/site] branch deleted: patch/aoclink
GitHub Actions run 2186811413 succeeded.
Can a core dev comment/confirm: I just realized the !defcon threshold command supports passing just 0 (without the s). Could we add support for 0 to this command as well?
I guess netlify deployments have just been broken for a while now?
Yea seems like it, see #dev-core message and down for a discussion about it in core dev.
[python-discord/bot-core] branch deleted: BotBase\-api\_client\-kwarg
[python-discord/bot-core] New tag created: v5\.0\.4
cbca93e Move api_client to a kwarg on creation of the Bot - ChrisLovering
2335970 Move the creation of BotBase._guild_available t... - ChrisLovering
863e54f Create a dummy AsyncstatsdClient before connect... - ChrisLovering
5935159 Bump version number and log change - ChrisLovering
aca37f5 Reconnect to redis session on setup if it is cl... - ChrisLovering
1ca68b7 Merge pull request #56 from python-discord/mino... - ChrisLovering
GitHub Actions run 2188801131 succeeded.
For this, I would suggest instead of using literal, we do the same as what defcon has. https://github.com/python-discord/bot/blob/main/bot/exts/moderation/defcon.py#L163-L178
This Unions the DurationDelta with an int, if it's an int defcon assumed it's a number of days, for this we could assume a number of seconds and then use that
cbca93e556363bf2c878956730297953be2e62d5
GitHub Actions run 2189086374 succeeded.
0cff5ca Don't pass unused param to infraction scheduler... - ChrisLovering
04ca07b Don't set ctx on the help_command as this is no... - ChrisLovering
GitHub Actions run 2189224544 was cancelled.
GitHub Actions run 2189230806 succeeded.
GitHub Actions run 2189327992 succeeded.
For this, I would suggest instead of using literal, we do the same as what defcon has. https://github.com/python-discord/bot/blob/main/bot/exts/moderation/defcon.py#L163-L178
This Unions the DurationDelta with an int, if it's an int defcon assumed it's a number of days, for this we could assume a number of seconds and then use that
I don't mind, but the reason for this PR is that people are trying to use "0s" specifically
For this, I would suggest instead of using literal, we do the same as what defcon has. https://github.com/python-discord/bot/blob/main/bot/exts/moderation/defcon.py#L163-L178
This Unions the DurationDelta with an int, if it's an int defcon assumed it's a number of days, for this we could assume a number of seconds and then use thatI don't mind, but the reason for this PR is that people are trying to use "0s" specifically
Is there a specific reason that the duration delta d...
- Regarding the OP, I don't think it's necessary for all error messages to be in the same format. The bot is massive and is comprised of extensions, some of which have their own unique aspects. For example, the default error message for a bad or missing argument is handled by the error handler and is posted as an embed, but for some moderation commands there might be errors which are out of the moderator's control (e.g the member left the server). In the latter case it's more useful to have ...
@ChrisLovering durationdelta is used in all time related commands, including infractions, reminders, and clean. A 0 duration makes no sense there and will most likely break a few things.
@ChrisLovering durationdelta is used in all time related commands, including infractions, reminders, and clean. A 0 duration makes no sense there and will most likely break a few things.
Ah good point, this is probably best then, the alternative is to make a new convertor that accepts 0 delta durations.
fab7da4 Bump discord.py to https://github.com/Rapptz/di... - ChrisLovering
83808e9 Bump sphinx-autodoc-typehints to 1.18.1 - ChrisLovering
[python-discord/bot-core] New branch created: bump\-d\.py
This bumps discord.py to the latest commit, which has a bunch of bug fixes.
Notably, it reverts a change to help command behaviour that broke our custom pagination, along with adding basic forum channel support to discord.py
This also bumps sphinx-autodoc-typehints to latest
GitHub Actions run 2189792640 succeeded.
Ah good point, this is probably best then,
I see, this pull request is ready to be reviewed then.
GitHub Actions run 2190213373 succeeded.
Can't test the code right now, so only have a styling request.
async def set_slowmode(
self,
ctx: Context,
channel: Optional[TextChannel],
delay : Union[DurationDelta, Literal["0s", "0seconds"]],
) -> None:
To be consistent with how we format other function signatures in the bot
Can't test the code right now, so only have a styling request.
Resolved, thanks.
GitHub Actions run 2190323129 failed.
Hi @Shom770, what's the status on this PR?
[python-discord/bot-core] branch deleted: bump\-d\.py
fab7da4 Bump discord.py to https://github.com/Rapptz/di... - ChrisLovering
83808e9 Bump sphinx-autodoc-typehints to 1.18.1 - ChrisLovering
98a5cc0 Merge pull request #64 from python-discord/bump... - ChrisLovering
[python-discord/bot-core] New tag created: v6\.0\.0
f284cff Bump bot-core for new discord.py version - ChrisLovering
a90c844 Utilise new on_thread_create event for modlog - ChrisLovering
GitHub Actions run 2190830890 failed.
GitHub Actions run 2190872808 succeeded.
GitHub Actions run 2192297082 was cancelled.
GitHub Actions run 2192297941 succeeded.
@Robin5605 @MaskDuck I think there was a PR pending for this blurplify on sir-robin still. Has that been merged yet?
Great PR! Just some small things. I haven't tested this, but noticed it was being tested on the test server so should be fine. Might try and play around with it if I get a chance.
Pretty sure this contextlib.suppress isn't needed.
Looking through the blame it seems this code used to use next but removing this was missed when switching to a for loop
Minor, but it does seem auto can be used even without psutil, it just falls back to stuff in the stdlib which may be a bit less accurate. Also fine to leave it at 8, I don't mind.
https://github.com/pytest-dev/pytest-xdist/blob/29c4cce1d45fe317f78778b8eb0d7de681cb7290/src/xdist/plugin.py#L16-L44
Similar idea to above, I think this could just use get_or_fetch_channel and then send it normally, maybe also better saved for a different PR.
This I added it while fixing the tests, then fixed it another way and forgot to remove this line. Nice spot https://github.com/python-discord/bot/pull/2118/commits/03a8c8138c53b6582a0921b3dcf7a1b7d55877de
GitHub Actions run 2198039992 succeeded.
06aabf7 Don't use internal discord.py methods for avail... - ChrisLovering
Was an easy enough fix, this it's worth it with being on alphas branch and all right now.
https://github.com/python-discord/bot/pull/2118/commits/06aabf77b0261425539801e46d19a0560174f3c4
Was an easy enough fix, this it's worth it with being on alphas branch and all right now.
https://github.com/python-discord/bot/pull/2118/commits/06aabf77b0261425539801e46d19a0560174f3c4
GitHub Actions run 2198092254 succeeded.
b28ad5e Automatically determine number threads to use w... - ChrisLovering
Ah, that's good to know. I've tried it on both windows and linux, seems to work fine. Worst case is that it just uses 1 threads for testing, which is fine in those edge cases I guess.
https://github.com/python-discord/bot/pull/2118/commits/b28ad5e3222df195db8090d4e8a69d7d19f604c6
GitHub Actions run 2198106160 succeeded.
As this was changed to a for loop it wont raise any more, instead just continuing execution without returning if there are no messages. Removing the try/except to give something like this should fix that:
async for message in channel.history(limit=1):
return message
log.debug(f"No last message available; #{channel} ({channel.id}) has no messages.")
return None
Changes all look good - managed to give it a quick test run and everything I tried worked nicely! Just one thing I noticed.
b9a6c9e Refactor a try/except that will never raise - ChrisLovering
GitHub Actions run 2198309901 succeeded.
f1ff14c Remove aio-pika and psutil - ChrisLovering
bd13ed6 Bump all deps and exact version pin. - ChrisLovering
4dab419 Bump d.py and bot-core - ChrisLovering
43b6fee Use bot-core scheduling and member util functions - ChrisLovering
4635c31 Don't use discord.NoMoreItems as it's removed - ChrisLovering
[python-discord/bot] branch deleted: bump\-d\.py\-version
17ae32a Don't call broken ModPings scheduler - ChrisLovering
[python-discord/bot] New branch created: fix\-modpings
GitHub Actions run 2198393394 succeeded.
GitHub Actions run 2198415702 succeeded.
Connected!
2d5725b Don't try to get modlog cog on defcon cog_load - ChrisLovering
[python-discord/bot] New branch created: dont\-use\-modlog\-for\-defcon
Instead get the cog at runtime, and deal with the case where it isn't loaded
GitHub Actions run 2198508839 succeeded.
Connected!
9949f1a Use the extensions list & util from bot-core - ChrisLovering
[python-discord/bot] New branch created: Use\-bot\-core\-extensions
Currently the bot is still using the extensions utils from within the bot, which isn't the actual list of extensions loaded, causing the any interaction with EXTENSIONS to be incorrect.
GitHub Actions run 2198583567 succeeded.
03e12c3 Add unqualify to the utils namespace - ChrisLovering
[python-discord/bot-core] New branch created: Add\-unqualify\-to\-the\-util\-namespace
I really think the solution here is to either:
- Move stuff like this into shared util files if possible
- or make the cog loading order deterministic so we know what we're dealing with.
We should probably do 2 regardless, so we stop running into issues where this doesn't cause problems in testing or CI, but fails in prod. Approving as a stopgap.
[bot-core] Branch Add\-unqualify\-to\-the\-util\-namespace was force-pushed to `692e750`
This is for bots that want to use the unqualify function for their own extension cogs
[bot-core] Branch Add\-unqualify\-to\-the\-util\-namespace was force-pushed to `aa43f9d`
[python-discord/bot-core] branch deleted: Add\-unqualify\-to\-the\-util\-namespace
[python-discord/bot-core] New tag created: v6\.1\.0
f4fb8cd Bump bot-core which has unqualify in the utils ... - ChrisLovering
GitHub Actions run 2198646809 succeeded.
[bot] Branch dont\-use\-modlog\-for\-defcon was force-pushed to `b5fac9b`
GitHub Actions run 2198692336 failed.
[bot] Branch dont\-use\-modlog\-for\-defcon was force-pushed to `969bd03`
GitHub Actions run 2198716524 succeeded.
Thank you this is good.
I don't want to nit-pick the grammar too much but this is understandable.
I will be taking a look at some of your other PRs, as I see some other open.
This has the same issue as I commented about in your last PR. there is a double-space here.
description: "Subclassing the discord.py Bot class to add more functionality and customisability."
First, a [basic article](https://www.codesdope.com/course/python-subclass-of-a-class/) on subclassing will provide some fundamental knowledge, which is highly suggested before moving on to this topic, as subclassing [`Bot`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot) can ultimately be a complicated task.
GitHub Actions run 2199148400 failed.
GitHub Actions run 2199170057 failed.
This is invalid syntax, if you wish to have the user fill in something please add ...
This example, was in-fact, not very short ๐
This line is waaaaaaaaaaaaaaayyyyyyyy too long
Why use a nested header rather than just #?
This also needs a trailing period.
What does "an SSL certificate error" mean? Shouldn't we specify which one, and why?
Can you download this screenshot and put it in the static folder?
It should be uppercased because it is referring to Discord (the app/company) and not "discord" the word.
Can you give a little intro before this, and then make this an actual header?
The two empty lines between these is unnecessary
If you want to change the bot status, it is suggested to not do so during the on_ready event, since it would be called
These three empty lines is a bit much, don't you think?
There's a typo in "disadvantages" here
How can "below" (preposition) discuss something? I am confused.
Can you split this into multiple lines somewhere? It is very hard to edit on most editors because they commonly don't wrap.
This is missing a trailing period.
Yeah I still think these should be split into multiples lines capping at like 120 which is what Python Discord uses for code
Since this doesn't assume any Git/GitHub knowledge do we want to explain forking?
I don't follow, is this just a link that is flying out in nowhere?
Sentry Issue: BOT-33N
TypeError: wait_for() got some positional-only arguments passed as keyword arguments: 'event'
File "discord/client.py", line 375, in _run_event
await coro(*args, **kwargs)
File "bot/exts/moderation/incidents.py", line 553, in on_raw_reaction_add
await self.process_event(str(payload.emoji), message, payload.member)
File "bot/exts/moderation/incidents.py", li...
a1b66d5 wait_for event param is now positional only - ChrisLovering
[python-discord/bot] New branch created: remove\-wait\_for\-kwarg
Closes #2139 Closes BOT-33N
GitHub Actions run 2200538311 succeeded.
Sentry Issue: SITE-25
ValueError: Unknown format code 'X' for object of type 'str'
(16 additional frame(s) were not displayed)
...
File "django/template/defaulttags.py", line 211, in render
nodelist.append(node.render_annotated(context))
File "django/template/base.py", line 905, in render_annotated
return self.render(context)
File "django/template/base.py", line 988, in render
...
9e6cbbe Support color string being when converting to h... - ChrisLovering
[python-discord/site] New branch created: support\-string\-colors
Int he latest version of discord.py Embed colours could be sent to site as hex strings, if set using a discord.Color, rather tha an int.
Closes #715 Closes SITE-25
GitHub Actions run 2200641811 failed.
GitHub Actions run 2200714805 succeeded.
Sentry Issue: BOT-33P
HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In message_reference: Unknown message
(2 additional frame(s) were not displayed)
...
File "bot/exts/moderation/clean.py", line 444, in _clean_messages
await ctx.reply(success_message)
File "discord/ext/commands/context.py", line 544, in reply
return await self.send(content, reference=self.m...
ca8a947 Deal with the clean invoke being delete before ... - ChrisLovering
[python-discord/bot] New branch created: supress\-notfound\-when\-cleaning
Closes #2141 Closes BOT-33P
GitHub Actions run 2200767412 succeeded.
GitHub Actions run 2201128666 succeeded.
GitHub Actions run 2201459810 succeeded.
GitHub Actions run 2201461395 succeeded.
GitHub Actions run 2201462902 succeeded.
Can you provide the text to replace if you don't mind
GitHub Actions run 2201594736 succeeded.
Very nice. I have to say though, the code using color and colour like that is only slightly terrifying.
Very nice. I have to say though, the code using
colorandcolourlike that is only slightly terrifying.
Agreed, I didn't like that it was like that either, since you've mentioned it too, I've decided to fix it :D
GitHub Actions run 2201827834 succeeded.
Works correctly during testing. In place of the cog loading check, could we also send a message to the defcon channel if the mod log cog isn't loaded by then? That would at least give us a heads up to reload defcon before logs start coming in.
my approvedness has ascended
[python-discord/bot] New branch created: mbaruh/modlog\_fix
[bot] Branch dont\-use\-modlog\-for\-defcon was force-pushed to `bba7242`
GitHub Actions run 2202302880 succeeded.
Use fail_if_not_exists = False, rather than catching a NotFound
Tested using the incidents queue, works as expected.
Use
fail_if_not_exists = False, rather than catching a NotFound
Is that an option on ctx.reply? It's not documented here or on the Message object
https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Context.reply
[python-discord/bot] branch deleted: remove\-wait\_for\-kwarg
Connected!
Connected!
GitHub Actions run 2203554782 succeeded.
The removed file is specified in the codeowners file, should probably be removed.
GitHub Actions run 2203574822 failed.
I believe the issue we were encountering is that the timeout previously was not long enough (so it failed before modlog had had a chance to load). It's possible we might be able to work out a neater solution in the future, but I think this should solve our immediate problems.
Thanks for the suggestion, but I don't think lowercasing Discord would be in line with the casing in other guides.
For example:
https://www.pythondiscord.com/pages/guides/python-guides/discordpy/
https://www.pythondiscord.com/pages/guides/python-guides/discord-embed-limits/
What do you think?
That makes sense, I didn't think of that haha
ec3012d Load each cog in it's own task - ChrisLovering
[python-discord/bot-core] New branch created: load\-extensions\-in\-tasks
[python-discord/bot] branch deleted: dont\-use\-modlog\-for\-defcon
GitHub Actions run 2203996248 succeeded.
[python-discord/bot-core] branch deleted: load\-extensions\-in\-tasks
[python-discord/bot-core] New tag created: v6\.2\.0
rebased onto main and pushed code owners changes
[python-discord/bot] branch deleted: Use\-bot\-core\-extensions
That was sort of the intention of this clause
to create a copy under your own GitHub account
Do you think it needs more?
GitHub Actions run 2204123738 succeeded.
GitHub Actions run 2204153705 succeeded.
This section was merely moved from elsewhere, and I don't want to extend the scope of this PR any further
This section was merely moved from elsewhere, and I don't want to extend the scope of this PR any further
GitHub Actions run 2204177320 succeeded.
GitHub Actions run 2204249897 succeeded.
486db99 Don't look for extensions in packages prefixed ... - mbaruh
[python-discord/bot-core] New tag created: v6\.3\.0
[python-discord/bot-core] New branch created: mbaruh/document
[python-discord/bot-core] branch deleted: mbaruh/document
[python-discord/bot] New branch created: bump\-bot\-core
This change loads each cog in their own task, meaning if one fails, others still load.
[python-discord/site] branch deleted: support\-string\-colors
GitHub Actions run 2204357545 succeeded.
GitHub Actions run 2204353385 was cancelled.
GitHub Actions run 2204370479 succeeded.
GitHub Actions run 2204070235 failed.


