#dev-log
1 messages ยท Page 85 of 1
GitHub Actions run 1304843968 succeeded.
Connected!
GitHub Actions run 1304856397 succeeded.
@Kronifer The new API is not live at the moment, and there's no feature freeze on this repo.
GitHub Actions run 1304883678 succeeded.
PR Author
Workflow Run
Source Branch
update-pinned-mod...
As for now, it wouldn't make sense to add Postgres to the CI, since we don't have any relating tests. As a possible solution, maybe I could make "database_url" Optional for now?
Could we get away with setting that to some bogus value for now? I don't think making it optional makes sense from a deployment nor testing perspective. 99% of what the API does needs the database.
Also, am I also supposed to fix linting as well? I've added a new configuration that is similar to the ones use...
GitHub Actions run 1304888022 succeeded.
As for now, it wouldn't make sense to add Postgres to the CI, since we don't have any relating tests. As a possible solution, maybe I could make "database_url" Optional for now?
Could we get away with setting that to some bogus value for now? I don't think making it optional makes sense from a deployment nor testing perspective. 99% of what the API does needs the database.
Also, am I also supposed to fix linting as well? I've added a new configuration that is similar to th...
b38b325 Fix command alias not being a tuple - ChrisLovering
[python-discord/modmail-plugins] New branch created: fix\-type\-alias
[modmail-plugins] Branch fix\-type\-alias was force-pushed to `31f6d51`
[python-discord/modmail-plugins] branch deleted: fix\-type\-alias
ca1216e Monkey patch http.send_typing to catch 403s - ChrisLovering
[python-discord/sir-lancebot] New branch created: catch\-403\-from\-Typing\-calls
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Sometimes discord turns off typing events by throwing 403's, so we should catch those
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](ht...
GitHub Actions run 1305002585 succeeded.
67f8a3b Fixes Test Paths For Windows - HassanAbouelela
[python-discord/site] New branch created: fix\-tests\-on\-windows
Yes, very good. Just a small nitpick. Out of curiosity: Why datetime.now() instead of utcnow()?
IMO this should be a log.debug or log.trace, no? This is rather uninteresting, I think.
this is true, we should probably update it in the other repos too
Yes, very good. Just a small nitpick. Out of curiosity: Why
datetime.now()instead ofutcnow()?
no real reason for using it over utcnow(), is utcnow() preferable?
no real reason for using it over utcnow(), is utcnow() preferable?
I think in case the time zone changes we might get weird log lines here. That happens like twice a year though, and timezones are insane anyways, just like unicode. So personally I prefer it because UTC does not change.
[sir-lancebot] Branch catch\-403\-from\-Typing\-calls was force-pushed to `6fbd788`
GitHub Actions run 1305036739 succeeded.
44e5f47 Use utcnow() and lower a logging level in patch... - ChrisLovering
[python-discord/bot] New branch created: minor\-changes\-to\-typing\-patch
GitHub Actions run 1305046031 succeeded.
bcf503a Improvements to anti-spam log message - TizzySaurus
[python-discord/bot] New branch created: antispam\-log\-improvements
Closes #566.
Fixes a test that fails on Windows due to differing path separators. This is currently the only failing test on windows.
Of note is that this doesn't implement all of 566, as I haven't included windows in the CI. Regardless, I'm pushing this now because I don't know when I'll get around to getting the CI working, and that doesn't need to block this specific bug. This will also give more time for discussion around whether Windows in CI is desirable in the first place.
GitHub Actions run 1305202592 succeeded.
This is what it looks like after 2197fc6:

Discord voice-chat room visitors seeking help frequently post screenshots of their code.
My experience helping people in chat, Stack Overflow, and in real life (Python meetup group office hours, teaching students, etc...) is that getting screenshots instead of copy-pastable code slows the process greatly while I explain that I can't execute their pic, and what to do instead.
It would be great to have something to point them to before they start asking. Here's a part of the revision I am...
[python-discord/sir-lancebot] New comment on issue #502: Riddle command should operate like the Quiz
Im pretty busy at the moment. You can give both of my PRs to others interested.
This seems to be pretty stale, so I'm closing this. @grxpee Feel free to reach out to us in #dev-branding to discuss your ideas, if there's anything else you'd like to contribute with ๐
Since we have a banner now, I'm closing this. If someone's interested in creating a new one at a future date, like you were talking about, that'll be a different issue.
@lemonsaurus We do have this aura Australian ducky now:

It's not quite wearing a hat, but I assume you'd be fine with closing this issue?
not really. we should replace that duck with a true blue Australian.
I like that, thank you Brad.
Closes #1850.
Messages triggering antispam which have attachments will now always be uploaded to the log site, and messages that are truncated will now be uploaded to the paste site as well as showing the truncated version of the message.
GitHub Actions run 1307042021 succeeded.
I'd prefer if that check would explicitly use len()
len(self.messages[0].attachments) > 0,
5e3cf49 Add redirect message when !defcon threshold c... - TizzySaurus
[python-discord/bot] New branch created: defcon\-redirect\-fix
For context the reason for the now -> utcnow change is explained here: https://github.com/python-discord/sir-lancebot/pull/892#issuecomment-933795156
!defcon threshold now uses the @redirect_output decorator in order to provide a redirect-messsage when command is invoked outside of #defcon.
GitHub Actions run 1307171924 succeeded.
I don't really mind as this is a pretty minor thing anyway, but I think just limiting the command to the defcon channel would be a bit nicer. Will approve anyway though as this works I don't think this is something that will be happen much.
I agree, parentheses make sense here.
I'm not sure using log = logging.getLogger(__name__) is the best solution to the circular import problem, although i'm not sure what is either...
Other than that this looks good.
I'm not sure this is the best option here, there was some discussion on discord on this starting here #dev-contrib message, and it seems the conclusion was that the logs here don't work anyway because this is run before logging is set up.
Similar to other comment, although I feel we should be able to use the logger here, and using get_logger for it would be nice, although i'm not sure what the best way forwards with that is. This problem only seems to happen because this file is imported in the utils/__init__.py
74493f2 Make attachments check explicit - TizzySaurus
Fair enough, have committed :+1:
GitHub Actions run 1307494840 succeeded.
self.messages is a dictionary mapping message IDs to message objects, so this doesn't work.
I get this error:
bot_1 | 2021-10-05 12:13:33 | bot.utils.scheduling | ERROR | Error in task AntiSpam._process_deletion_context(frozenset({<Member id=493839819168808962 name='wookie' discriminator='4017' bot=False nick=None guild=<Guild id=813116921646022716 name="wookie's test server" shard_id=None chunked=True member_count=4>>})) 139705866738800!
bot_1 | Traceback (most recent...
Indeed, but I am not sure how that's relevant? I could confirm through testing that's the behaviour we want
GitHub Actions run 1307917072 failed.
GitHub Actions run 1307929521 failed.
GitHub Actions run 1307954303 succeeded.
I was able to test it out this morning. Looks like it works as intended, a pretty cool command! I like the dropdowns and the views.
All seems good to me, works nicely.
I noticed that with commands sometimes logs seem to come through very late. Investigating this it seems that when a BadArgument is raised in a command, it is caught here
https://github.com/python-discord/bot/blob/16918d7c4d3925884b6ce5d1c4c326be4304f3f6/bot/exts/backend/error_handler.py#L34
which runs this https://github.com/python-discord/bot/blob/16918d7c4d3925884b6ce5d1c4c326be4304f3f6/bot/exts/backend/error_handler.py#L225
which runs await self.get_help_command(ctx) before going ...
looks good other than the linting error
Alrighty I am trying to gather my thoughts on how this would work.
There is a main entry point with
@commands.command()
async def color(self, ctx: commands.Context, *, user_input: str) -> None:
We will use regex to try to match for the modes rgb, hsv, hsl, hex, cmyk, a name or random color type. (We will still need to be able to parse out a tuple of values from the regex) This would be opposed to the "mode" method currently.
if rgb_regex_match:
self.rgb_to_all...
a3761be Limit !defcon commands to the #defcon channel. - TizzySaurus
I don't really mind as this is a pretty minor thing anyway, but I think just limiting the command to the defcon channel would be a bit nicer. Will approve anyway though as this works I don't think this is something that will be happen much.
As discussed on discord, this has been implemented :+1:
GitHub Actions run 1308378666 succeeded.
GitHub Actions run 1308394805 succeeded.
LGTM, had a question regarding the order of the shell commands but were clarified in Discord.
[Message](#dev-contrib message)
Didn't you guys figure out that you could pass rgv(r, g, b) directly to Pillow? That would help remove these "conversion methods".
GitHub Actions run 1308507743 succeeded.
This has been changed again, this time decision was to simply have the message relay to both ctx.channel and #defcon.
GitHub Actions run 1308509041 succeeded.
13e5379 Raise InvalidHeaderError if inventory has inval... - Numerlor
ba33608 Display BadArgument to user when invalid header... - Numerlor
8e2dca8 Merge branch 'main' into doc-fetch_inventory-er... - wookie184
e45aa66 Merge pull request #1824 from Numerlor/doc-fetc... - wookie184
ce8246f Merge branch 'main' into antispam-log-improvements - Akarys42
Connected!
GitHub Actions run 1308525664 succeeded.
Connected!
GitHub Actions run 1308537776 succeeded.
I think threshold was meant to be on the next line here :)
Also thoughts on removing the author parameter since we pass in ctx now? I can't think we'd ever want to do an updating threshold on someone elses behalf or something like that lol, reckon it'd always be ctx.author
I'm not a redis expert but this all looks fine and from my testing seems to work well. Thanks!
If you run, for example
!doc setdoc pygame https://www.pygame.org/docs/objects.inv
twice, you'll get a message saying According to the API, your request is malformed. and this error:
bot_1 | 2021-10-05 18:04:59 | bot.exts.backend.error_handler | DEBUG | API responded with 400 for command docs setdoc: {'package': ['documentation link with this package already exists.']}.
We should handle this and give the user a better error message
I think
thresholdwas meant to be on the next line here :)
It was indeed, thank you.
Also thoughts on removing the
authorparameter since we pass in ctx now?
Yeah, that seems fair enough.
Will commit both of these now :+1:
8722118 Fix typo and remove redundant parameter in `_up... - TizzySaurus
GitHub Actions run 1308929957 succeeded.
As you changed the parameters you'll need to change the function invocation too
c77b206 Fix _update_threshold call - TizzySaurus
GitHub Actions run 1308972625 succeeded.
Played around with it, I am satisfied with it now haha. Good job.
Thanks Shom.
Thank you so much @brad90four and @Bluenix2!
This has been resolved with the little re-write :+1:
This has been resolved with the little re-write :+1:
Can we have the command have some minimum threshold?
I tried it with the start of the Bee Movie script, first few seconds of Nicki Minaj's superbass, first page of the Bible, the first sentence of the FitnessGram PACER Test, a paragraph about the MRSA bacteria, the MIT license and your name....
but it wasn't until I brought out the morse code of "Hello World" and Never Gonna Give You Up music video link that I got a failure.
I would perhaps advocate for a 3 minute cooldown. The cooldown still does its job but we limit the "false positives" (as in, times where the cooldown prohibits usage we want to support).
Either way, it works!
Of course we don't get 403s anymore, but this should work considering you changed the time both where it is read and where it is set.
GitHub Actions run 1309183922 failed.
I found some datetimes where the timezones haven't been replaced, should they be? See the following Sourcegraph searches:
GitHub Actions run 1309213211 succeeded.
Have fixed the root issue of the circular imports, so now all files should be using bot.log.get_logger instead of logging.getLogger.
Also added any missing migrations from PRs made after I started this and squashed, fixed the conflicts (all 25), and did a commit for making newlines after imports consistent (part of PyCharm's "Optimize Imports" feature).
This should now be fully read for review @kosayoda @wookie184 :+1:
26be9be Switches HTTP Links To HTTPS - HassanAbouelela
[python-discord/site] New branch created: fix\-http\-links
GitHub Actions run 1309276270 succeeded.
GitHub Actions run 1309285078 succeeded.
Fixed the issues with this and squashed down to one commit.
Should be ready for re-review @wookie184 :+1:
Switches the protocol for external sites where possible. Some sites don't have secure versions, and were skipped.
The skipped sites are:
- http://pyglet.org/ (Under
resources/communities) - http://data8.org/ (Part of the description of the book
Inferential Thinking
The motivation for this PR is that there is no reason to use insecure links on our site (and more accurately, I needed to fix them for something I'm working on), and it's easy enough to switch them out and review.
I'...
GitHub Actions run 1309297456 succeeded.
GitHub Actions run 1309381089 succeeded.
Yup. Yup. Yup. Yup. Yup. Yup.
I like this. One minor nitpick. Feel free to ignore it completely.
in which cases do we have a top_role here? In case this is a member, right? Would it be cleaner to check for isinstance here then? That may help some typecheckers.
Thanks, Chris. This is rock solid.
[python-discord/bot] branch deleted: minor\-changes\-to\-typing\-patch
GitHub Actions run 1309434102 succeeded.
Yeah, top_role is when it's a discord.Member. I'm not sure whether I did hasattr instead of isinstance for a reason or not. I'll check and see - if there's no real reason then isinstanace is probably much clearer.
Connected!
GitHub Actions run 1309446279 succeeded.
a9b02a5 Use isinstance instead of hasattr to determ... - TizzySaurus
Couldn't see a logical reason to stick to hasattr, so have pushed a commit changing to isinstance :+1:
Thanks for the review :+1:
GitHub Actions run 1309455484 succeeded.
I like this. I have a few questions, but apart from that, I like this.
We are on Python 3.9 here, so we could just use list directly, right?
Return a list with all `OffTopicChannelName`s in the database.
I'm kind of 50 / 50 on overriding this to add our own arguments, because this
is also called by REST Framework from what I know. That said, we also have
other places where this method is called, and .filter() is called again on it
right after. Would it make more sense to stick with the definition as-is
(without the changes from all) and update the get_queryset(**params) call
from below to perform the filter itself?
13e5379 Raise InvalidHeaderError if inventory has inval... - Numerlor
ba33608 Display BadArgument to user when invalid header... - Numerlor
6fb6967 Use scheduling create_task util instead of crea... - Numerlor
f6a02d8 Use create_task util instead of asyncio.create_... - Numerlor
71ce990 Adds Core Dev Voting To Changelog Blacklist - HassanAbouelela
78b00dc Remove WatchChannel parent of TalentPool and mi... - ks129
dda3490 Use more accurate command names and docstring f... - ks129
f144bac Migrate nominations history command to non-watc... - ks129
807a27e Migrate Talent Pool Reviewer class to non-watch... - ks129
2d47640 Migrate unnominate command to non-watchchannel - ks129
[python-discord/bot] branch deleted: infract\-then\-dm
Connected!
GitHub Actions run 1309478742 succeeded.
GitHub Actions run 1309507462 succeeded.
Connected!
GitHub Actions run 1309519188 succeeded.
[python-discord/site] New branch created: netlify\-logo
I added the netlify logo to sponsors in preparation for an upcoming change, as well as fixing the CSS to properly resize and place the logos, especially on smaller screens.
GitHub Actions run 1309570938 succeeded.
GitHub Actions run 1309684636 succeeded.
GitHub Actions run 1309702365 succeeded.
GitHub Actions run 1309710522 succeeded.
GitHub Actions run 1309714312 succeeded.
GitHub Actions run 1309721110 succeeded.
GitHub Actions run 1309754381 succeeded.
GitHub Actions run 1309760983 succeeded.
GitHub Actions run 1309805668 succeeded.
GitHub Actions run 1309877981 succeeded.
GitHub Actions run 1310003706 succeeded.
LGTM!
Perfect timing too, I just got bot and site set up and this is pretty much exactly what I followed.
GitHub Actions run 1310025249 succeeded.
GitHub Actions run 1310069159 succeeded.
Connected!
GitHub Actions run 1310092354 succeeded.
Two small things, other than that it looks good.
The comment above the print here doesn't really make sense any more, i'd say it could just be removed
Need an exception class here, KeyError would probably be good, So raise KeyError("message"). That or we could print and then just raise, maybe that would be better as it would keep the context of where the KeyError was raised? Can't remember exactly how these things work
c3eccad Revert "Apply infractions before DMing" - Akarys42
[python-discord/bot] New branch created: revert\-1806\-infract\-then\-dm
Reverts python-discord/bot#1806
This causes notes to send DMs
[python-discord/bot] branch deleted: revert\-1806\-infract\-then\-dm
GitHub Actions run 1312041625 succeeded.
acc3e6f Attempt infraction before DMing - TizzySaurus
[python-discord/bot] New branch created: fix\-infract\-then\-dm
Closes #1805
A fix for #1806.
This time it won't DM when it's not supposed to :p
Connected!
GitHub Actions run 1312107823 succeeded.
GitHub Actions run 1312127145 succeeded.
You'll still keep the context with a raise KeyError("message") so have gone for that.
>>> try:
1 / 0
except ZeroDivisionError:
raise ZeroDivisionError("hello")
Traceback (most recent call last):
File "<pyshell#4>", line 2, in <module>
1 / 0
ZeroDivisionError: division by zero
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<pyshell#4>", line 4, in <module>
raise ZeroDivisionError("hello")
Ze...
GitHub Actions run 1312189503 succeeded.
53e3d22 Distinguish between note/warning and expired in... - TizzySaurus
[python-discord/bot] New branch created: solve\-bot\-1852
Closes #1852.
Error message when editing infraction now distinguishes between a note/warning and an actual expired infraction.
Also made it so that editing reason will fail when date failed to change.
GitHub Actions run 1312251154 succeeded.
Save point to already share the two comments/questions I had. I'll continue reviewing later.
According to the modmail bot repository, the plugin_db is deprecated. I think it simply relays to a method of bot.api.db now:
def get_partition(self, cog):
cls_name = cog.__class__.__name__
return self.bot.api.db.plugins[cls_name]
I can't find it that quickly, but I think the intended way is to use that directly now.
Since you don't pass an event loop, this will eventually call asyncio.create_task directly, right? In bot, we don't do that because the event loop is typically not running yet when Cogs are initialized by the bot. (Or is that outdated? I'm getting a bit d.py rusty.)
asyncio.create_task requires a running event loop.
Update
After much discussion (please refer to the conversation in #dev-contrib starting [here](#dev-contrib message), it has been decided to change the way the user interacts with this command.
<details>
<summary>Expand for the full new usage specification</summary>
<br/>
- Command name:
colour(aliascolor) - Subcommands:
rgb - <red> <green> <blue>- `hsl - <hue> <saturation> <lightne...
Update
After much discussion (please refer to the conversation in
#dev-contribstarting [here](#dev-contrib message), it has been decided to change the way the user interacts with this command.
Expand for the full new usage specification* Command name: `colour` (alias `color`) * Subcommands: * `rgb - <red> <green> <blue>` * `hsl - <hue> <saturation> <...
Why is this called when_to_close? Wouldn't when_to_ping be more descriptive? Or am I misunderstanding the purpose of this class?
Some comments/questions, but feel free to dismiss them without implementing them. They're not too pressing.
If some other exception happened (e.g., another outage in the Discord API), the task will not be removed. I assume this is intended behavior to ensure that the bot will retry the ping later. If not, one option would be to use a finally clause to ensure that the clean-up stage is always attempted regardless of failures.
In theory, this could lead to an inconsistent state between the database and the cached ping_tasks list if the database operation fails for some reason (e.g., network issues). Would that cause issues? Handling that situation also requires a bit of messy logic, so if it's not needed, I wouldn't add it.
Another option here would be to create a layer of abstraction (e.g., using a repository pattern) that manages both the local cache and the remote database, keeping them in sync and failing ...
I am currently getting an error when trying to run this. It seems to be here:
first_kata_div = await to_thread(soup.find_all("div", class_="item-title px-0"))
to_thread takes a function as the argument for what to run, this is instead running soup.find_all and passing the result to to_thread, which causes an error. Looking at the docs, https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread,
it seems something like
first_kata_div = await ...
A lot of these are nitpicks and up to you whether you implement, but I do feel the following should be addressed:
- L101-L102
- trailing commas
- the split
__init__function - the inconsistency of "kata" vs "Kata"
- the inconsistency of "codewars.com" vs "`codewards.com`"
This PR introduces changes such as:
๏ปฟ- chore: Replace tool.poetry.description with GitHub repository description to be consistent
- deps: Add taskipy as a development dependency
- feat: Add new taskipy tasks to aid with development
GitHub Actions run 1313316519 succeeded.
I would like to keep the format of the embed the same, if we can. Example in message
The same as in, constant across commands. Or as in, the same as it is in the current state of this PR?
I would like to keep the format of the embed the same, if we can. Example in message
The same as in, constant across commands. Or as in, the same as it is in the current state of this PR?
The same as in the current state of the PR, with the vertical spacing of the fields. Unless we want to move away from that entirely?
GitHub Actions run 1313603998 succeeded.
9d2f4d2 Decrease page size for user list endpoint. - jchristgit
[python-discord/site] New branch created: decrease\-batch\-size\-for\-user\-list\-endpoint
From some debugging via python-discord/kubernetes#96, we have determined
that this endpoint results in high latencies to the site and eventually
Kubernetes killing off site pods randomly.
GitHub Actions run 1313651195 failed.
b40459a Add appeal categories to mod categories - ChrisLovering
[python-discord/bot] New branch created: add\-appeals\-categories
This allows us to run moderation commands in the appeal categories
GitHub Actions run 1313684263 succeeded.
aa00efc Allow empty value for inventory url field - Numerlor
58e0611 Move base_url field to the end - Numerlor
cc3407e Update gunicorn options for deployment - jb3
b84bd10 Merge pull request #573 from python-discord/jb3... - jchristgit
e85a641 Merge branch 'main' into doc-blank-base_url - ChrisLovering
GitHub Actions run 1313711107 succeeded.
GitHub Actions run 1313715735 succeeded.
GitHub Actions run 1313720952 succeeded.
Connected!
GitHub Actions run 1313730635 succeeded.
GitHub Actions run 1313757250 succeeded.
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
ce75197 Merge branch 'master' into subdomains-to-query-... - jchristgit
3c2fcb8 Merge pull request #526 from python-discord/sub... - jb3
[python-discord/site] branch deleted: subdomains\-to\-query\-paths
[python-discord/bot] branch deleted: kill\-subdomains
6a129ca Update ALLOWED_HOSTS to include internal address - jb3
[python-discord/site] New branch created: jb3/add\-site\-local\-svc
Hello!
Thanks for your interest in our projects, however our contributing guidelines require a body for your PR. Please review, and we'll proceed.
[python-discord/site] branch deleted: jb3/add\-site\-local\-svc
[python-discord/site] Checks Successful on PR: #604 Update ALLOWED_HOSTS to include internal address
GitHub Actions run 1313787821 succeeded.
Connected!
Do you perhaps want to convert this to a draft?
Do you perhaps want to convert this to a draft?
Yeah, that seems smart so have done so. I don't think I'll be able to work on this much for a week or so.
Pleasse remember to remove your debug statements.
We can restructure this code like this:
match = self.fuzzy_match_header(query)
if not match:
embed = Embed(
title=random.choice(constants.ERROR_REPLIES),
description=ERROR_MESSAGE,
colour=constants.Colours.soft_red,
)
await ctx.send(embed=embed)
return
embed = Embed(
title="WTF Python?!",
colour=constants.Colours.dar...
Current command that we have will be named voicemute
New command will be named voiceban
Could only find one thing, and have not tested the code reviewed here. Otherwise looks to be solid to me.
In regards to python-discord/bot#1849
The linked issue will do the following:
- Rename the current
voicebancommand tovoicemute - Create a new command called
voiceban
So we will need to add a relevant new type as well as convert the current voiceban infractions to voicemutes.
Committed in b39904b39e3dcfba062e1697d335e4cea6ef0968 and 637faa8e555af222ed7a6432cf6265cfbeeae9d0
Logo: (taken from previous assets) https://github.com/python-discord/branding/blob/main/events/halloween/server_icons/logo_256.png?raw=true
Banner: https://github.com/python-discord/branding/blob/main/events/halloween/banner.png?raw=true
This seems like a great idea, but that brings forth the question of if we should phase out all reactions or not
id be interested in doing this
I'm putting this on pause until I have
.quackdone
.quack has been merged. Can you finish up this PR? Also, there seems to be a singular file conflict with poetry.lock. Please fix that up.
I've also tested this locally now! Everything is functioning as expected.
@Xithrius thanks for reminding me that this exists, I'll get on it soon
When committing suggestions through GitHub, it's possible to change the message that the commit contains. Given this, please follow our guidelines for writing great commit messages.
Otherwise, looks good to me. Thanks for creating this PR!
GitHub Actions run 1317610269 succeeded.
Connected!
GitHub Actions run 1317624347 succeeded.
[sir-lancebot] Branch topic\-command\-cooldown was force-pushed to `515c639`
GitHub Actions run 1317638775 succeeded.
Connected!
GitHub Actions run 1317648551 succeeded.
Yea, you're right. This must have been a copy-paste oversight. I'll change this.
How frustrating, since the method I used is what they suggest on the wiki https://github.com/kyb3r/modmail/wiki/Plugins#database-interfacing
I'll double check around the place and find the "proper" way to do this now.
@TizzySaurus can you make this change and I can approve it?
This is a good point, I'll move it into a finally to ensure these pings are cleaned up.
Huh I'm not too sure, this code, along with the helper util were pulled directly from the bot.
We add tasks in this way in cog init's all the time in the bot, so it must be something d.py is doing under the hood.
I'm not too familiar with the internal to say why it's working, only that it seems to be.
We do make sure to add the bot loop to this call when creating a task after running the bot though.
This pull request template was mainly added so that the second bullet point in this PR comment can be addressed.
GitHub Actions run 1317809057 succeeded.
GitHub Actions run 1317837869 succeeded.
GitHub Actions run 1317873532 succeeded.
This feels unclear. Maybe something more like this from the Lancebot repository?
Describe what changes you made, and how you've implemented them.
Is this really needed? Couldn't you just say "one of the following" up above?
bb23a46 Add a pull request template - doublevcodes
3d97138 chore: Add comments to instruct users - doublevcodes
1bb70f3 chore: Replace examples with comments - doublevcodes
b57c7e8 fix: clarify descirption of changes section - doublevcodes
5985beb Merge pull request #606 from doublevcodes/patch-1 - jb3
GitHub Actions run 1317990922 succeeded.
Everything looks good!
0cc435c Candy collection: fix positional arg being pass... - Akarys42
[python-discord/sir-lancebot] New branch created: bug/candy\-collection/fix\-typeerror\-id
This caused a TypeError to be raised, as the id argument could only be used as a positional argument and not by keyword.
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Did you:
- [ ] Join the Python Discord Community?
- [ ] Read all the comments in this template?
- [ ] Ensure there is an issue open, or link relevant discord discussions?
- [ ] Read and ...
GitHub Actions run 1319134875 succeeded.
Description
When bot adds reaction to .topic , and then user tries reacting happens on it. If moderator reacts to reaction, then it works.
Steps to Reproduce
- Use
.topicwithout any mod role - Click the reaction
- Nothing happens
Expected Behaviour
On reaction bot should refresh the topic.
Actual Behaviour
When non moderator reacts to message the bot does not refresh anything.
Known Impacted Platforms
- [ ] Web
- [x] Desktop
- [x] A...
@TizzySaurus has said he'd like to work on this
@vcokltfre Are you still wanting to do this yourself? If not, it seems Kronifer is interested.
GitHub Actions run 1319682273 succeeded.
@Bluenix2 Have just committed :+1:. Thanks for the bump-reminder.
For self-reference, the issue is that this if statement compares the user.id against message.author.id, where the message author is the bot -- not the user who invoked the command.
This PR will likely mean a little bit of reshuffling so that we have access to the ctx/ctx.author
Note that in the `asyncio.run()`, where we appear to be calling `main()`, this does not execute the code in `main`. Rather, it creates and returns a new `coroutine` object (i.e `main() is not main()`) which is then handled and run by the event loop via `asyncio.run()`.
While you're doing this, could you also have the bot remove the user's reactions after it's refreshed the topic?
GitHub Actions run 1319910662 succeeded.
999604b .topic command improvements. - TizzySaurus
[python-discord/sir-lancebot] New branch created: topic\-improvements
- Fix bug where command author couldn't re-roll
- Now removes user's reaction up re-roll
- Added a missing
breakstatement
Relevant Issues
Closes #894.
Extension of #880.
Description
- Fixed a bug where command author couldn't re-roll (the if statement was checking against
message.authorwhich is the bot, instead of the command invoker) - Now removes user's reaction up re-roll (as requested by @ChrisLovering)
- Added a missing
breakstatement (nowbreaks when the `w...
GitHub Actions run 1319982452 succeeded.
We should suppress NotFound for this call, in case the user removes their own reaction before the bot can get to it.
Thinking of it, the line above should also have NotFound suppressed, in case the topic message gets deleted while processing the predicate.
Just one request, rest looks good to me
If I look at a few random cogs in the bot, then I'm seeing the loop being passed explicitly, like here:
self.init_task = scheduling.create_task(self.init_cog(), event_loop=self.bot.loop)
Passing an explicit loop object means that it will work with a loop that has not been started yet.
I don't really know either; I only came across it when I was trying to find out what this did during my review.
There is already a configurable ping string in modmail itself, we should use that, rather than roll our own.
GitHub Actions run 1320481632 succeeded.
GitHub Actions run 1320492180 succeeded.
[python-discord/sir-lancebot] branch deleted: bug/candy\-collection/fix\-typeerror\-id
Connected!
GitHub Actions run 1320504410 succeeded.
[python-discord/sir-lancebot] New branch created: update\-role\-constants
Relevant Issues
N/A (discussed with @ChrisLovering on discord [here](#dev-contrib message))
Description
- Renamed
constants.Roles.moderatortoconstants.Roles.moderation_team. - Added ability to set the value of
Roles.owner,Roles.moderation_teamandRoles.core_developersin.envfile.
NB: This change will require editing the relevant sections of the following two files on the site repo: [apps/cont...
[sir-lancebot] Branch update\-role\-constants was force-pushed to `457e05d`
GitHub Actions run 1320581264 succeeded.
[sir-lancebot] Branch update\-role\-constants was force-pushed to `8f091a7`
[sir-lancebot] Branch update\-role\-constants was force-pushed to `67e5683`
GitHub Actions run 1320609357 succeeded.
GitHub Actions run 1320627198 succeeded.
[sir-lancebot] Branch update\-role\-constants was force-pushed to `1d0e9bd`
GitHub Actions run 1320643226 succeeded.
39c7795 Add ROLE_OWNERS and ROLE_MODERATION_TEAM - TizzySaurus
[python-discord/site] New branch created: lancebot\-env\-changes
1ab99ef Add ROLE_OWNERS, ROLE_MODERATION_TEAM, `ROL... - TizzySaurus
f9a2a16 Add missing Core Developers role - TizzySaurus
This PR makes documentation reflect the changes made in sir-lancebot#896, as well as adding a few missing details such as backquotes.
22d2ae8 Add missing Core Developers role - TizzySaurus
GitHub Actions run 1320686886 succeeded.
GitHub Actions run 1320722885 succeeded.
GitHub Actions run 1320733241 succeeded.
GitHub Actions run 1321018423 succeeded.
Looks pretty good to me! Vestergurkan said he'd have a look, so I'll leave this here for him too.
[python-discord/sir-lancebot] branch deleted: topic\-improvements
999604b .topic command improvements. - TizzySaurus
3c26b4d Add handling for discord.NotFound when re-rol... - TizzySaurus
e01503a Remove unnecessary else - TizzySaurus
be87067 Merge branch 'main' into topic-improvements - Xithrius
0cc1e8a Merge pull request #895 from python-discord/top... - Xithrius
GitHub Actions run 1321571554 succeeded.
Connected!
GitHub Actions run 1321574969 succeeded.
Thanks for making this banner. It looks great!
I just have a few comments/questions about this:
- Why was the
logo.svgfile deleted? - Is a vector (
.svg) version of the banner available? It's good to have the source files available in the branding repo.
I'd also like to note that there's a (very minor) imperfection where you edited the "Y", shown below, but it's unnoticeable enough that I'll let it pass.
.
I'd even say Helpers is stretching it a bit as what is necessary, although probably fair to mention so one can differentiate between MODERATION_ROLES and STAFF_ROLES in testing.
f316b3d Replace usage of bot.command_prefix with consta... - wookie184
[python-discord/sir-lancebot] New branch created: command\-prefix\-fix
Relevant Issues
Fixes an issue where you got messages like Game is already running... do <function when_mentioned_or..inner at 0x7fe4412a8ee0>quiz stop because command_prefix isn't always a string https://discordpy.readthedocs.io/en/stable/ext/commands/api.html?highlight=bot command_prefix#discord.ext.commands.Bot.command_prefix
Description
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this...
GitHub Actions run 1323788269 succeeded.
GitHub Actions run 1323798374 succeeded.
Connected!
GitHub Actions run 1323800917 succeeded.
The checks for == Roles.moderation_team should probably be changed to in MODERATION_ROLES, but this all seems like this should work.
I'd rather have the robots.txt content in a multi-line string than with \n, also we shouldn't allow everything, we should disallow /admin/.
What's the value in disallowing /admin/ though?
@Akarys42 can you address the merge conflict and Joe's comment? It's good to me otherwise.
ef37848 Automatically adjust test to page_size. - jchristgit
[site] Branch decrease\-batch\-size\-for\-user\-list\-endpoint was force-pushed to `4c527e7`
[python-discord/site] branch deleted: decrease\-batch\-size\-for\-user\-list\-endpoint
GitHub Actions run 1323881747 succeeded.
c4d7ad1 Generate SQLAlchemy models based on the current... - D0rs4n
0706001 Make model class naming more consistent, add mo... - D0rs4n
3ed24c4 Remove 'api' prefix from model tablenames - D0rs4n
aaf362c Add new NominationEntry model, Validations and ... - D0rs4n
04c9e86 Implement futher validations in models - D0rs4n
GitHub Actions run 1323942589 failed.
[python-discord/bot] New branch created: fix\-delayed\-logs
Closes #1857
I also removed a comment that seemed to no longer be valid, made a change to clean up some code, and another to move some log calls to before ctx.sends
I don't like this repeating log.debug. Maybe this could be solved by running coroutine in the background and waiting after log instead?
GitHub Actions run 1324027561 succeeded.
I don't like this repeating
log.debug. Maybe this could be solved by running coroutine in the background and waiting after log instead?
All this really does is change the code from indicating conditions that shouldn't be logged, to conditions that should be logged. Rather than repeating return # Exit early to avoid logging. we are repeating log.debug. I think this is a more readable way of doing things, and makes it clear that the logs will run without being delayed by any...
53bbaac Implement voice mute + migration from voice mut... - ks129
[python-discord/site] New branch created: voicemute
Closes #605
Added new voice_mute infraction type, added migration to migrate existing voice bans to voice mutes. Had to upper type's max length from 9 to 10.
Voice mute cannot be hidden.
THIS HAS TO BE MERGED AT THE SAME TIME AS BOT PR!
GitHub Actions run 1324203615 succeeded.
bdbbf2a Check role id in MODERATION_ROLES instead of co... - TizzySaurus
The checks for
== Roles.moderation_teamshould probably be changed toin MODERATION_ROLES, but this all seems like this should work.
Thanks for the review; have changed the checks :+1:
GitHub Actions run 1324387897 succeeded.
[python-discord/site] New branch created: static\-previews
There's still some comments left so I'll wait for those to get resolved before taking another full review.
How does this work? Users cannot send embeds?
The linting action complained that this was unused.
It's finally here! Static previews on the site.
This PR uses django-distill to build a static version of the site, which is then deployed and hosted on netlify. Netlify will give us a static preview of the main branch, and it'll also give us previews on PRs. You can find examples of what that'll look like on my fork here:
https://github.com/HassanAbouelela/site-1/pull/8
This is a static preview of the changes made in #591.
Important!
1...
GitHub Actions run 1324495860 succeeded.
Redirects
The situation with redirects is a little complex, so I've decided to give it it's own comment here.
I've put a lot of work into redirects (you can see my latest efforts here. You can find those changes deployed to this preview branch.
In short: it really does not work as intended yet, and it's already too complex, and to...
I've done some more work on the redirects. The latest changes on the branch I linked in my previous comment are deployed here.
Now, while my changes do work, they still feel sloppy. I did a bit more digging though, and I found a lot of guides and articles still using old links, so I'm not sure what the right call is here.
There's also a question of cost, since we generate ~40 extra HTML files for redirects alone. It's probab...
Decided to ignore the caching problems, since we'll only save just around 15 seconds anyways. The buildx cache does not play nice with regular docker builds, and I couldn't figure out how to run an image built by buildx. If someone else wants to give it a shot, they are more than welcome to, otherwise, I'm marking this PR as ready.
This reads soooo much better, thank you! I didn't know setting up a poetry environment for the bot was completely unnecessary haha :)
I've set up an instance of the bot earlier today and I've found setting urls.site to "web:8000" broke it:
bot_1 | Traceback (most recent call last):
bot_1 | File "/bot/bot/api.py", line 66, in maybe_raise_for_status
bot_1 | response_json = await response.json()
bot_1 | File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1097, in json
bot_1 | raise ContentTypeError(
bot_1 | aiohttp.client_exceptions.Con...
The subdomains were removed from the site a few days ago, so I need to update the guide ๐
@ichard26 thanks, now I know I need to a section on why you might want to set up the env anyway ๐
Well okay to be clear I meant that if you were using docker (like me). If running on the host then doing a poetry dev install is important ๐
Well okay to be clear I meant that if you were using docker (like me) it's a step you can skip. If running on the host then doing a poetry dev install is important ๐
What I mean is that you'll want to have the env to lint and test before committing, unless you interactively run the container
@janine9vn Please address the request for reviews when you're available.
GitHub Actions run 1325431049 succeeded.
Could you add small docstrings describing what these variables do?
I can sort-of guess MESSAGE_DELETE_DELAY, but I am not sure what DEFAULT_TRAVERSE would do. Also, could we maybe place these on the cog itself?
I like this. I have a few comments, but I like it.
Up there you add the type aliases unconditionally, down here if TYPE_CHECKING, would it make sense to just add all of them unconditionally?
As with the BadArgument raise above, should we add from e here to preserve traceback information, or do you think e.msg is sufficient?
Isn't this branch redundant? The default values is we don't go into the if branch are identical.
Minor comment, everything else looks fine.
I think discord takes all date-times as the date-time of the client(date-time of the system bot is running on), so this wouldn't do the correct thing. I may be wrong.
1e6d9bd Improve logic to remove redundant else clauses - TizzySaurus
Good catch. Have updated this in 1e6d9bd :+1:
GitHub Actions run 1325540318 succeeded.
@jchristgit time.time() is UTC, but datetime.utcnow().timestamp() is not. ๐ You can verify by pasting those timestamps into e.g. https://www.unixtimestamp.com/
I wrote about it in more detail here but the tldr is that utcnow gives a naive timestamp, so when you call timestamp on it, it shifts to UTC again. It's entirely counter-intuitive.
It was [suggested on discord](#mod-tools message) by @codephile1221 that when viewing an infraction via the !infraction command, it should have a DM Sent field for reference -- particularly helpful in the case of a warning as the user may not even realise they were warned for a certain behaviour.
This will require a PR to site since means updating the database schema.
7fc4ad6 Fixes Caching On Docker Build - HassanAbouelela
GitHub Actions run 1325575468 succeeded.
GitHub Actions run 1325584615 succeeded.
GitHub Actions run 1325585930 succeeded.
GitHub Actions run 1325598856 succeeded.
GitHub Actions run 1325599023 succeeded.
GitHub Actions run 1325601713 succeeded.
GitHub Actions run 1325601707 succeeded.
GitHub Actions run 1325609850 succeeded.
@kwzrd jesus christ, what the hell did I just read. Thanks for the heads up. Apparently I have been wrongfully suggesting this at work and elsewhere for years. What the hell. Jesus Christ. What the fuck.
Okay, apart from the fact that I have some cleaning to do at work tomorrow, with an aware instance, it seems to do the correct thing. I always thought time.time() isn't UTC... jesus christ, can we deprecate timezones ?? What the hell.
>>> datetime.datetime.now(tz=datetime.timez...
Yup, yup, sounds good, then this is fine.
GitHub Actions run 1325620495 succeeded.
This is very cool!!!!!!!!!!!! Nice work on the documentation. I have a few smaller comments, but actually they are more like questions. You can deal with them, or you can not. This looks good from an implementation perspective.
Is there no way that we can re-use the main Dockerfile here?
Hmm, why the double underscores here? Would it be more clean to use __all__ to signify what is external?
Since we use this variable outside of this block, would it be more clean to define it on a separate line? Just a thought.
I had initially avoided that so we can have each on a separate repo, and utilize cache better, but in it's current state, yeah it can be done.
Changed in 79259eb8
GitHub Actions run 1325722364 succeeded.
My intention was to explicitly hide it because while it is technically a utility, it probably shouldn't be used directly from this file. I'm not sure if placing it under all conveys the same intention. It can still be imported and nothing will complain AFAIK.
What do you think?
Yes, that makes sense to me.
Rock solid work. Thank you very much. Lemon will be very happy about this.
Hmm, out of curiosity, can't Django do a bulk update for all these infractions? It's probably a small count anyways, so it doesn't matter too much.
This looks good to me. Thank you!
THIS HAS TO BE MERGED AT THE SAME TIME AS BOT PR!
Can you link the bot PR? From a quick search, I couldn't find it
GitHub Actions run 1325796078 succeeded.
Yea that's true. I can't think of a reason that an embed would appear in a thread without it being triggered by someone, which would imply they have seen the thread. So I'm not sure this is an issue either.
This is true. I am currently wondering if the cache is even worth it, since at this level getting data from the mongo db directly wouldn't add much noticeable delay.
d447db8 Specifiy the bot loop when creating the init task - ChrisLovering
FWIW, I realised the reason I got away with this here is because plugins are loaded after the main bot is already up and running, so there's always a running event loop. Specifying the bot loop explicitly is still better here though.
GitHub Actions run 1325993750 succeeded.
I'm not sure if this is the right behavior. When we go into the if failed branch and for hidden infractions, we don't want to show an envelope since there is nothing to be delivered. I guess we can just reset these two in those branches.
I'd like to fix this issue as my first code contribution to the repo ^^ ... I suppose I should just assign this to myself or is that not how this works?
#526 and python-discord/bot#1630 removed subdomains from the bot and site this week, but we still need to update the guides to reflect those changes.
What needs to be done:
- Under the configure the bot section, we will need to remove the mentions of subdomains, and instead mention query paths (
localhost:8000/apifor instance). - We should delete the guide on [setting up hosts](https://www.py...
I found some datetimes where the timezones haven't been replaced, should they be? See the following Sourcegraph searches:
Went over those, they should (...
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
GitHub Actions run 1326133748 succeeded.
Add new Infraction type Voice Mute, to the Infraction model (according to this PR)
This should grab the text generated by the embed, i.e the preview of an article or something like that. This was a feature of the old uwu so I kept it for feature parity.
036f1b6 Uses Nightly To Download Artifacts - HassanAbouelela
Hey @jchristgit I've made some slight changes to the netlify build file. We now use https://nightly.site instead of a github token to increase security in our builds. Functionally, everything is still the same, and tested working on my fork.
GitHub Actions run 1326255387 succeeded.
@HassanAbouelela thanks! That's great news. More security ๐ข๐ฎ๐น
412f9b4 Handle 400 when setting pre-existing doc package - ichard26
[python-discord/bot] New branch created: fix\-bot\-1858
If you run, for example:
!doc setdoc black https://black.readthedocs/en/stable/objects.inv
twice over. You'll get an unhelpful "According to the API, your request
is malformed." error message back. This commit adds an error handler
to catch the HTTP 400 and tell the user the package already exists.
Fixes #1858
FYI this is my first proper contribution to the project so have fun requesting changes :wink:
[python-discord/bot] Checks Successful on PR: #1865 Handle 400 when setting pre-existing doc package
GitHub Actions run 1326311487 succeeded.
[python-discord/bot] Checks Successful on PR: #1865 Handle 400 when setting pre-existing doc package
GitHub Actions run 1326315793 succeeded.
Looks good to me and works locally, thanks :D
Hello I am here to bikeshed, please stay calm.
Would flipping this looks better?
Flip the if-statement to check if the status is not 400 and "already exists" does not exist in the package, then raise immediately and move the "safe" code out an indentation.
This should have the all-familiar :x:
I prefer it this way, rather than do a if with two nots in it. deal with the things we want to catch first, then raise afterwards
Works nicely, thanks!
Only thing I noticed while testing is that you can also get the same error from using a package name that is too long (50 seems to be the max). You can add something to handle this if you'd like.
GitHub Actions run 1326441883 succeeded.
await ctx.send(f"Package {package_name} has already been added.")
Is that a typo there?
Well, I've seen the latest developments here after I opened an issue. I'll just link it to this PR
haha, let's ignore the fact at least four people missed this :p
41749a4 Adds Redirects To Static Builds - HassanAbouelela
[python-discord/site] New branch created: redirects
This PR continues the work done in #609, but adds redirects.
I've left quite a few comments there about redirects, and this is where I ended up now. It's kind of complicated, and not the most useful thing, so I decided to split it into a separate PR to help us decide what to do.
GitHub Actions run 1326479509 failed.
GitHub Actions run 1326545574 succeeded.
GitHub Actions run 1326549622 succeeded.
This PR is not ready to be merged once reviewed, please wait for the great merge event.
This PR is not ready to be merged once reviewed, please wait for the great merge event.
@janine9vn Please address the reviews when you're available.
Will get this done this weekend~ (Totally missed that I had comments on this >_>)
Yeah, that wasn't the correct behaviour. Should now be fixed :+1:
GitHub Actions run 1326632407 succeeded.
This is coming from python-discord/meta#150.
Context
For recurring events where users might want to be notified about happenings, I'd like to add roles where we can ping people about information. The most notable application here is for PyWeek! Considering this functionality is very similar to the !subscribe command, we've determined the best UX would be to utilize the Discord Button Components and change how the !subscribe command works.
Details
This should have a button...
I'd like to add to this that the implementation should be extendable. IE adding a new role would just be the case of adding an ID to a list.
[python-discord/bot] Checks Successful on PR: #1865 Handle 400 when setting pre-existing doc package
GitHub Actions run 1326653371 succeeded.
GitHub Actions run 1326663931 succeeded.
Connected!
GitHub Actions run 1326832652 was cancelled.
GitHub Actions run 1326833984 succeeded.
Update: Good news! I am almost done with my exams, would be going through the reviews and mentioning the required changes within this week, I would be focusing on this PR over the other 2 first ๐
GitHub Actions run 1327806068 succeeded.
GitHub Actions run 1327890989 succeeded.
GitHub Actions run 1327941032 succeeded.
[python-discord/.github] New branch created: review\-policies/do\-not\-merge\-tag
This adds a rule that won't ever complete (require a review from the ghost user, which cannot exist).
The rule is only applied if a "DO NOT MERGE" label is added to the PR.
The PR also adds @janine9vn to the event rule.
I'd rather have something that matches our other labels, like review: do not merge.
8340885 Review: 'DO NOT MERGE' -> 'review: do not merge' - Akarys42
WIth the latest changes, some infraction types will send messages twice. Warns, for instance, get sent in the original block, then get sent again in the modified block.
We can get around this by adding a conditional opoosite to the not in (ban, kick) from the new block, but perhaps we should instead rework this so it's a little less confusing?
WIth the latest changes, some infraction types will send messages twice. Warns, for instance, get sent in the original block, then get sent again in the modified block.
We can get around this by adding a conditional opoosite to the
not in (ban, kick)from the new block, but perhaps we should instead rework this so it's a little less confusing?
For some reason the second part of the if statement was missing. if not infraction["hidden"]: should be `if not infraction["hidden"] an...
371869a Only send DM before applying infraction for ban... - TizzySaurus
GitHub Actions run 1328617004 succeeded.
[python-discord/.github] branch deleted: review\-policies/do\-not\-merge\-tag
[python-discord/bot] branch deleted: tags\-revision
GitHub Actions run 1328646103 succeeded.
Connected!
GitHub Actions run 1328662155 succeeded.
GitHub Actions run 1328751956 succeeded.
Adminshould be the only role needed to test sir-lancebot features, so I think that's the only role we should mention on the main page (it makes sense to list the others on the reference page though).I'd even say
Helpersis stretching it a bit as what is necessary, although probably fair to mention so one can differentiate betweenMODERATION_ROLESandSTAFF_ROLESin testing.
How exactly do you define "needed"? All of these roles are used within different checks etc. so to...
Most of these roles are not needed to test the functionality of something. Yes they may be used in checks, but do you for instance need to test with mod,admin,etc or, would just admin suffice. Same sort of philosophy as the test server. You don't need all channels, to use the bot, so here is a shorter list of ones you do need. I think that's even more important here since we already have problems with the guides.
Unless you are adding a feature that needs that role specifically, we probabl...
[python-discord/sir-lancebot] Issue opened: #898 AttributeError: 'AI' object has no attribute 'user'
Sentry Issue: SIR-LANCEBOT-6M
AttributeError: 'AI' object has no attribute 'user'
(8 additional frame(s) were not displayed)
...
File "discord/ext/commands/core.py", line 1124, in can_run
return await discord.utils.async_all(predicate(ctx) for predicate in predicates) # type: ignore
File "discord/utils.py", line 522, in async_all
elem = await elem
File "bot/exts/fun/tic_tac_toe...
b6a9ee8 Set AI.user to @Python - TizzySaurus
[python-discord/sir-lancebot] New branch created: fix\-issue\-898
Relevant Issues
Closes #898 .
Description
Resolved the AttributeError by setting AI.user to the bot (ctx.me)
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 1329037694 succeeded.
I'll implement this shortly, along with the other change in regarding the Infractions model.
I'll implement this shortly, along with the other change in regarding the Infractions model.
Duplicate of #772
Good catch.
It seems in that issue they were planning to do isinstance checks, whereas I just set AI.user to @Sir Lancebot since that's way simpler. It also seems the user planning to do #772 never actually got around to it.
Yeah ๐๐ป Although there is an additional fix for game.channel mentioned by myself on the issue.
I can implement that as well I guess :+1:
462b83c Add missing Game.channel attribute - TizzySaurus
I didn't realise this PR existed; ended up solving myself in #899 by just setting AI.user to be @Sir Lancebot (since it's easier and less messy than having to do a bunch of isinstance checks).
Also added the missing Game.channel attribute that Shivansh pointed out.
Sorry for stealing this ๐
GitHub Actions run 1329121925 succeeded.
I'll implement this shortly, along with the other change in regarding the Infractions model.
As discussed on discord, I'm planning to do this myself as part of bot#1864.
[python-discord/snekbox] New branch created: bump\-310
It was decided internally on Discord that this PR isn't something we're after.
We'd like to keep config to a bare minimum to make setting up the bot easier, and since the only strictly necessary role is Admins, that should be the only one that's configurable (as is currently the case).
[python-discord/site] branch deleted: lancebot\-env\-changes
It was decided internally on Discord that this PR isn't something we're after.
We'd like to keep config to a bare minimum to make setting up the bot easier, and since the only strictly necessary role is Admins, that should be the only one that's configurable (as is currently the case).
[python-discord/sir-lancebot] branch deleted: update\-role\-constants
11d00e7 Rename Roles.moderator to Roles.moderation_t... - TizzySaurus [71d800a](https://github.com/python-discord/sir-lancebot/commit/71d800add94df3d678786ab482747ae904290129) Rename Roles.admintoRoles.admins - TizzySaurus [dc5f73b](https://github.com/python-discord/sir-lancebot/commit/dc5f73be8c18ef11c701822e8c600c8fca7b149c) Rename Roles.ownertoRoles.owners - TizzySaurus [e2da188](https://github.com/python-discord/sir-lancebot/commit/e2da188b554aba07b6c5a7a25b8af0baa74973cb) Check role id in MODERATION_ROLES instead of co... - TizzySaurus [aa272db`](https://github.com/python-discord/sir-lancebot/commit/aa272dbe789e86013969bc6f4e506d70ddfc63be) Check role id in STAFF_ROLES instead of compari... - TizzySaurus
[python-discord/sir-lancebot] New branch created: update\-role\-constants
Relevant Issues
N/A; this is a refined version of #896
Description
- Renamed some role constants to reflect their in-server name
- Added some safeguarding for
.rolesattribute - Corrected some typehints from
MembertoUnion[User, Member] - Made some AOC commands guild-only since they require
Memberattributes (e.g..aoc subscribewhich updates the invoker's roles)
Did you:
- [x] Join the Python Discord Community?
- [x] Re...
GitHub Actions run 1329301799 succeeded.
Having a weird thing with coverage, where it seems to think a branch was not hit when it was supposed to. That is theoretically possible, but the code and tests did not change, so I don't think there is an actual decrease in coverage, just either a bug with coverage now, or the one used to generate the initial report. I do not think this is related to my changes.
@InvisibleOS design wise, this is excellent! The only real issue now is the SVG itself.
There's currently text for "Python" and "Discord". When submitting source files (like SVGs), I'd recommend converting the text objects into paths (curves). Otherwise, anyone who doesn't have the font installed can't view the SVG correctly.
I'm far from an Inkscape expert, but I'll try to help you with this if you don't know (or can't figure out) how to do this ๐
GitHub Actions run 1330590891 succeeded.
b71e63c Uses Coveralls Github Action - HassanAbouelela
I'll leave this here as a historical footnote:
The latest 5.x version of coverage.py seems to have changed/broken something that meant we ended up with a lower coverage % than we did on main when it was last published. Version 6.x fixes that problem, but does not appear to be compatible with coveralls.
With no clear fix available, Mark suggested we remove the failure on coverage decreases, which is exactly what was done through the coveralls site. The coverage will technically be incorr...
GitHub Actions run 1330981115 succeeded.
I am not sure if that would be required, its just 3 trace logs and aren't doing any harm. Summarising would add unnecessary complexity to it, where you need to collect the IDs in a iterable and then log them.
make_message_link_embed may return None if an exception was raised or helpers don't have message read perms in that linked message channel.
Relevant Issues
Closes #847
Description
This PR is designed to add a fun Madlibs game to Sir Lancebot.
When the command, .madlibs, is run, the bot will ask the user to enter a word that fits a random part of speech (e.g. noun, adjective, verb, plural noun, etc.). The user will simply send a message with any word that fits the given part of speech.
The bot chooses a random number of user inputs to use for the game and a random story.
Once the user has finished entering...
GitHub Actions run 1331194330 failed.
GitHub Actions run 1331199944 failed.
GitHub Actions run 1331202471 succeeded.
It isn't using the persistent scheduler, depending on whichever PR would get merged first, the other can do the required changes, it would be a quick change anyhow.
GitHub Actions run 1331216881 failed.
Many of us aren't using redis on the bot, thus the async rediscache won't persist across runs and would be cleared. Hence for the purpose of testing, I have added those links, they would be removed before merging, as told in the PR description.
GitHub Actions run 1331222925 failed.
The message link of the message which "ran" the command to unload the extension.
We are using the unload_command to unload any extension, all unloads would pass through that function hence the logic for adding it to unloads cache is set in there.
Andd I didn't get why you commented this on the above code lines ๐ค
GitHub Actions run 1331356725 failed.
We will be using a worker for this
[python-discord/site] branch deleted: robots\.txt
GitHub Actions run 1331995980 succeeded.
17e21c4 Server robots worker - Akarys42
[python-discord/workers] New branch created: experiments/akarys/robots\.txt
This worker will be used to serve robots.txt files across our infrastructure.
The worker should be set on *.pythondiscord.com/robots.txt and pythondiscord.com/robots.txt. Each robot file is defined in the robots/ directory, the file name being the domain the rule should be served on.
The rules will be defined in a later PR, right now only the main site is set up.
what is this semi-colon doing here?
[python-discord/workers] New branch created: feature/9/hastebin\-filter
This worker is in charge of filtering out uploads that contain seemingly valid tokens.
Closes #9
[python-discord/bot] New branch created: watch\-output
GitHub Actions run 1333174501 succeeded.
Since no one has expressed interest directly for two days, I'm going to pick this one up myself, since I quite want to do it :D
@Xithrius shouldn't this be closed as we already have a cowboy lemoji now
04ffbe2 Add Voice Mute and modify the field size of ty... - D0rs4n [551d8a2`](https://github.com/python-discord/api/commit/551d8a2def405808bcaa22230474f286f85f6723) Merge pull request #21 from D0rs4n/pr/infractio... - jchristgit
At this point, I believe it's time we started migrating a few of the endpoints, there is an issue regarding the off-topic names endpoint, however I think we can also migrate the reminders endpoint, to see a more complicated one in this new environment as well.
(Although, the Alembic migration environment hasn't been set up just yet, a PR should come up anytime now.)
I would be glad If I could implement( or more like migrate) this one myself. (If it's possible, of course)
5839e63 Send the user's mention in the watch command. - Qwerty-133
This would make the output consistent with other moderation commands.
GitHub Actions run 1334325012 succeeded.
Stalled due to no discussion being had beforehand. This will be un-stalled once users agree on what should be done.
[python-discord/bot] New branch created: subscribe\-with\-buttons
Closes #1866
This is based on top of #1815, so will need rebasing before merging.
GitHub Actions run 1334603808 succeeded.
These buttons seem to be dynamically generated, their ids should be modified before the view is sent.
This should 100% have a custom id assigned to it.
While I know this is still a work in progress, this is a very important note.
Yea, my idea was to have the custom ID be the role id.
Ah, I would also prefix the IDs with something particular for this cog/function
Yea, makes sense, I'll prefix it with the cog name since it's easily done
Helpers (and partners/python community) should be able to mention other users, but not roles, in reminders. In late June, this was still possible, but it currently isn't.
While looking through the source code and git blame (looks calmly at @TizzySaurus), I think I managed to locate the issue to the Reminders._check_mentions method. For a non-mod helper, the error message when mentioning another user in a reminder (should be allowed), is the error message that should be used when trying t...

This is the error that occurs now when two users try to play against AI, one after the other, while one game is still in progress. Is this the desired output?
Looking through the code, the _check_mentions method seems to do exactly what it should. The MODERATIONS_ROLES check is for mentioning roles.
elif await has_no_roles_check(ctx, *MODERATION_ROLES):
return all(isinstance(mention, discord.Member) for mention in mentions), "roles"
This essentially says "if the user isn't a moderator, and they mentioned a role, return False -- since only mods can mention roles". To me that's exactly what should happen.
This is the error that occurs now when two users try to play against AI, one after the other, while one game is still in progress. Is this the desired output?
The code from before this PR made it so that their can only even be one command per channel, and the user invoking the command cannot already be playing a game.
I guess the missing channel attribute of the `Ga...
GitHub Actions run 1334781907 succeeded.
I assume this should be removed?
This looks like dead code from an older implementation.
Does this even work? I thought you did event="message"?
Remember that here we use double-quotes
Ok, I guess that works. I will fix that.
I asked @Shom770 over DM and he said that I have to say "on_message" instead of "message". I don't know where he got that from though. If you are absolutely certain it is "message", I will gladly change it back.
No? I want the user to know how many inputs there are left for them to enter. Why should this be removed?
Yes, indeed! Since this is my first time contributing, I used parts of the hangman implementation that I worked on with @Shom770 in my code. However, that is not dead code. I changed that according to the game I am writing.
I'm a bit confused. I think you might be misunderstanding the point of this game. I want the exact opposite of what you said - I do not, under any circumstances, want the bot to use the same template every time. That would make the game very boring because the point of the game is that the player does not know what the template is. That's what makes this game more interesting. However, it is using the same JSON file with the templates, but the templates used in the game should not be the same.
I understand what you're trying to do now, so the issue is that i = 0 above. So you basically create a variable and then increment it, which looks pretty useless.
What you need to do is store this i somewhere. Either on the class (self.tries) or perhaps return it and let the game pass it again.
Ok, got it. I'll try to see what I can do with that.
@Bluenix2 Can you elaborate a little on what self.tries means?
self.tries is a hypothetical attribute, just an example of one you can create.
You need to store this integer somewhere.
Right, but this is what you're telling Python to do.
You're saying, "Hey open this file and remember a random template."
You should store all templates in a variable and randomly pick one when you start a game.
The templates are really long, so I'm not sure whether or not it makes sense to store them in a variable. My knowledge of JSON is currently very limited, so I'm not even sure how variables work in JSON (if that even is a thing). Unless you were talking about the Python program itself?
@Bluenix2 Is this what you were looking for?
timeout = await self.bot.wait_for(event='on_message', timeout=60.0)
Yes I was talking about Python itself. Right now you're only "remembering" one of those templates.
No I was thinking TIMEOUT = 60.0 at the top of the file. And then you use this variable with the keyword-argument timeout=TIMEOUT
I think you're missing something. This is all that is needed for the purpose of the game. I don't need to manipulate the templates in any way, why would I need to do anything more than just "remember" a random template. Maybe I'm still missing something?
Well it means that two games will use the same template, because you don't pick a new one each time.
GitHub Actions run 1335068246 succeeded.
I presume that the changes in this file is because its being compared to main and not the branch of the other pr.
Maybe a comment, these roles are able to be added with the subscribe command.
is it worth trying to fetch the role here if its not in the cache?
I have more changes, but github doesn't let you finish a review if the diff is changed while reviewing it...
GitHub Actions run 1335108322 succeeded.
Should this be an error instead of a warning?
I call wait_until_guild_available at the start, which doesn't get set if the role cache is empty. We can assume if it's not in the cache, it doesn't exist in the guild.
No, the changes to this file is because I moved handle_role_change out of here and into a helper function
Yea, the comment is in the config.yml already, I can copy that comment to here.
Ah okay, I'll review that too after I eat.
Having checked other cogs that do something similar to this, yes it should be for consistency.
GitHub Actions run 1335123302 succeeded.
GitHub Actions run 1335129654 succeeded.
Should check if interaction.user is a Member here, before attempting to update the roles, since it could be a User.
In the case it's a User, delete the interaction.message
Could you explain why? I don't see how those lines of code that you commented on would make the bot use the same template twice.
Because you load the file and pick a random one at the start. A new one is newer picked.
It's like this code:
def random_number():
# Guaranteed random by dice roll
return 4
The templates are really long, so I'm not sure whether or not it makes sense to store them in a variable. My knowledge of JSON is currently very limited, so I'm not even sure how variables work in JSON (if that even is a thing). Unless you were talking about the Python program itself?
Ok. This is starting to make a little more sense. But as I said above, the templates are really long, so I don't know how I would save them to a variable like you suggested. Is there anything else you could s...
Relevant Issues
Closes #667
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Added a cowsay command that emulates the classic CLI tool.
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](https://pythond...
GitHub Actions run 1335560443 failed.
Is this what you were looking for? @Bluenix2
TIMEOUT = 60.0 await self.bot.wait_for(event='on_message', timeout=TIMEOUT)
Actually, there is one thing I can think of, but I'm not sure if it's very efficient. What do you think about this? @Bluenix2
`madlibs_stories = Path("bot/exts/fun/madlibs/madlibs_templates.json")
with madlibs_stories as file:
templates = [
file["templates"][0],
file["templates"][1],
file["templates"][2],
file["templates"][3],
file["templates"][4],
file["templates"][5],
file["templates"][6],
file["templates"][7],
...
Why not use a list comprehension? Something like
with madlibs_stories as file:
templates = [template for template in file["templates"]]
Although I can't help but feel like this isn't valid syntax. You probably need with open(madlibs_stories) and then files aren't subscriptable, so file["templates"] isn't valid.
If you're trying to load JSON, I'd recommend reading this RealPython tutorial on how to do so.
Is this what you were looking for? @Bluenix2
TIMEOUT = 60.0await self.bot.wait_for(event='on_message', timeout=TIMEOUT)
Yes, but make sure the TIMEOUT variable is defined at the top of the file (just after the imports) since it's a constant.
Maybe mention that the "random number of user inputs" is within the specified bounds of the command arguments.
As of the cleanup PR on sir-lancebot, we now use list over List. You should also specify the types within the list (e.g. list[str]) if possible.
GitHub Actions run 1336648640 succeeded.
c5c5a7b Remove Dangling Semicolon - HassanAbouelela
Just making sure the dev-ops team is paying attention! 10/10, would test again.
Fixed in c5c5a7b7.
Thank you mister hassan
[python-discord/workers] branch deleted: label\-webhooks
97b4334 Rename github-filter-worker to github-filter - Akarys42
GitHub Actions run 1337913259 succeeded.
bed2b35 Add 10s member cooldown to subscribe command - ChrisLovering
ab9be33 Stop listening for events when message is deleted - ChrisLovering
GitHub Actions run 1338433914 was cancelled.
GitHub Actions run 1338438607 succeeded.
Sentry Issue: BOT-1NS
TypeError: object of type 'NoneType' has no len()
(2 additional frame(s) were not displayed)
...
File "bot/exts/moderation/infraction/_scheduler.py", line 85, in reapply_infraction
expiry = dateutil.parser.isoparse(infraction["expires_at"]).replace(tzinfo=None)
File "dateutil/parser/isoparser.py", line 37, in func
return f(self, str_in, *args, **kwargs)
Fil...
Docstring is now incorrect.
Minor minor nitpick, is it possible to alphabetize these?
Or, if the command does it based on the order here, comment as such.
Not sure if it makes sense to give these aliases/tags and have a second category which uses them too so all roles in that are used by the subscribe command, could be cool.
This may need to stay for the verify command, Not sure if it can raise this or not,
GitHub Actions run 1335560443 failed.
GitHub Actions run 1338813238 failed.
Yeah @TizzySaurus, I have the TIMEOUT = 60.0 just below the imports and the await statement right before the class definition. Is that ok?


Description
One of the events I'm planning to host in 2022 is a Python Trivia Night! People will gather in a stage channel and we'll be asking Python Trivia questions for people to answer. To help with participation and running the event, I'd like to have a cog/extension with a set of commands to help facilitate this.
Proposed Implementation
I'd like a new set of commands under .trivianight or .triviaevent.
.trivianight load will accept a json file of appropriately f...
There is no in whitelist check in the verify cog now, so this isn't needed.
fixed with the force push
GitHub Actions run 1338963829 succeeded.
alphabetised in the force push, won't fix the second part, the rest of the yml file uses comments to distinguish groupings like this, which this has. I don't want to add a new class that needs to be imported just for the subscribe cog.
Connected!
GitHub Actions run 1338971509 succeeded.
b0be25b update advent of code channel IDs - ChrisLovering
[python-discord/sir-lancebot] New branch created: update\-advent\-of\-code\-channel\-ids
Description
We deleted and re-made the channels so new IDs are needed.
Did you:
- [ ] Join the Python Discord Community?
- [ ] Read all the comments in this template?
- [ ] Ensure there is an issue open, or link relevant discord discussions?
- [ ] Read and agree to the contributing guidelines?
GitHub Actions run 1339007203 succeeded.
Sentry Issue: SIR-LANCEBOT-3E
Channel "advent_of_code" with ID 782715290437943306 missing
Sentry Issue: SIR-LANCEBOT-6Q
AttributeError: 'NoneType' object has no attribute 'guild'
File "bot/exts/events/advent_of_code/_helpers.py", line 524, in new_puzzle_notification
aoc_role = aoc_channel.guild.get_role(AdventOfCode.role_id)
Background task `Daily AoC Notification` failed:
Well I can't test it in the server, but these are the correct channel IDs haha
I've checked as well that these are the correct IDs, and they are. Very nice.
[python-discord/sir-lancebot] branch deleted: update\-advent\-of\-code\-channel\-ids
Connected!
GitHub Actions run 1339035704 succeeded.
Connected!
AOC_DAY_AND_STAR_TEMPLATE = "{rank: >4} | {name:25.25} | {completion_time: >10}"
[python-discord/sir-lancebot] Issue opened: #907 TypeError: object of type 'NoneType' has no len\(\)
Sentry Issue: SIR-LANCEBOT-6R
TypeError: object of type 'NoneType' has no len()
File "discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(*args, **kwargs)
File "bot/exts/events/hacktoberfest/hacktober-issue-finder.py", line 49, in hacktoberissues
embed = self.format_embed(issue)
File "bot/exts/events/hacktoberfest/hacktober-issue-finder.py", line 107, in format_...
Actually, I'm not even sure why it's there. I removed it, and renamed the actual template in the AoC views file. Thank you!
GitHub Actions run 1339178672 succeeded.
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.
GitHub Actions run 1339261362 succeeded.
Mostly unnecessary return statements.
We shall un-remove the space, to keep the formatting consistent between this and other files.
from bot.utils.extensions import invoke_help_command
log = logging.getLogger(__name__)
Besides the requested change, very nice PR.
Throughout this project, we usually go with the suggestion below.
log = logging.getLogger(__name__)
GitHub Actions run 1339310297 succeeded.