GitHub Actions run 1339321050 succeeded.
#dev-log
1 messages ยท Page 86 of 1
I'd be down to work on this! I'm not sure if this would require any database experience though because I've only worked with MongoDB and I don't know how any other databases work (like redis and what not)
@Shom770 mind if I join you on this one?
Connected!
@Shom770 mind if I join you on this one?
I don't mind! It would actually be helpful to have someone else help out.
GitHub Actions run 1339326502 succeeded.
I would love to help as well, but I'm realizing I might not be able to because I have school and I'm also working on another PR right now. In any case though, the idea of the event is super cool and would love to attend if I get the chance. Thanks so much for putting this together, @janine9vn
This new dependency currently has two licenses in the repo, and neither in the metadata. Until this is fixed upstream we cannot merge this PR.
Since the code is licensed in the repository, that applies to the Metadata as well, so wouldn't it be possible to whitelist this package and pin the version?
@Kronifer @Shom770 you two are assigned. Feel free to bug me for any questions about how this should function.
Yeah @TizzySaurus, I have the
TIMEOUT = 60.0just below the imports and theawaitstatement right before the class definition. Is that ok?
The TIMEOUT placement seems good, but I don't understand the seemingly random placement of the wait_for. Where it is right now won't work at all since it needs to be inside an async function -- presumably the command function or something (wherever you need the message input).
It has two differing licences in the repo, so until the project decides what license it should have, we don't know what we need to comply with.
Ok, so would this be acceptable? @TizzySaurus

Issues can have empty bodies, in this case GitHub doesn't include the key in the API response
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes GH-907
Description
Used a .get() in order to fill in the issue body.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant disc...
GitHub Actions run 1339789321 succeeded.
Relevant Issues
Discussion:

<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Currently, if you try a beta language for the challenge command, it will raise an error because codewars API is still unstable for it, so I made a fix to say that the difficulty could not be retrieved yet still allow the embed to be s...
GitHub Actions run 1339883530 succeeded.
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #903
Description
This is for the trivia night event, and will be the implementation of it into sir lancebot.
There are a few main commands:
.trivianight load (file)
This will load the JSON file attached as the questions for the cog to handle for when the event starts.
.trivianight start
This will begin the event (this could possibly send an embed regard...
GitHub Actions run 1340024482 succeeded.
Description
A community costume catalogue would allow users to
- Look through and use a catalogue of "costumes"
- Rank those costumes using a simple upvote/downvote system
- Contribute their own costumes to the catalogue
Each "costume" would be a .png of the "costume", as well as the costume name and author
For looking through a catalogue, a simple paginator could be set up, displaying the title costume name, the costume, how many points it has. It'll also have an opti...
GitHub Actions run 1340405846 succeeded.
GitHub Actions run 1340438621 succeeded.
Sentry Issue: SIR-LANCEBOT-6T
AttributeError: 'NoneType' object has no attribute 'replace'
File "bot/exts/utilities/challenges.py", line 168, in main_embed
color=MAPPING_OF_KYU[int(kata_information["rank"]["name"].replace(" kyu", ""))],
File "bot/exts/utilities/challenges.py", line 310, in challenge
kata_embed = self.main_embed(kata_information)
File "discord/ext/commands/core.p...
@Shom770 has solved that as part of #909 :+1:
(for some reason GitHub won't let me assign them so commenting instead)
Two minor things I'd like changed :+1:
I think it would be better to do the same as what you're doing with embed_color and store this in a variable (kata_difficulty or something).
If you're just doing pass here, then the if statement can be removed (it's bad practice to have an empty if-statement in production).
NB: Removing will likely mean you have to edit the elif statement to be accurate and only run when you want it to. If I'm understanding the code correctly, it would become
if all((
not language, # would be better to do `language is None` or whatever the falsey value here is
query, # would be better to do `query is not None` or whateve...
Haven't tested, but all looks good :+1:
Connected!
GitHub Actions run 1341904442 succeeded.
GitHub Actions run 1342036810 succeeded.
@HassanAbouelela once this is possible I'd like to give this a try
@WillDaSilva I don't think Python Discord's projects will be participating in Hacktoberfest 2021. In any case, I don't know what the consensus on this issue is.
@MarkKoz from what I've seen we will not be participating
I don't think this is needed as discord now warns you before you send a token
I'll work on this if it's still open
GitHub Actions run 1342274286 succeeded.
[python-discord/bot] New branch created: experiments/isort
[python-discord/bot] New branch created: modlog\-ingore\-channels\-mods\-can't\-view
Preface
PLEASE DO NOT MERGE MAIN INTO THIS PR. YES THAT MEANS YOU!
This is based on top of #1815, so will need rebasing and retargeting onto main once that is merged, before merging this PR.
Description
The main purpose of this is so that we don't need to keep adding to the modlog_blacklist for every new channel we want to ignore, since it now implicitly ignores channels mods don't have read perms to.
This is done by making use of Discord.py 2.0's updated behaviour of Channel....
GitHub Actions run 1342478905 succeeded.
What is Isort?
[PyCQA/ISORT] (https://github.com/PyCQA/isort) is a fantastic hyper configurable tool that will magically sort your imports so you don't have to care about them.
It also comes with a precommit hook. Quite an awesome tool in my opinion.
What is this PR?
This is an experiment PR, we may want to merge it, we may not want to. I set up Isort with a style that matches our current one as much as possible, and generated a quite minimal diff (https://github.com/python-discor...
GitHub Actions run 1342623687 failed.
Hey @Kronifer, after making this issue, I found out Zig is adding it to his PR, which I linked to this.
Problem
Currently, our watch channels, such as bigbrother use embed footer to display additional information about the person being watched. Due to using footer, some things don't get formatted, things such as time formatted strings, hyperlinks, etc.
Example:

Proposed Solution
I think simplest, and most future-proof solution would be simply moving the text from footer ...
GitHub Actions run 1342852138 succeeded.
Thinking more on it, I'm not sure it's worth the time investment, as far as I can tell it only really protects us against the case where connection the the mongo db fails and the bot reboots within 5 minutes, and in that case it would just lead to the ping not going through, which isn't the end of the world.
Shortly discussed here #mod-tools message
I like this change, so will +1
GitHub Actions run 1343316268 succeeded.
Connected!
GitHub Actions run 1343322056 succeeded.
@mbaruh may you resolve the conflicting files? Thanks!
[python-discord/bot] branch deleted: solve\-bot\-1852
GitHub Actions run 1343334783 succeeded.
445bc45 Send the user's mention in the watch command.... - Qwerty-133
[python-discord/bot] branch deleted: watch\-output
GitHub Actions run 1343342262 succeeded.
Connected!
GitHub Actions run 1343352533 was cancelled.
GitHub Actions run 1343357300 succeeded.
53e3d22 Distinguish between note/warning and expired in... - TizzySaurus
3c3de7d Merge branch 'main' into solve-bot-1852 - ChrisLovering
cf4533d Merge pull request #1861 from python-discord/so... - ChrisLovering
445bc45 Send the user's mention in the watch command.... - Qwerty-133
7c4e928 Merge branch 'main' into fix-infract-then-dm - ChrisLovering
[python-discord/bot] branch deleted: fix\-infract\-then\-dm
acc3e6f Attempt infraction before DMing - TizzySaurus
d01dd7d Merge branch 'main' into fix-infract-then-dm - TizzySaurus
1df1527 Remove redundant else clauses - TizzySaurus
371869a Only send DM before applying infraction for ban... - TizzySaurus
cb3c980 Merge branch 'main' into fix-infract-then-dm - HassanAbouelela
GitHub Actions run 1343482048 succeeded.
Connected!
1f4b65d Send !defcon threshold message in channel a... - TizzySaurus
[python-discord/bot] branch deleted: defcon\-redirect\-fix
GitHub Actions run 1343489586 succeeded.
Connected!
cbbaf2f Add a contribute tag which explains how to cont... - janine9vn
[python-discord/bot] branch deleted: contributing\-tag
GitHub Actions run 1343496734 succeeded.
Connected!
GitHub Actions run 1343509368 succeeded.
GitHub Actions run 1343545242 succeeded.
@TizzySaurus where are you saying that we're checking if the mention is for a role? To me, it looks like we just return False whenever (1) the user isn't staff or (2) the user isn't a mod.
How would it ever return true if it fails on the "elif not mod" line?
GitHub Actions run 1343570652 succeeded.
GitHub Actions run 1343582118 succeeded.
@gustavwilliam
all(isinstance(mention, discord.Member) for mention in mentions)
is ensuring there's no discord.Role mentions.
If all mentions are discord.Member, then it'll return True, "roles"
Approving on @ChrisLovering's behalf.
[python-discord/bot] branch deleted: custom\-logger\-class
Connected!
GitHub Actions run 1343611487 succeeded.
[python-discord/sir-lancebot] branch deleted: fix\-pascal\-triangle\-image
GitHub Actions run 1343627506 succeeded.
It seems like the reason that this fails is that even though the mentions are converted to mentions: t.Iterable[Mentionable] if a user id is passed into the command, it gets converted to a User object within the iterable, which fails the isinstance(mention, discord.Member) condition.
Connected!
GitHub Actions run 1343629866 succeeded.
It seems like the reason that this fails is that even though the mentions are converted to
mentions: t.Iterable[Mentionable]if a user id is passed into the command, it gets converted to a User object within the iterable, which fails theisinstance(mention, discord.Member)condition.
Right, that makes sense. I guess the isinstance should be updated to isinstance(mention, (discord.User, discord.Member))?
Yea that should work
Will make a PR then :+1:
[python-discord/bot] New branch created: fix\-bot\-1869
Closes #1869.
As the title says, the check should now work.
Haven't tested just yet, but this should fix the issue.
r"((?<!\w)([\.,]|dot))gg" # or .gg/
We should make this a negative lookbehind for a word char, rather than a non-word boundary, since . isn't a word character
GitHub Actions run 1343654765 succeeded.
Looks like we've missed a datetime here
https://github.com/python-discord/bot/blob/main/bot/exts/moderation/defcon.py#L114
now is datetime.utcnow() so it naive.
FWIW I think we shouldn't be stripping the tzinfo from timestamps from discord, but instead should be using arrow.utcnow() instead of datetime.utcnow() in those cases since arrow.utcnow() is aware
Description
If no arguments are provided for the XKCD command, it finds the latest comic it fetched within the current half an hour and sends it to the user. There is no error handling if we run the command just as the bot starts i.e. the task won't be able to get finished and we won't be able to get the latest, thereby raising the below error:

Steps to Reproduce
- Ru...
I would prefer this, it is actually only discord.Member that supports the methods we're trying to use and it reads better.
This doesn't need to be extra indented if we flip the if-statement to just return early right?
Can you remove this then? You can keep it in your local changes files but no need to keep it in Git.
This is getting deprecated and removed in future releases.
You're supposed to use asyncio.run() but that proposes some other issues.
msg, error = await self.manage(action, extensions[0])
return msg, [] if error else [extensions[0]]
I think this is clearer, we only pass extensions[0].
The get_X methods don't raise discord.NotFound.
They return None, which you don't handle here.
# Remove extensions from the unload extensions cache
[python-discord/bot] branch deleted: fix\-bot\-1869
Connected!
GitHub Actions run 1345005750 succeeded.
If you're referring to L130 then no, since we still need to run the code below (pinning message etc.)
[python-discord/quackstack] New branch created: vcokltfre/fix/misc\-fixes
Simple PR to fix a couple of things:
- Renamed the
generate_tempaltefunction togenerate_template - Fixed the order in which modules are imported
24037ef chore: standardise caps in ManDucky - vcokltfre
c46223a Actions: do not check licenses of dev packages - Akarys42
ded5dc3 chore: remove flake8 import order in favour of ... - vcokltfre
[python-discord/quackstack] New branch created: vcokltfre/chore/remove\-flake8\-import\-order
Similar to bot#1872 this removes flake8 import order and replaces it with isort
[python-discord/quackstack] branch deleted: vcokltfre/chore/remove\-flake8\-import\-order
acc3e6f Attempt infraction before DMing - TizzySaurus
d01dd7d Merge branch 'main' into fix-infract-then-dm - TizzySaurus
53e3d22 Distinguish between note/warning and expired in... - TizzySaurus
1df1527 Remove redundant else clauses - TizzySaurus
371869a Only send DM before applying infraction for ban... - TizzySaurus
GitHub Actions run 1345273810 failed.
[python-discord/quackstack] branch deleted: vcokltfre/fix/misc\-fixes
acc3e6f Attempt infraction before DMing - TizzySaurus
d01dd7d Merge branch 'main' into fix-infract-then-dm - TizzySaurus
53e3d22 Distinguish between note/warning and expired in... - TizzySaurus
1df1527 Remove redundant else clauses - TizzySaurus
371869a Only send DM before applying infraction for ban... - TizzySaurus
GitHub Actions run 1345351942 succeeded.
GitHub Actions run 1345366410 succeeded.
so you want to catch ..gg/link? Sure enough
0186caa Regex: replace the word boundary by a word char - Akarys42
FWIW I think we shouldn't be stripping the tzinfo from timestamps from discord, but instead should be using arrow.utcnow() instead of datetime.utcnow() in those cases since arrow.utcnow() is aware
Would there be a difference between the two?
GitHub Actions run 1345392097 succeeded.
a791dac Defcon: remove tzinfo from member.created_at - Akarys42
574f610 Voice gate: set tzinfo to None in author.joined_at - Akarys42
FWIW I think we shouldn't be stripping the tzinfo from timestamps from discord, but instead should be using arrow.utcnow() instead of datetime.utcnow() in those cases since arrow.utcnow() is aware
Would there be a difference between the two?
No functional difference with just this change, but rather since Discord.py now uses aware, it's probably better we use aware too, rather than changing Discord.py's to naive, this also encourages the use of arrow with our contribs, which has...
Looks good from my testing, my comment about using arrow.utcnow() rather than stripping tzinfo from D.py's dates isn't required.
discord.User.avatar is actually Optional, you need to change it to discord.User.display_avatar.
acc3e6f Attempt infraction before DMing - TizzySaurus
d01dd7d Merge branch 'main' into fix-infract-then-dm - TizzySaurus
53e3d22 Distinguish between note/warning and expired in... - TizzySaurus
1df1527 Remove redundant else clauses - TizzySaurus
371869a Only send DM before applying infraction for ban... - TizzySaurus
GitHub Actions run 1345427264 failed.
GitHub Actions run 1345457651 succeeded.
Is the whole context object required here? As far as I can see, you only need to pass in a user object, that may make it more obvious about what the purpose of passing this in is.
c998d47 Move subdomains to query paths. - jchristgit
fa4a8dd Merge branch 'master' into subdomains-to-query-... - jchristgit
3699245 Merge branch 'main' into subdomains-to-query-paths - jb3
2bf473e Remove code jam notice from front page - janine9vn
a7afdf4 Update wording on main Events page - janine9vn
GitHub Actions run 1346776146 succeeded.
site_api: &API !JOIN [*DOMAIN, "/api"]
This change is needed since we removed subdomains
If you're using the Docker image provided in the project's docker-compose, open your `config.yml` file, set `bot.redis.host` to `redis`, `bot.redis.password` to `null`, and `bot.redis.use_fakeredis` to `false`.
site_staff: &STAFF !JOIN [*DOMAIN, "/staff"]
This change is needed since we removed subdomains
9325c79 Do not try to calculate expiry if infraction is... - ks129
[python-discord/bot] New branch created: ks123/bugfix/reapply\-infraction
Fixes #1870
Currently, if a user with permanent mute rejoins, it still tries to calculate the remaining time from None. This PR removes calculation for infractions where expiry is None.
GitHub Actions run 1348568922 succeeded.
I like this.
"some bash madness to only check the license of our prod deps"
why's that though? Does it break on isort?
[tool.isort]
multi_line_output = 6
order_by_type = false
case_sensitive = true
combine_as_imports = true
line_length = 120
atomic = true
known_first_party = ["bot"]
[python-discord/bot] branch deleted: experiments/isort
Connected!
GitHub Actions run 1348964175 succeeded.
@Xithrius after some thought I don't think I'm available to deal with this PR atm. I don't mind closing it for now, but maybe you have something else in mind.
It doesn't show the channels, this is something that I noticed the anti-spam needs too. I'm leaving it for a separate PR (needs to be on site as far as I can tell).
The reason I wrote it like this is because I'm mirroring the type check handling that was added to converters.py ( #1731 ). The aliases above the condition are used as short-hands in function declarations, while here it's used to appease the type checkers in IDE's.
Whether or not it makes sense to have them together is something I'm not sure of, but it made sense to me to keep them apart for semantic reasons.
I don't particularly mind adding it here and in the other instance, although the purpose of raising BadArgument is for it to be posted on Discord by the error handler, so I don't see the traceback being used.
Hi, /robots.txt returns 404 so I'm assuming it isn't added yet. Can I work on this please?
Hi,
/robots.txtreturns 404 so I'm assuming it isn't added yet. Can I work on this please?
Hi, this was discussed here https://github.com/python-discord/site/pull/586#issuecomment-940710000 and it was decided that a worker would be used.
Oh ok, the PR didn't link this issue so I didn't see that.
Hi,
/robots.txtreturns 404 so I'm assuming it isn't added yet. Can I work on this please?Hi, this was discussed here #586 (comment) and it was decided that a worker would be used.
Ah ok, the PR didn't link this issue so I didn't see that. Thanks!
[python-discord/bot] branch deleted: ks123/bugfix/reapply\-infraction
Closes #7 (Finally ๐)
- This PR also adds the migration steps to the Dockerfile.
GitHub Actions run 1349336051 succeeded.
Connected!
GitHub Actions run 1349341465 succeeded.
3f0f6c5 Formats Help Command Output - ChrisLovering
[python-discord/bot] New branch created: fix\-help\-description\-spacing
Closes #1232
Takes over https://github.com/python-discord/bot/pull/1285
Modifies the docstring sent for per-command help to remove weird formatting issues mentioned in #1232. Removes newlines that are not used for paragraph breaks, after retrieving the docstring, and lets the embed handle it on the discord side.
Allow overriding this behaviour via \u2003 to denote a non-escapable break.
GitHub Actions run 1349488868 succeeded.
You didn't check for the existence of the webhook here.
self.incidents_webhook should be checked first for short-circuiting.
You forgot a backtick at the end here.
@checks.has_permissions(PermissionLevel.SUPPORTER)
@appeal_category_management.command(name="get")
async def get_categories(self, ctx: commands.Context) -> None:
"""Get the list of appeal categories of commands for managing appeal categories."""
await self.init_task
category_str = ", ".join(map(str, self.appeal_categories)) if self.appeal_categories else "None"
await ctx.send(f"Currently configured appeal categories are: {cate...
Don't we want to await the init_task before displaying the list of categories?
Yes, we should, looks like I missed a command while adding the awaits :D
ed1a0f5 await init task before processing get_categories - ChrisLovering
@mbaruh I don't have anything else in mind, so I'll close this PR until further notice. Thank you for all your work on these features!
This is stated right above the subtitle.
GitHub Actions run 1349862673 succeeded.
GitHub Actions run 1349925836 succeeded.
To be clearer, this should state "create and open a new file".
Clarify that the file should be created if it doesn't exist (which is most likely the case for anyone reading the guide). Also, I think "need to be named" reads a bit better than "needs to have the name".
The last sentence is redundant since the same info is stated in the "Working on the Repository Directly" section.
Hmm the second part of the sentence is not related to the guide, it's what you're supposed to do once you have a bot account. I'll try to phrase it better.
GitHub Actions run 1350042655 succeeded.
This would never be called if the webhook doesn't exist due to the check added here:
I am not sure which comment you are talking about. But here is my comments on that:
I would like to keep the order it is in right now or rather even move the text.count(" ") above len(lines) > 3. Because say we get a case of 3 lines 500 characters 20 words. Now, if it is less than 300 characters in the first 3 lines it would be an "extra" function running where checking the lines has already reduced the number of characters to less than 300.
Now, lets take another example, if we ha...
befc9f1 remove case-insensitive-snippets from README - Qwerty-133
[python-discord/modmail-plugins] New branch created: readme
Since this plugin doesn't need anything pydis-specific, we could add some information about this in the README.
GitHub Actions run 1350979021 succeeded.
Connected!
GitHub Actions run 1350989233 succeeded.
GitHub Actions run 1350995913 was cancelled.
Sentry Issue: BOT-1NW
TypeError: can't compare offset-naive and offset-aware datetimes
File "discord/client.py", line 351, in _run_event
await coro(*args, **kwargs)
File "bot/exts/moderation/modlog.py", line 408, in on_member_join
difference = abs(relativedelta(now, member.created_at))
File "dateutil/relativedelta.py", line 154, in __init__
if dt1 < dt2:
Unhandled exception...
GitHub Actions run 1350997269 was cancelled.
GitHub Actions run 1350998984 succeeded.
[bot] Branch modlog\-ingore\-channels\-mods\-can't\-view was force-pushed to `85f3510`
Connected!
GitHub Actions run 1351004302 succeeded.
GitHub Actions run 1351011253 succeeded.
LGTM! Thank you mister Chris! Best welsh engineer I've ever seen!
Maybe?
# Ignore DMs or messages outside of the main guild.
if not channel or (channel.guild and channel.guild.id != GuildConstant.id):
return True
4385112 Refactor modlog if statement to be more consise - ChrisLovering
GitHub Actions run 1351032554 succeeded.
[bot] Branch modlog\-ingore\-channels\-mods\-can't\-view was force-pushed to `72a72bf`
GitHub Actions run 1351036465 succeeded.
Return true if the channel or parent channel in the case of threads passed should be ignored by modlog.
# Ignore not found channels, DMs, or messages outside of the main guild.
# Mod team doesn't have view permission to the channel.
[bot] Branch fix\-help\-description\-spacing was force-pushed to `581bea0`
GitHub Actions run 1351039970 succeeded.
[bot] Branch modlog\-ingore\-channels\-mods\-can't\-view was force-pushed to `2b8807b`
I'm not too sure this is correct. Since this adding more information to an already grammatically sentence. See these commas as brackets IE Return true if the channel (or parent channel in the case of threads) passed should be ignored by modlog.
In English, we just replace brackets with commas like this.
GitHub Actions run 1351044603 succeeded.
[python-discord/bot] branch deleted: modlog\-ingore\-channels\-mods\-can't\-view
1a1d7c7 Ignore channels mod team can't view in modlog - ChrisLovering
db7857d Refactor: Update modlog ignore function name - ChrisLovering
457cd6e Use modlog ignore function for voice events too - ChrisLovering
2b8807b Remove unneeded config entries - ChrisLovering
432b571 Merge pull request #1871 from python-discord/mo... - ChrisLovering
Not sure I follow. The line I mentioned is in a function that is called from process_event. The line you mention is in on_message.
Connected!
GitHub Actions run 1351051642 succeeded.
Hey @MarkKoz ๐ We merged #1815, which migrated the bot to disocrd.py 2.0a0 and made aaallll the timestamp tz aware, probably breaking the whole PR ๐ฌ
Ah yeah, It would also be called by on_raw_reaction_add.
https://github.com/python-discord/bot/pull/1446#discussion_r707483799
https://github.com/python-discord/bot/pull/1446#discussion_r707487840
https://github.com/python-discord/bot/pull/1446#discussion_r708103938
https://github.com/python-discord/bot/pull/1446#discussion_r708102442
The first three were marked as resolved but were unaddressed. The last one just didn't receive a reply.
It's fine if you feel like a suggestion isn't worth taking, but you should say so instead of resolving the...
GitHub Actions run 1351090445 succeeded.
4acf6cc Add ping manager and ban appeals to the readme - ChrisLovering
Tried a few commands, all seems good to me.
1a1d7c7 Ignore channels mod team can't view in modlog - ChrisLovering
db7857d Refactor: Update modlog ignore function name - ChrisLovering
457cd6e Use modlog ignore function for voice events too - ChrisLovering
2b8807b Remove unneeded config entries - ChrisLovering
432b571 Merge pull request #1871 from python-discord/mo... - ChrisLovering
The bullet point bits in the docstrings will need to be changed because of this: https://github.com/python-discord/bot/pull/1876, adding the \u2003 override should do the job.
GitHub Actions run 1351124242 succeeded.
[python-discord/bot] branch deleted: fix\-help\-description\-spacing
2a83c5f Only check URL-like objects against domain filters - ChrisLovering
8e25ed1 Prevent infractions raising error due to role h... - TizzySaurus
8fa3fa1 Fix role hierarchy check - TizzySaurus
38dc1c6 Fix tests - TizzySaurus
6bb0dba Declare and refresh TalentPool.cache on init of... - ChrisLovering
Connected!
GitHub Actions run 1351131355 succeeded.
GitHub Actions run 1351131682 succeeded.
Connected!
I kept for the straightforward testing for contributors, but will do that now ๐๐ป
77e83e0 Fixed delayed logs and made some other minor re... - wookie184
[python-discord/bot] branch deleted: fix\-delayed\-logs
GitHub Actions run 1351142373 succeeded.
All seems good to me, :ok_handbutflipped:
Connected!
857468c create a helper function to get the redis key o... - Numerlor
48b1a7b Prevent erroneous symbols from always raising s... - Numerlor
727ef75 Delete stale item counters when clearing doc cache - Numerlor
23a3e5e Raise for status to prevent parsing of invalid ... - Numerlor
662c9a6 Merge branch 'main' into doc-repetitive-outdate... - wookie184
Connected!
GitHub Actions run 1351157178 succeeded.
Current blockers for bumping:
No wheels:
- aiodns
- hiredis-py https://github.com/redis/hiredis-py/pull/117
- rapidfuzz https://github.com/maxbachmann/RapidFuzz/issues/141
- pycares @Akarys42 DMed the author to make a new release, their ci is all ready, just needs a release made
- psutil https://github.com/giampaolo/psutil/issues/1994
Porting will need more functions than there currently are in this PR.
Due to inactivity, I'll be closing this PR. Feel free to open this back up if you resume.
@melodicht File conflicts will need to be resolved.
@magicandcode What's your status on this PR?
[python-discord/modmail-plugins] branch deleted: readme
31f6d51 Fix command alias not being a tuple - ChrisLovering
295676e Merge pull request #8 from python-discord/fix-t... - Akarys42
befc9f1 remove case-insensitive-snippets from README - Qwerty-133
e0cde38 Merge pull request #9 from python-discord/readme - ChrisLovering
afb6c90 Merge branch 'main' into add-ping-manager - ChrisLovering
This proposes that the return type of generation endpoints be changed to return objects in the structure of:
{
"seed": 1234,
"url": "https://..."
}
This would mean that applications are able to access the seed by which a ducky is generated, if it's randomly generated (although this would be included for consistency on seeded ducks too)
This proposal is to create an endpoint to allow many duckies to be generated at once, rather than requiring a large number of requests for someone (me) who sometimes wants a large(ish) quantity of ducks at once.
How the endpoint would work
Seeded
POST /ducky/bulk
Content-Type: application/json
{
"seeds": [
1234,
5678
]
}
Unseeded
GET /ducky/bulk?amount=5
Return value
The return value would be an array of obje...
How would we feel about returning the seed as a header instead so hotlinking the generation endpoint is still possible?
[Discussed in discord] The endpoint already returns a JSON object so that's a non-concern
[python-discord/modmail-plugins] New branch created: tagging
This prevents it from showing up in the help command's output when it's not invoked in a thread.
Don't we want to await the init_task before displaying the list of categories?
d8252b3 Refactor get_or_fetch methods to utils file - ChrisLovering
69ff6b9 Move async tasks to a helper file - ChrisLovering
830d38e Move appeal category config to commands - ChrisLovering
d447db8 Specifiy the bot loop when creating the init task - ChrisLovering
ed1a0f5 await init task before processing get_categories - ChrisLovering
[python-discord/modmail-plugins] branch deleted: configurable\-appeal\-categories
[python-discord/modmail-plugins] branch deleted: add\-ping\-manager
5181c47 Add default value for db_ping_tasks - ChrisLovering
e0c8644 Fix bugs in .issue command & add aliases - TizzySaurus
[python-discord/sir-lancebot] New branch created: issue\-command\-fixes
1c194cd fix: set_ping would overwrite cached wait durat... - ChrisLovering
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
N/A, approved by @Akarys internally:

Description
- Command now requires at least one issue/PR
- Command no longer continues to send issues/PRs when there's too many listed in the invocation
- Added plural aliases to the command (
.issuesand.prs)
##...
Snekbox is pretty cool, we could use it to run a bunch of cool commands. https://github.com/python-discord/snekbox/pull/108 allows us to pass in custom arguments, so we should be able to do things like python -m black -c "code" fairly easily. An example of this is the timeit command https://github.com/python-discord/bot/pull/1602
We could use this to create a bunch of utility commands to run useful python command line tools (each tool would need to be tested to ensure it works under snek...
GitHub Actions run 1351285189 failed.
GitHub Actions run 1351289093 succeeded.
GitHub Actions run 1351292410 succeeded.
[sir-lancebot] Branch issue\-command\-fixes was force-pushed to `a7bb17c`
GitHub Actions run 1351295534 succeeded.
Doesn't #778 make this unnecessary?
Right, looks like it was voted to just remove this command in #788. Might still be worth merging until #778 is merged though? If not, feel free to close this @wookie184.
Black
I think this would be great to have in snekbox, and with a specific command, so that we can make code readable when helping. That said, I'm not sure how widely useful it would be in the server (not that I'm saying we shouldn't add this at all, I personally would love this). Perhaps if we're adding black we should also add autopep8 to get a more to-PEP8 formatter for those who aren't fond of black's style.
MyPy
With the new type hinting channel I think this would be a ...
[python-discord/sir-lancebot] branch deleted: issue\-command\-fixes
[python-discord/bot] Issue opened: #1881 AttributeError: 'DMChannel' object has no attribute 'guild'
Sentry Issue: BOT-1NX
AttributeError: 'DMChannel' object has no attribute 'guild'
File "discord/client.py", line 351, in _run_event
await coro(*args, **kwargs)
File "bot/exts/moderation/modlog.py", line 616, in on_raw_message_delete
if self.is_channel_ignored(event.channel_id):
File "bot/exts/moderation/modlog.py", line 542, in is_channel_ignored
if not channel or channel.gu...
57d2d3c Fix attr error in ModLog command - ChrisLovering
[python-discord/bot] New branch created: fix\-attr\-error
Fixes #1881
Fixes BOT-1NX
Connected!
GitHub Actions run 1351328112 succeeded.
GitHub Actions run 1351329228 succeeded.
GitHub Actions run 1351343283 succeeded.
[python-discord/site] branch deleted: new\-guides
860c137 Address review & make AI.get_move a staticmethod - TizzySaurus
GitHub Actions run 1351357967 succeeded.
GitHub Actions run 1351360221 succeeded.
GitHub Actions run 1351357699 succeeded.
Connected!
GitHub Actions run 1351367650 succeeded.
[python-discord/sir-lancebot] branch deleted: fix\-issue\-898
0c814ce Set AI.user to @Sir Lancebot - TizzySaurus
462b83c Add missing Game.channel attribute - TizzySaurus
860c137 Address review & make AI.get_move a staticmethod - TizzySaurus
0631030 Merge branch 'main' into fix-issue-898 - ChrisLovering
559e76f Merge pull request #899 from python-discord/fix... - HassanAbouelela
GitHub Actions run 1351371641 succeeded.
Connected!
GitHub Actions run 1351373574 succeeded.
[python-discord/site] New branch created: mbaruh\-patch\-1
[python-discord/site] branch deleted: mbaruh\-patch\-1
In Discord if a user has App Settings / Text and Images / Link Preview disabled, then responses from the Python bot are invisible to that user.
They see this

instead of

this leads to confusion and gnashing of teeth. I'm not saying it has to fixed, but worth having a...
857468c create a helper function to get the redis key o... - Numerlor
48b1a7b Prevent erroneous symbols from always raising s... - Numerlor
727ef75 Delete stale item counters when clearing doc cache - Numerlor
23a3e5e Raise for status to prevent parsing of invalid ... - Numerlor
8e25ed1 Prevent infractions raising error due to role h... - TizzySaurus
c998d47 Move subdomains to query paths. - jchristgit
fa4a8dd Merge branch 'master' into subdomains-to-query-... - jchristgit
3699245 Merge branch 'main' into subdomains-to-query-paths - jb3
2bf473e Remove code jam notice from front page - janine9vn
a7afdf4 Update wording on main Events page - janine9vn
Awesome, happy to see this happening!
[python-discord/site] branch deleted: new\-ban\-appeals\-process
Hey! Thanks for opening this issue.
This is a problem due to how discord handles embed. The only thing we can do about it is not sue embeds, which would be quite a huge limitation. I'm afraid we can't do anything about it.
[python-discord/bot] branch deleted: new\-appeals\-process
GitHub Actions run 1351423495 succeeded.
Connected!
GitHub Actions run 1351427798 succeeded.
[python-discord/site] New branch created: mbaruh\-patch\-1
[python-discord/site] branch deleted: mbaruh\-patch\-1
All of these sound fine to add.
Maybe a good idea to do like the help channels cog and have multiple files, one for each major part
Most of the implementation here is made up of minor changes (snekbox: adding the module to the module list if it isnโt already there, testing. bot: any wrappers, call the API), it probably wouldnโt make sense to break it up into multiple PRs or files, as I imagine there will be overlap in a majority of the work.
2567b61 Don't ping off-duty mods - ChrisLovering
[python-discord/modmail-plugins] New branch created: don't\-ping\-off\-duty\-mods
[python-discord/modmail-plugins] branch deleted: tagging
[modmail-plugins] Branch don't\-ping\-off\-duty\-mods was force-pushed to `9414d32`
Ref: [message in #community-meta](#community-meta message)
I think it should be updated so newer members won't get confused when they don't see a #media-branding.
GitHub Actions run 1351477551 succeeded.
[python-discord/modmail-plugins] branch deleted: don't\-ping\-off\-duty\-mods
./pydis_site/apps/resources/resources/tools/ides/thonny.yaml:1: specifically./pydis_site/apps/content/resources/guides/pydis-guides/helping-others.md:115: considered./pydis_site/apps/content/resources/guides/pydis-guides/contributing/issues.md:59 labels./pydis_site/apps/content/resources/guides/pydis-guides/contributing/sir-lancebot.md:99: recommend./pydis_site/apps/content/resources/guides/pydis-guides/contributing/site.md:111: particularly- `./pydis_site/apps/...
Why only for a single word? ๐
The idea is that you might end up with a slice ending at a space. It's best to strip right before checking whether the length of the string changed.
Thanks for this, you are correct https://github.com/python-discord/site/blob/main/pydis_site/apps/api/tests/test_offensive_message.py#L61 should be field=field. Would you be able to add this to the PR too? :)
Sentry Issue: BOT-1NY
AttributeError: 'NoneType' object has no attribute 'fp'
File "bot/exts/moderation/incidents.py", line 253, in archive
await webhook.send(
File "discord/webhook/async_.py", line 1368, in send
params = handle_message_parameters(
File "discord/webhook/async_.py", line 496, in handle_message_parameters
'value': file.fp,
Failed to archive incident 899292417...
Gotcha, I guess it sounds like more stuff to do than it really is, but yeah should be fine after considering it more
a91b51d Use MISSING sentinal rather than None for no files - ChrisLovering
[python-discord/bot] New branch created: fix\-files\-being\-sent\-in\-webhooks
There were a few 'seperated' typos which I didn't change because I think it's just another way of spelling it?
I'm fairly sure separated is the only correct spelling, and google seems to agree (although now that i've stared at both spellings for a bit of course they both look weird ๐ )
Fixes #1884
Fixes BOT-1NY
Discord.py 2.0 changed how this works, webhooks now look for the MISSING sentinal, rather than None to determine whether files are being passed.
This was updated in this commit: https://github.com/Rapptz/discord.py/commit/a6f7213c89e9d592c69ea3c631b0cb2bdab19577
I looked around the rest of the codebase and didn't see anywhere else that would be affected with this breaking change.
GitHub Actions run 1351561521 succeeded.
[python-discord/bot] branch deleted: fix\-files\-being\-sent\-in\-webhooks
Connected!
GitHub Actions run 1351578193 succeeded.
With my limited Django knowledge don't take this as "everything is perfect", but rather "I don't see anything glaringly wrong with it" - so yeah, I don't see anything glaringly wrong with it
I actually understand this one! All looks to be good :ok_hand:
c998d47 Move subdomains to query paths. - jchristgit
fa4a8dd Merge branch 'master' into subdomains-to-query-... - jchristgit
3699245 Merge branch 'main' into subdomains-to-query-paths - jb3
a77d115 Direct appeals to the appeals server - ChrisLovering
26be9be Switches HTTP Links To HTTPS - HassanAbouelela
[python-discord/site] branch deleted: fix\-tests\-on\-windows
b3a5c66 Fixes Test Paths For Windows (#596) - HassanAbouelela
cbe05b4 Add a border around the scary bat - ChrisLovering
[python-discord/sir-lancebot] New branch created: Add\-border\-around\-bat
Description
When users with dark avatars would use the spookify command, they wouldn't be able to see the bat that was added. By adding a white border around the bat, it is now more visible.
Before:

After:

Did you:
- [x] Join the [**Python Discord ...
GitHub Actions run 1351713225 succeeded.
Sentry Issue: BOT-1NZ
AttributeError: 'Guild' object has no attribute 'icon_url_as'
File "discord/client.py", line 351, in _run_event
await coro(*args, **kwargs)
File "bot/exts/moderation/modlog.py", line 381, in on_guild_update
thumbnail=after.icon_url_as(format="png")
Unhandled exception in on_guild_update.
f454f61 Fix attr error since asset attrs have changed i... - ChrisLovering
[python-discord/bot] New branch created: fix\-guild\-attr\-error
Fixes #1886
Fixes BOT-1NZ
This was updated with Discord.py 2.0.
Hey @MarkKoz ๐ We merged #1815, which migrated the bot to disocrd.py 2.0a0 and made aaallll the timestamp tz aware, probably breaking the whole PR ๐ฌ
That sucks. This PR has been ready before that one was even open. I'm not going to be touching this PR until people commit to reviewing it; I'd rather keep the merge commits to a minimum.
GitHub Actions run 1351794414 was cancelled.
GitHub Actions run 1351796712 succeeded.
GitHub Actions run 1351806524 succeeded.
With the change to with_static_format instead of with_format this looks good :+1:
[python-discord/bot] branch deleted: fix\-guild\-attr\-error
Connected!
GitHub Actions run 1351818281 succeeded.
GitHub Actions run 1352666186 succeeded.
GitHub Actions run 1352668474 succeeded.
GitHub Actions run 1352669233 succeeded.
GitHub Actions run 1352674777 was cancelled.
GitHub Actions run 1352677138 was cancelled.
GitHub Actions run 1352679988 succeeded.
I'm fairly sure separated is the only correct spelling, and google seems to agree (although now that i've stared at both spellings for a bit of course they both look weird ๐ )
Haha 'label' looked soo like 'lah-belle' for me yesterday.
I use seperated if I don't have spellcheck on because in american accent the 'per' has more curl to it than e.g. in australian accent... generally.
Guess I'll fix those 'seperated's then.
I have, it returns tuple[str, list] now, it returned just str earlier.
I am not sure why would this catch an error, if you are talking about the unloads_cache.delete() function. If the given isn't present in the dict, it is simply ignored by the library.
GitHub Actions run 1352726178 succeeded.
Thanks for this, you are correct https://github.com/python-discord/site/blob/main/pydis_site/apps/api/tests/test_offensive_message.py#L61 should be
field=field. Would you be able to add this to the PR too? :)
Done! I also fixed two succinct typos. Didn't think of googling it before the idea from wookie, stupid me.
Wanted to include the first two comments in this too, no idea why I pressed single commit there.
Also, how about using tiangolo/uvicorn-gunicorn-fastapi for the dockerfile?
GitHub Actions run 1352806891 succeeded.
GitHub Actions run 1352948430 succeeded.
51c2e01 Fix guild icon URL getting way in server command - ks129
[python-discord/bot] New branch created: ks123/bugfix/server\-guild\-icon
Fixes BOT-1P0
Another instance of wrong asset URL getting from migration to dpy 2.0.
[python-discord/bot] Checks Successful on PR: #1888 Fix guild icon URL getting way in server command
GitHub Actions run 1353134894 succeeded.
Connected!
GitHub Actions run 1353173526 succeeded.
Description
Everything works fine when spinning up a fresh new workspace with gitpod. This is because the init part in .gitpod.yml is run.
However, on workspace restarts (such as closing the tab and then reopening that workspace after some time), poetry install would show ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv. for every single package.
Steps to Reproduce
- Click the
open in gitpodbutton in the README (or just...
Isn't this the same as list(json_file)? If so, that would be better imo.
loads is used to convert a string to json
load is used to convert a file to json (what you want)
Docstring missing . at the end
Ah, ok, got it. I will fix that.
I'm not sure. @Bluenix2 can you confirm that?
I agree that would be better if that works.
[python-discord/modmail-plugins] New branch created: ignore\-all\-messages\-from\-the\-bot
10f6689 Use embed colour to determine mod messages - ChrisLovering
[python-discord/modmail-plugins] Pull request opened: #12 Use embed colour to determine mod messages
Previously messages from the modmail bot, such as when the recipient leaves the server, would be treated as a mod reply.
This changes moves to specifically target what a mod message is, rather than try to find things that don't look like recipient messages.
Drafted until tested
Ok, I will remove it and align the strings.
Ok, so I can still call the function but I don't need to return madlibs_embed, that's my understanding?
If we only ever have a
templateskey (no other base-level keys exist) then it's probably better to change the structure of this JSON file to belist[dict[str, str | list[str]]]rather thandict[str, list[dict[str, str | list[str]]]](make the json file a list of templates rather than a json file where the sole key gives the list of templates).This would also mean changing some code with what you do after loading the JSON into python (since will already be a list of templates now...
Well, that is actually exactly what I want, for filtered_blanks because if it is True, then I want to just continue. If it's False, then I want to throw an error embed. What I want my program to do is I want the user to be able to enter .madlibs and then a range of numbers between 5 and 15, ex. .madlibs 5 7.
The point of filtered_blanks is to make sure that the arguments that the user entered are valid. Does that make sense?
Oh ok, I will remove that then.
Tysm for your review @TizzySaurus ! Your reviews are very thorough and it helps me a lot especially since this is my first time contributing to open-source!!
Yes you are literally doing absolutely nothing in that list comprehension. Do you even need to convert it to a list at all? Isn't it already a list?
True, yeah. So should I just change it to list(json_file)?
Re: this comment
Can I take this if @doublevcodes is unable to finish it?
Then what's the point of the function? Isn't it constructing an embed?
Added some url parsing using urllib.parse to stop false positives
Realized I patched docker-compose.yml for my system, will remove that
GitHub Actions run 1355030589 failed.
You want True / False, not [True] / [False]. You need to remove the []
My point was more that you create an embed, but then don't do anything with it. Presumably you want to send it somewhere, but you haven't actually written code for that anywhere.
So this depends on whether you change the structure of the .json file. If you change the structure, then it will already be a list so no conversion needed.
Can you clarify what false positives you found and how your code deals with them?
Yeah, makes sense @TizzySaurus . Obviously this is a WIP so I'll get there eventually. Thanks!
I do plan to restructure the JSON the way you suggested. So what you're saying is, that line isn't needed if I restructure the JSON file?
This might not require any code changes when the new filters system is ready.
Could you explain what "in the cog returning the templates" means?
Ah, right, ok. Will fix.
Pushed a new commit, everything should be in order now.
Connected!
@mbaruh to remove false positives, I parsed the URLs and checked if the netloc was the same. If it wasn't, I passed. I also check if the netloc is prefixed with www. should people try to circumvent the filter
Can you provide examples of false positives? Is there a related issue?
Can you provide examples of false positives? Is there a related issue?
@mbaruh yes, I'll link the issue and provide examples in the initial description
@mbaruh check the original description
Can we change this @TizzySaurus, this is the only change I would like to see made.
Description
.dictionary command for sir-lance bot, This would be going to give the word's definition
Using Dictionary API, it's free at all
Reasoning
This will be get the quick access to the definition of new words
While chatting with others, It will definitely going to help to them who heard the word first time
Also this will improve English literacy
Additional Details
The command will get the Word's definition, its few synonymous....
I would like to implement this myself
Please assign me
[python-discord/bot] New review comment on pull request #1889: feat: added url parsing to the filter
Some urls in the db already have a scheme, so adding https:// could add a duplicate the scheme here.
[python-discord/bot] New review comment on pull request #1889: feat: added url parsing to the filter
if url_parsed.netloc in (f"www.{blacklisted_parsed.netloc}", blacklisted_parsed.netloc):
Doing this allows us to remove the duplicated code below
Hi @Brodevil, this needs some planning before you're assigned. It might take a few days
Hi there! Thanks for bringing this up, I had no idea that my implementation would cause this.
@Kronifer
No issue, but please confirm me about this idea ๐ก
Will it help full for community or not
It's was my first issue so I was just excited ๐
The CI complained that this line is 3 characters too long.
await mod.add_roles(self.moderators_role, reason="Moderator scheduled time started!")
Isn't this a good thing? Don't you want it added immediately?
This should probably add that the result will be 303 characters across 3 lines at maximum.
This first statement may return None for incorrectly setup configs (or cache failure).
helpers_role = message.guild.get_role(Roles.helpers)
# The above may return None which we can't pass to overwrites_for() if it is
if not helpers_role or not channel.overwrites_for(helpers_role).read_messages:
I would like to know how others feel about cache failure here.
I rather have this propogate and get logged to Sentry.
If this is here, why not put similar try/except statements around every API call?
[python-discord/bot] New review comment on pull request #1889: feat: added url parsing to the filter
The way urllib.parse works, it interprets those without a scheme as a relative url which messes things up, I'll work on fixing that in a bit
Do we want to add maybe a few tests for these changes?
I don't know how it works test side of things so I am not sure.
There's also some conflics to be resolved @Numerlor
Do we want to add maybe a few tests for these changes?
I don't know how it works test side of things so I am not sure.
There's also some conflics to be resolved @Numerlor
I don't think tags are really critical and complex enough to introduce tests for them if they're not present already.
I'm also not really planning on resolving the conflicts unless I know someone will review the PR soonish or it'll just require a merge before or after that anyway. The functionality of the...
Logging an exception will do that
To my memory we ignore this kind of possibility in the rest of the code and assume the config is correct
Nevermind I realize that if there is leading whitespace then the text.find(" ") == -1 condition won't be True.
I'm not sure what you mean.. there's no return statement, so it returns None.
I am referring to self.bot.fetch_webhook()
Yes. You'd just do templates = load(file).
Could you explain what "in the cog returning the templates" means?
The function goes within the cog and returns the loaded templates
GitHub Actions run 1355933762 succeeded.
GitHub Actions run 1355948970 succeeded.
GitHub Actions run 1355965780 was cancelled.
GitHub Actions run 1355971239 succeeded.
GitHub Actions run 1355981692 succeeded.
GitHub Actions run 1356005282 was cancelled.
GitHub Actions run 1356006287 succeeded.
[python-discord/bot] New review comment on pull request #1889: feat: added url parsing to the filter
Preferably this should either be
import urllib
or
from urllib.parse import urlparse
Rather than importing like this
[python-discord/bot] New review comment on pull request #1889: feat: added url parsing to the filter
There's still duplicated code here, would something like this work instead? Also we should make sure to include comments on why we're doing things, so the next person who reads this code can understand it.
# If there is a scheme (https://) in the url then `.netloc` will have the FQDN we want, otherwise it's in `.path`
blacklisted_url = urllib.parse.urlparse(url)
blacklisted_url = blacklisted_url.netloc or blacklisted_url.path...
Had the wrong option selected when requesting changes
3adbb58 Migrate to on_socket_event_type event - ChrisLovering
[python-discord/bot] New branch created: Migrate\-to\-socket\_event\_type
Discord.py 2.0 (Namely this commit https://github.com/Rapptz/discord.py/commit/e2250d402e8ad035b2653eb411c8e744cc9eb3bf) removed the socket_response event, and replaced it with the socket_event_type event, which just sends the type of event triggered on the websocket.
Since this event was removed, no socket stats were being incremented, as the event never triggered.
I have looked through the rest of the bot, and we do not use the socket_response event type anywhere else.
[bot] Branch Migrate\-to\-socket\_event\_type was force-pushed to `3793035`
GitHub Actions run 1356347237 was cancelled.
GitHub Actions run 1356353615 succeeded.
Connected!
GitHub Actions run 1356365786 succeeded.
Currently, we check people's usernames when they send a message on the server, to ensure it isn't inappropriate. I think we should actually check in member join and member update events, as people can still have their nickname be visible on server without ever sending a message. They can also update their usernames after sending a message.
If we do that, we'll also no longer need the check in the message event, just the other two. It should be a relatively straightforward swap I hope.
I...
[python-discord/bot] New branch created: Update\-Username\-Checks
Closes #1891
Currently, we check people's usernames when they send a message on the server, to ensure it isn't inappropriate. To get more coverage, we should actually be checking member join and member update events, as people can still have their nickname be visible on server without ever sending a message. They can also update their usernames after sending a message.
As a consequence of doing it with these events, we no longer need to check on message too.
I have also added confusa...
GitHub Actions run 1356554314 succeeded.
Perhaps we should exit the inner loop early here if we find a match?
pycares has 3.10 wheels as of 4.1.2
I didn't want to change the behaviour of it too much. It seems we actually list all of the bad matches in the mod log message, so they are actually used.
Quitting early could save some processing power here though
That's fine for the first loop, but on the inner loop we'll end up with the same filter name multiple times.
True, I've force pushed a break here.
I've posted in mod-meta, lets see if people want to completely return early too.
GitHub Actions run 1356602163 succeeded.
All clear! The alphabetical sorting was unexpected, but appreciated, nicely done.
Normalizing strings before checking if they match on all filters removes our ability to match specific unnormalized forms. I guess this should be ok, although we should look into our current filters and see what can no longer match. I'm not sure how aggressive the normalization by confusables is.
GitHub Actions run 1356614631 succeeded.
GitHub Actions run 1356634131 succeeded.
GitHub Actions run 1356648493 succeeded.
GitHub Actions run 1356742892 was cancelled.
GitHub Actions run 1356746825 succeeded.
As per this comment (https://github.com/python-discord/bot/pull/1446#discussion_r731120589) I would be removing this.
GitHub Actions run 1356880370 succeeded.
GitHub Actions run 1356909818 succeeded.
It does go through the scheduler. So basically scheduler takes a task and timing and it would be running that task when that time has passed. Since there is no support for repetitive tasks by the scheduler yet, we would need to insert the task again once the task is finished. So it schedules the adding role task where it would add the mod role to them, then sleep until their work-time period is over and then remove the mod role from them. Once it removes the role, it would reschedule the addi...
Not sure, what I thought was, if the moderator is scheduling it for a time passed by it would be for tomorrow.
GitHub Actions run 1357063778 succeeded.
Looks good. Just one suggestion to add black (only checking) to the lint test workflow.
Could you explain what "in the cog returning the templates" means?
The function goes within the cog and returns the loaded template.
Oh, so do you mean I should add a static method to bottom of the program, where it says this? (sorry I'm still kinda confused here)

And would it look like this?
`@staticmethod`
def _load_templates():
templates = load(file)
random_template = choice(templates)
number_of_inputs = len(random_template["blanks"])
current_input = 0
GitHub Actions run 1357392752 succeeded.
@Brodevil I love this idea (and the API that you found) a lot! However, you do need core dev approval before you can get assigned, as Kron said. So just be patient someone should get back to you soon. Thanks again for the suggestion, it is really great!
Description
There would be a way to remove a bookmark. This would be useful while mistakenly creating a bookmark or if you have many of bookmarks and don't want to have them there anymore.
Reasoning
If you happen to create a bookmark for a wrong message, you could delete that bookmark. Or if you just have a old bookmark that you don't anymore need. It would keep the bookmarks clear.
Proposed Implementation
Possibly creating a tag for each bookmark, as example #4321. Wit...
I don't think giving them IDs is the way to go, since it would require some form of storage on the bot, and isn't compatible with existing bookmarks. I would say we should instead use a message ID, the bot can fetch it and if it matches the bookmark structure delete it.
Other than that, it sounds good to me!
class ...(...):
def __init__(...):
self.templates = _load_templates()
@staticmethod
def _load_templates():
with open(...) as file:
return load(file)
@commands.command()
async def madlibs(...):
"""
...
"""
random_template = choice(self.templates)
...
something vaguely like this, although exact implementation will vary depending on the rest of the code.
I think instead of checking it matches the bookmark structure, we can make it so that it can only be ran in DMs. Less room for error that way.
I think that was the original plan, my idea was to make sure only bookmarks can be deleted
b2e8bfd Invert isinstance check as per review - TizzySaurus
GitHub Actions run 1358209324 succeeded.
LGTM, one optional comment, to improve the log message, but approving regardless.
I think this can be simplified down to the important information.
log.warning(f"{message.author} ({message.author.id}) isn't a member. Not giving cooldown role, or sending a DM.")
I don't think it should be a warning either, we don't want it to trigger Sentry
And @Akarys42 my understanding was we wanted it to trigger sentry so that should this "bug" happen again we may be able to dig further into it.
is this a bug? I feel like it is more of a race condition between the user opening a help channel and them getting yeeted from the guild.
We can't be sure what the cause is, but I suppose that's a likely candidate. If you feel I should change to log.info then I will
I guess it doesn't hurt to keep it to warn for now, to see if this theory is correct
5b7d8c4 Update log message for when author isn't `disco... - TizzySaurus
857468c create a helper function to get the redis key o... - Numerlor
48b1a7b Prevent erroneous symbols from always raising s... - Numerlor
727ef75 Delete stale item counters when clearing doc cache - Numerlor
23a3e5e Raise for status to prevent parsing of invalid ... - Numerlor
8e25ed1 Prevent infractions raising error due to role h... - TizzySaurus
e082596 Add handling for when message.author is a di... - TizzySaurus [b2e8bfd](https://github.com/python-discord/bot/commit/b2e8bfdc47339714ec014a13e2018e03c0931fe4) Invert isinstance check as per review - TizzySaurus [5b7d8c4](https://github.com/python-discord/bot/commit/5b7d8c41c88d3d0333f16dabd45efa770da87c82) Update log message for when author isn't disco... - TizzySaurus
5ce6017 Merge branch 'main' into fix-sentry-BOT-1N6 - TizzySaurus
e2bf284 Merge pull request #1845 from python-discord/fi... - Akarys42
[python-discord/bot] branch deleted: fix\-sentry\-BOT\-1N6
GitHub Actions run 1358279338 succeeded.
Connected!
GitHub Actions run 1358297250 succeeded.
I'd be interested in implementing this, however I'm going on holiday early Friday and probably won't be able to do until I get back (early November). For this reason, I won't assign myself until I return in case anyone would like to implement before then :+1:
I had a bit more of a look into the string normalisation stuff, so I just want to outline my findings.
- Just as a note, we should definitely not use
confusables.normalizeon the whole string, it has... problems. For some letters it seems to have multiple possible confusable characters, and instead of choosing one, it returns a list of all the possible combinations. If somebody sent 100๏ผณcharacters to the bot (it seems to think it could be an f or an s ๐คท), it would have tried to gene...
Ok, ty! I'll take a look at this later today.
acc7987 Filtering: add autoban on specific reasons - Akarys42
[python-discord/bot] New branch created: filters/autoban
Due to the increase in typo-squatting based phishing, we want to automatically ban users sending specific domain names.
For that, this commit will automatically ban any user that triggers a filter that has [autoban] in its reason. That's it!
GitHub Actions run 1358876057 succeeded.
Adding "do not merge" until I get a chance to look at it
Why not? seems like exactly what we do want.
[python-discord/bot] Pull request review submitted: #1893 Filtering: add autoban on specific reasons
Just an initial review of things that caught my eye.
This might return None. Seems safer to create a User object since the ban command will work with it.
"Your account seems to be compromised (%s). "
"You're welcome to appeal this ban once you have regained control of your account."
No, if the user is automatically banned by the bot we don't want to ping the mods, it is already handled
ban will fail if we pass a user, which is the problem. I forgot it returned None, I'll pass msg.author still to let it fail.
GitHub Actions run 1358942761 succeeded.
0347c89 Filtering: make sure we never pass None to ban - Akarys42
cf6f114 Filtering: do not try to convert to a member - Akarys42
GitHub Actions run 1358953420 was cancelled.
We ping mods for auto-mutes precisely because it's an automatic action made by the bot, and we want to be alerted to make sure it's not a false positive. Silently banning people without human oversight doesn't sound like the right approach.
GitHub Actions run 1358955182 succeeded.
GitHub Actions run 1359082565 succeeded.
After some discussion in #mod-alert, we decided to not ping but make the ban temporary instead.
GitHub Actions run 1359103667 succeeded.
Should perhaps clarify here in bold that the user was banned.
Isn't it already obvious? lol

yeah, it's easily missed. But it's good to keep the export with the poetry install so doesn't matter what order of the tasks are run, poetry install won't fail with the user install error. By the way you can always test it out in your browser by appending gitpod.io/#/ to the start of the repo URL :)
| preview | notes |
|---|---|
![]() |
believe it or not I forgot to reference twitter's smiley emoji and microsofts, both of which looked a lot better than iOS's but it's not that bad |
![]() |
we have the sm... |
GitHub Actions run 1359361476 succeeded.
[python-discord/bot] New branch created: modlog\-soft\-colors
Seems like we have been using the wrong colors in mod-log.
GitHub Actions run 1359853047 succeeded.
Connected!
GitHub Actions run 1359900062 succeeded.
If no one takes up this issue till November, I would go ahead and implement this.
f12b5f2 Also run name filters against a cleaned version... - ChrisLovering
GitHub Actions run 1359963139 succeeded.
GitHub Actions run 1359971817 succeeded.
Looks good. Just one suggestion to add
black(only checking) to the lint test workflow.
That is definitely worth considering, but unfortunately it is out of the scope of this PR.
Thank you for the thorough review! :)
Looks good, surprised we didn't have these already!
[python-discord/bot] New branch created: tz\_awareness
With the shift of the discord.py library to timezone aware datetimes, this PR changes datetimes throughout the bot to be in the UTC timezone accordingly.
This has several advantages:
- There's no need to discard the TZ every time the datetime of a Discord object is fetched.
- Using TZ aware datetimes reduces the likelihood of silently adding bugs into the codebase (can't compare an aware datetime with a naive one).
- Our DB already stores datetimes in UTC, but we've been discarding the ...
GitHub Actions run 1360618001 succeeded.
[python-discord/sir-lancebot] New branch created: reorder\-hacktoberfest\-commands
Relevant Issues
Closes #861.
Description
- Moved all hacktoberfest commands into
_cog.py - Moved all hacktoberfest util functions into
_utils.py - Deleted the three hacktoberfest command files (since merged into
_cog.pyand_utils) - Migrated all hacktoberfest commands to be under the
Hacktoberfestcog and.hacktoberfestcommand (alias.hacktober) - Renamed some commands (
.hackstats-->.hacktoberfest stats,.hacktoberissues-->.hacktoberfest issuesa...
GitHub Actions run 1360776822 succeeded.
Sentry Issue: BOT-1P3
AttributeError: type object 'Colour' has no attribute 'soft_red'
File "bot/exts/moderation/modlog.py", line 789, in on_thread_update
colour = Colour.soft_red()
File "discord/client.py", line 351, in _run_event
await coro(*args, **kwargs)
Unhandled exception in on_thread_update.
acc0973 Modlog: correct color names - Akarys42
[python-discord/bot] New branch created: modlog/correct\-color\-names
GitHub Actions run 1360971618 succeeded.
I can work on this but it's blocked by #919 for now
Hey @TizzySaurus the tempfix was for .hackstats not .hacktoberissues :)
GitHub Actions run 1361662649 succeeded.
It would be great if snekbox could support projects with graphical outputs such as matplotlib or pillow.
Works works well ๐
I don't have much to say on the code for each of the subcommands implementation since they're are mostly copied from the old ones, but these are just some trivial fixes "migrated" from them, plus a few things related to the re-organisation itself.
I didn't know what STATS_ meant before checking the equivalent line in the old hacktoberstats file. Maybe we could use the same request headers as hacktoberissues? Doing so seems to work ok for me.
I know original command didn't have this but it's nice to add it now
get that user's contributions.
I'm generally not a fan of a single utils.py file with many functions and variables from different sections and topics. I know many projects do this but a single utils.py name doesn't really say much as to what kind of utility functions one would find in there (apart from them being related to Hacktoberfest in general).
Hacktober-stats has quite a lot of utility functions, prehaps we could have them in a separate file such as _hacktoberstats.py? This is just a suggestion and it's ent...
I agree. Duplicate of #103
We need to parse the markdown before attaching it to the embed object.

embed.add_field(name="Labels", value="\n".join(labels))
@commands.group(aliases=('hacktober',), invoke_without_command=True)
Before, after:

You mean remove the link entirely? It's nice to use .hacktober stats for checking their own stats though.
No, we are checking if here if the discord user passed a username while linking their account. The type annotation for username is = None which can be removed to make this a required parameter. Thus, this check can be skipped.
Right you mean the linksubcommand, my bad
@TizzySaurus is this PR only focused on migrating the code as-is and the restructuring or are you wanting to refactor the three commands as well? Many of Jason's suggestions are on (mostly ๐) copied original implementations (from #7, #46, #296, #466, #475, 047902d5, possibly more). IMO it should just copy the functions over for now plus many adjustments (which you've done) and then refactor them later in separate PRs since this is only about putting the three subcommands under a single `hackt...
Connected!
The contents of the !contribute tag as of the time of writing reads:

The link that reads "Contributing guidelines" leads to contribution guide at https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/. However, there is another document specifically titled "Contributing Guidelines" at https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/contributi...
Connected!
#dev-contrib discussion ref: [start](#dev-contrib message), [end](#dev-contrib message)
The other option is that we store messageIDs of the messages in DMs, and add a reaction. We then have a listener for RawReactionActionEvent which checks if that message ID is in redis, and deletes the message and removes it from redis.
Hey @TizzySaurus (for your PR description) the tempfix was for
.hackstatsnot.hacktoberissues:)
Fixed, thanks :+1:
This is a command for Sir Lancebot to send a funny gif from tenor.
There can be a cooldown on the command. The cooldown will be decided by other people, I think 5sec cooldown for the command is good.
I can alone work on this project but I just need some people to help me a bit.
Name of the command - .funny
Who is working? - Giant#5070 (Discord)
Cooldown- about 5 sec
It may take time to complete it but I will complete it for sure ๐
I'm generally not a fan of a single utils.py file with many functions and variables from different sections and topics.
This was discussed extensively in #dev-contrib and the current system is what was decided on as "acceptable" by the most people. The general concept of namespacing utils to their command was strongly contested by multiple users so didn't do that in the end, albeit my original plan.
a single utils.py name doesn't really say much as to what kind of utility functions ...
The headers have different values which is why I didn't use the same. Perhaps I could remember to HACKTOBER_STATS_REQUEST_HEADERS and HACKTOBER_ISSUES_REQUEST_HEADERS?
Alright let's keep it like this for the PR and separate them if we need to in the future (if and) when more things are added
The issue with renaming is that it will go over the 120 character limit, although I suppose I can just wrap it using parenthesis. What name would you recommend?
Have done these locally and will also do the other comment changes:+1:
How about something like:
ISSUES_API_URL= (
"https://api.github.com/search/issues?per_page=100&q="
f"is:issue"
f"+label:hacktoberfest"
f"+language:python"
f"+state:open"
)
Sure, but IMO merging the two is the best option. You might wanna test it a bit more though but I think it should be fine.
Linting would prevent the f-strings but without the fs that should be good :+1:
Right I meant without them, oops ๐
invoked_parents isn't a thing. My understanding was that ctx.command.qualified_name would use the alias name if that's what you invoked it with, but could be wrong -- not able to test right now.
This shows the help command for me when I do .hacktoberfest? Not able to test right now but it has been in my earlier testing.
Have implemented a description for the cache :+1:
This was an old comment from a previous version of development; have removed :+1:
The reason it's there is because I grouped the constants into the corresponding commands.
@TizzySaurus is this PR only focused on migrating the code as-is and the restructuring or are you wanting to refactor the three commands as well? Many of Jason's suggestions are on (mostly ๐) copied original implementations (from #7, #46, #296, #466, #475, 047902d, possibly more). IMO it should just copy the functions over for now plus many adjustments (which you've done) and then refactor them...
Right, I was looking at the wrong thing -- it does indeed exist.
Either way though I don't see the need for this. ctx.command.qualified_name gives more than enough detail in my opinion, and I'm pretty sure it's compliant with aliases, as mentioned above.

It isn't for me.
Hypothetically speaking since ctx.command is the Command object, ctx.command doesn't know how the user invoked it, so ctx.command.qualified_name would be the full command for stats, in which case is hacktoberfest stats. At least that's how I understand it.
But if you're fine with not using the command the user used then sure we can keep it like ...

It shows the help for me without adding invoke_without_command=True
I am not sure why it doesn't work for me then ๐คท๐ป
This makes sense from a developer perspective but could be modified as it shows up in the .help. How about this, similar to the .aoc command
"""All of the Advent of Code commands."""
or
"""Commands related to Hacktoberfest"""
After rethinking about it I decided it should include two types of issues:
- Python repo, has
hacktoberfestas an issue label. Doesn't matter if it hashacktoberfestin the repo topics. - Python repo, must have
hacktoberfestin the issue's repo topics
This is because they accept PRs where the repo doesn't have the hacktoberfest topic but has the hacktoberfest-accepted label in the PR itself. If an issue has the hacktoberfest label (for type 1), maintainers would probably ...
Connected!
GitHub Actions run 1363472408 succeeded.
Description
Discord's message components and interaction based pagination would be better for the help command.
Reasoning
Since @Sir Lancebot is running on discord.py v2.0 , it would be cool and better to have help command pagination using buttons and interactions instead of reaction based pagination. It takes a little bit of extra time for the current help command session to add reaction to the embedded message, but message components can load instantly without any rate-limi...
Did we agree to remove this?
Can't we just set this to default to an empty list?
We don't mutate the list do we?
Why doesn't this use Arrow? I think it is important we are consistent with our usage moving forward.
6a52e80 Use display_avatar instead of avatar in send_pr... - ks129
[python-discord/sir-lancebot] New branch created: ks123/bugfix/display\_avatar
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Fixes SIR-LANCEBOT-6V
Description
Discord.py 2.0 returns None for avatar if a user has default avatar. display_avatar returns always Asset.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read ...
GitHub Actions run 1364526003 succeeded.
Connected!
GitHub Actions run 1364630704 succeeded.
A relativedelta doesn't accept arrow objects, so I'd have to convert it to a datetime anyway.
Same here, it's then used in a relativedelta.
It'd just cause an extra import. datetime doesn't create ISO strings any worse
In fact it literally uses the isoformat function of the underlying datetime object it holds.
Because I'd have to make sure that anything that uses this converter doesn't choke on the arrow object, and it didn't seem to be worth it. In the end arrow is a convenient wrapper for datetime.
This seems mostly fine now :)
@bast0006 @Akarys42 @ks129 @Bluenix2 Please go over your requested changes and make sure they were addressed.
Can you assign the task to a variable like the crawl task?
Isn't message.content already str?
This condition is incorrect, as public channels don't have overwrites for helpers.
Or maybe your env is outdated
GitHub Actions run 1365859684 succeeded.
GitHub Actions run 1366293816 succeeded.
Discord.py V2.0 changes discord.Colour.blurple to discord's new blurple colour. Since we deciding to stick to the og blurple with our branding, we should change all instances of discord.Colour.blurple() to discord.Colour.og_blurple().
I'm planning to do this tonight :+1:
Description
Change all instances of discord.Colour.blurple() to discord.Colour.og_blurple().
Reasoning
Discord.py V2.0 changes discord.Colour.blurple to discord's new blurple colour, but we decided to stick to the og blurple for our branding. The bots should reflect this decision.
Proposed Implementation
Just a matter of updating all of occurences of discord.Colour.blurple() to discord.Colour.og_blurple()
Would you like to implement this yourself?
...
Same here, no need to wrap it in list()
Wouldn't it be better to construct some "info value" rather than this string work?
GitHub Actions run 1368064462 succeeded.
Oh, thatโs going to be fixed later. I had it as a list so I could subscript it so I only got the top 10 users for later
self._ptr is for the random choosing of a question, itโs quite obsolete so Iโll remove it if thatโs fine
Like a special small marker:
class Info:
"""Special marker class for __setitem__."""
__slots__ = ('userid',)
def __init__(self, userid: int):
self.userid = userid
You then construct this like subscriptable[Info(34456789)] and of course add an implementation for it in __setitem__.
Might be worth mentioning here that naive datetimes will be assumed to be UTC, rather than local time.
we could be using arrow.get here, rather than dateutil.parser, same for line 618 below and a couple of other places in this PR. Doesn't make much different either way though.
Seems good to me, my comments are purely optional and not really impactful overall.
Wait what is this issue actually about? The original issue describes the ability to bookmark commands for ease of finding again, but then the comments start talking about our message bookmarking command. Can this be clarified?
GitHub Actions run 1369189627 succeeded.
I often have it that I'm confused by the !indents tag, and type !indentation instead. Making the tag work on both versions would make it a lot less confusing at times.
GitHub Actions run 1369215809 succeeded.

I like it a lot. You left your reference in the corner of your svg there. Would it be best to remove it?
Hello! Thanks for the PR!
I don't think copy pasting is a good way of handling this. We won't ever think about modifying the other version when modifying one of them. I can think of two solutions, feel free to also suggest your own:
- Create a symlink? I don't know if this is something Git will like, or at least that will be cross-platform, but I think it is worth a try
- Having a special syntax in the file saying has the same content as X, which I believe should be made feasible by ht...
It might be just me, but I like the extra information that is granted by the method name specifying that the date is received in ISO format.
b55add3 Migrate to og_blurple - TizzySaurus
[python-discord/sir-lancebot] New branch created: og\_blurple\-migration
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #923.
Description
Migration from discord.Colour.blurple() to discord.Colour.og_blurple().
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and agree to the [contributing guidelines](...
GitHub Actions run 1369433800 failed.
[python-discord/bot] New branch created: og\_blurple\-migration
Closes #1899.
Migration from discord.Colour.blurple() to discord.Colour.og_blurple().
GitHub Actions run 1369433800 failed.
Sorry, I think I'm missing something, but what would be the purpose of this?
GitHub Actions run 1369464957 failed.
So a typed dict subclass for the embed values?
Well, for the structure of self.current_question.
[python-discord/bot] New branch created: bump\-licenses
Updates the pip-licences version to fix a breaking bug in the currently pinned version.
Example of breakage: workflow run
Relevant bug report: raimon49/pip-licenses/issues/113
That's exactly the quality I am expecting from an engineering student, excellent
GitHub Actions run 1369524344 succeeded.
Absolutely incredible. Nothing short of a miracle how you increased the number like that, very good job!



