[python-discord/infra] New branch created: chris/service/psql
#dev-log
1 messages ยท Page 92 of 1
Closes #13
This installs postgres, creates users and databases. What isn't supported is creating users with set passwords, currently only users with local auth can be made.
To support this we will need to create a vault file with those user's passwords.
GitHub Actions run 1685404418 succeeded.
Is there a way to avoid writing this 5 times, or would that involve a bunch of boilerplate that would make it not worthwhile?
How is 14 being installed? If it's just using apt, and we're on Debian stable, then the version would be 13.
If it depends on the Debian version, is there a nicer way to get the pg version than hard-coding it. Otherwise, upgrading Debian would entail remembering to update this variable too.
What's the use of this?
Also, pg needs to be assigned an IP and then allowed in ufw, right? Or is that out of scope for this PR?
Yea, it can
Pipelining can be enabled globally by setting โpipelining=Trueโ in the ssh section of ansible.cfg
However it has a drawback
Unfortunately, pipelining is disabled by default because it is incompatible with sudo's requiretty setting (or su, which always requires a tty). This is because of a quirk of the Python interpreter, which enters interactive mode automatically when you pipe in data from a (pseudo) tty.
Afaik sudo doesn't have a role on psql by default, so this runs it under the postgres user
hmm yea, we could either track the most recent version in debian, or we could add the postgres apt repo, which works similar to deadsnakes's ppa
Relevant Issues
closes #2022
Description
Move the dataclasses that are used by the source cog out of the tag cog file in order to fix the current import issue.
See https://github.com/python-discord/bot/issues/2022#issuecomment-997541569 for a longer explanation.
GitHub Actions run 1687331703 succeeded.
GitHub Actions run 1687361123 failed.
08a2fe0 Fix AoC name lookup for anon users - ChrisLovering
[python-discord/sir-lancebot] New branch created: fix\-aoc\-name\-lookup
Description
When a user doesn't set a name, the AoC API doesn't return a name key at all, so we need to make use of the ID field instead, to build the name based on a similar tempalte that AoC uses for it's leaderboard.
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 1687970779 succeeded.
LGTM, just one small suggestion.
This is more of a nitpick, but this can be simplified.
aoc_name = member_aoc_info["name"] or f"Anonymous #{member_aoc_info['id']}"
c02a478 Update bot/exts/events/advent_of_code/_cog.py - ChrisLovering
[sir-lancebot] Branch fix\-aoc\-name\-lookup was force-pushed to `5ef4b73`
GitHub Actions run 1688042925 was cancelled.
GitHub Actions run 1688045224 succeeded.
[python-discord/bot] Pull request review submitted: #2046 seperate tag dataclasses from tag cog file
Looking through the code it looks good to me, haven't tested locally.
GitHub Actions run 1688055691 succeeded.
aoc_name = member_aoc_info.get("name") or f"Anonymous #{member_aoc_info['id']}"
Why isn't the name missing from member_aoc_info or was that an incorrect assumption?
I should have been more specific, the key is present, but is empty.
If going with this approach, I think it would make more sense to make the tags extension a package with a separate module for the cog and the non-cog classes instead of moving the classes to utils
Looks good! Seems to be working locally just fine.
[python-discord/sir-lancebot] branch deleted: fix\-aoc\-name\-lookup
Connected!
GitHub Actions run 1688669350 succeeded.
Oh why was this reverted?
@Bluenix2 It was reverted since I don't think there is any NamedTuple class per se that you can inherit from, just the namedtuple function from collections. Unless there's an underlying class it uses.
@Bluenix2 It was reverted since I don't think there is any
NamedTupleclass per se that you can inherit from, just thenamedtuplefunction from collections. Unless there's an underlying class it uses.
There, it's under the typing module.
I highlighted multiple lines not just the last one. I'm asking why this entire step is necessary.
@Bluenix2 It was reverted since I don't think there is any
NamedTupleclass per se that you can inherit from, just thenamedtuplefunction from collections. Unless there's an underlying class it uses.There is, it's under the
typingmodule.
Ohhh. ๐คฆโโ๏ธ I should've checked
I was talking about all 4 lines I highlighted. Doesn't need to be global. Just reusable.
Is the command meant to support unicode characters?
Volcyy mentioned yesterday that "Modern Debian comes with requiretty disabled", so I think we can actually enable this globally to get the benefit everywhere.
At that point the only duplicated code is that of the first two lines. I'm not sure how much of an issue this is, nor how we would go about aliasing the become steps.
It's mostly useful on subsequent runs of the role, when all of the above is skipped due to already existing, this ensures psql is still running
GitHub Actions run 1689622754 succeeded.
Is the command meant to support unicode characters?
Yes, such as the first example in the PR description.
GitHub Actions run 1690619982 succeeded.
hey I would like to work on this issue
New change:
As per this, #dev-contrib message, github api can return a merged pr as still a draft for some ungodly reason, so the ordering of the emojis will be changed to support merged prs still being a draft..
GitHub Actions run 1695158973 succeeded.
GitHub Actions run 1695718264 failed.
GitHub Actions run 1695850444 succeeded.
@wookie184 I was experimenting with Numerlor's implementation and found it didn't cause too much trouble to add, so I went through with it. It also stops the job from getting terminated if the stdout is too large, which is a plus.
This is still needed to determine whether an error happened, so we know whether we should format the error or just send the timings.
GitHub Actions run 1697598837 succeeded.
Problem

The code in the above image wont execute
[python-discord/site] New branch created: jb3/django\-discord
This PR:
- Adds the Django Discord community to the communities resources page
- Re-numbers following communities in the list
GitHub Actions run 1697775312 succeeded.
GitHub Actions run 1697788029 succeeded.
The !e command, as well as every other command, needs a space after the command so the bot can actually know what the command is. We can workaround this, but I'm not sure if it's worth it.
Few more comments, suggestions and nitpicks
It would be nice to also have support for using . instead of : (e.g. 3.30pm / 15.30)
Shouldn't this be datetime.date, as per the datetime docs?
I'm not quite sure why we'd support HMam/pm. Does this mean something like 330pm? If so, I don't like that, and personally don't think it should be supported.
For reference, this was answered on discord in #dev-contrib [here](#dev-contrib message).
That makes sense but it was baffling at first when my command didn't work just in a random OT convo. It might not be worth it but it's one of those things that's good to have in certain situations.
I really don't see why it should be bothered to hijack the commands extension to workaround this "issue". Merely adding a space after your command is effortless.
There's just one typo I found
Return a list of code blocks if any, otherwise return a list with a single string of code.
GitHub Actions run 1698869608 succeeded.
Yeah I agree with @pedro-anthony
Yeah I agree with @pedro-anthony
Alright, my only concern was again for it to be a thing that's just good
I really don't see why it should be bothered to hijack the commands extension to workaround this "issue". Merely adding a space after your command is effortless.
The issue is not so much that adding a space is too much effort, but to the user it could be unclear why the bot didn't respond.
As the discord client renders with and without a space the same, two seemingly equal invocations can have different results. This is sort of confusing and comes up every now and again with someone won...
The easiest โfixโ would be adding a command alias which is eval<tick><tick><tick> (and another for the e alias). This is quite ugly though, and will require extra work in terms of modifying the code parsing logic to handle the now missing opening quotes
The easiest โfixโ would be adding a command alias which is
eval<tick><tick><tick>(and another for theealias). This is quite ugly though, and will require extra work in terms of modifying the code parsing logic to handle the now missing opening quotes
That would also need to include the language, right? So probably wouldn't be too feasible, yeah
I really don't see why it should be bothered to hijack the commands extension to workaround this "issue". Merely adding a space after your command is effortless.
The issue is not so much that adding a space is too much effort, but to the user it could be unclear why the bot didn't respond.
As the discord client renders with and without a space the same, two seemingly equal invocations can have different results. This is sort of confusing and comes up every now and again wi...
GitHub Actions run 1700350097 succeeded.
If going with this approach, I think it would make more sense to make the tags extension a package with a separate module for the cog and the non-cog classes instead of moving the classes to utils
Resolved as of https://github.com/python-discord/bot/pull/2046/commits/95de0f353012ae17dbfc7eea6fa71c18db93ac07
GitHub Actions run 1700369384 succeeded.
@wookie184 If there was an alias for !e```, wouldn't fuzzy matching be able to handle the language bit?
@wookie184 If there was an alias for !e```, wouldn't fuzzy matching be able to handle the language bit?
No, it wouldn't work because the codeblock parser wouldn't receive the first three ``` which would mean that the regex that detects ` would be thrown off.
Right, but that's not what I was talking about
I think wookie's point was that even if !e```โ was a command, !eโ```py wouldn't work because of the py. I'm saying it could work because of fuzzy matching
Mayybe instead of making it an alias for the actual !eval, we could just make it send an error message saying "run this command again with a space in between". That would handle the non-responsiveness, without needing to mess around with the codeblock regex and other parsing
It wouldnโt work no, we donโt do fuzzy matching like that. The fuzzy matching for command names only sends a message listing similar commands. Youโd have to add all aliases no matter what (6 by my count if you add python and py). Itโll also look quite ugly in the help list if we did the command approach.
We could do it in the error handler and match the first portion of the invocation command, but I donโt think we should go beyond sending an error message. Trying to adjust the parsing to a...
Right, but that's not what I was talking about
Let me explain.
Scale's concerns about needing to modify the parser are valid, based on the below.
I think wookie's point was that even if !e```โ was a command, !eโ```py wouldn't work because of the py. I'm saying it could work because of fuzzy matching
We don't have any fuzzy matching on command names, only on tags. Additionally, we can show this behavior on the current bot by running the command without the first three ```...
I'm not quoting like 4 people but I'm glad to see someone come up with the point of the user being confused as to why the bot didn't respond.
Cheers,
Arnav
Rerunning of code doesn't currently seem to be working, when I click the reaction to rerun code (for eval or timeit command) I get this error:
bot_1 | 2022-01-15 13:06:01 | bot.exts.backend.error_handler | ERROR | Error executing command invoked by wookie#4017: !e 2
bot_1 | Traceback (most recent call last):
bot_1 | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 167, in wrapped
bot_1 | ret = await coro(*args, **kwa...
3dab549 chore(deps): bump pillow from 8.4.0 to 9.0.0 - dependabot[bot]
Connected!
GitHub Actions run 1701660446 succeeded.
This doesn't currently seem to enforce any memory limits on the subprocesses created, which means the command is exploitable by running a command like .latex $\genfrac{}{}{10000000}{1}{1}{1}$ (tailoring that number to allocate as much memory as is available).
This can probably be done using the resources module, https://docs.python.org/3/library/resource.html, and setting some limits before running the render in _renderer.py.
resources, however, does not support windows. Because o...
Minor typo, but this seems to work nicely.
# Their actual values come from all the unknown arguments.
@wookie184 the exact change you describe was implemented by me on the latex-limits branch, but it proved unreliable. The code would still often OOM completely for reasons beyond me. IMO, the desire for a latex command is mostly artificial, and we can get by fine without it. If we were to implement it, I think the path of least resistance would be using an existing framework. @vcokltfre expressed interest in writing an API ...
Just a couple things, could you also make the message match the other token message a bit closer, particularly:
- having the user as a clickable mention and the ID in a codeblock afterwards
- having the channel as a clickable mention
- putting the censored token in a codeblock
- adding the pfp of the user that send the message as a thumbnail
match.group() here will include mfa. so this will always return true, only the characters after should be passed here.
f"{token[:4]}{'x' * len(token[4:-3])}{token[-3:]}"
Just so the number of xs matches how many characters are missing :)
Taking a look at the regex, 24:xx isn't a valid 24hr time so the |2[0-4] should actually be |2[0-3].
8e738ea Shorten the TXT_EMBED_DESCRIPTION message - swfarnsworth
[python-discord/bot] New branch created: swfarnsworth\-zapped\-message
The previous version of the message gave different instructions for each possible reason that their message was deleted, which was rarely read in entirety and was sometimes confusing. This version simply instructs the user to use the paste bin.
GitHub Actions run 1703101205 succeeded.
I've been looking into this and we need to wait for bot#2001 to be merged, as a part of this will use the DayDuration converter that was implemented.
Due to this, I'm going to mark this PR as stalled until that's merged.
Read through the commits and all changes seem to make sense, and have tested the things I can think of that this could affect. Everything seems to be working well.
TIME_RE = re.compile(
r"(?P<hour_12>0?[1-9]|1[0-2])" # hours (12 hour format)
r"|"
r"(?P<hour_24>00?|1[2-9]|2[0-3]))" # hours (24hr format)
r"[:.]" # separator between hours and minutes is `:` or `.`
r"(?P<minute>[0-5][0-9])" # minutes
r"(?::" # separator between minutes and seconds is `:`
r"(?P<second>[0-5][0-9]))?" # optional seconds
r"(?: ?)" # separator between minutes/seconds and meridiem is a space or nothing
r"(?P<meridiem>[AaP...
Running
!bb watch test
!infraction edit last 10s
Will result in this error when the bot tries to end the infraction
bot_1 | Traceback (most recent call last):
bot_1 | File "/bot/bot/utils/scheduling.py", line 119, in _await_later
bot_1 | await asyncio.shield(coroutine)
bot_1 | File "/bot/bot/exts/moderation/infraction/_scheduler.py", line 402, in deactivate_infraction
bot_1 | raise ValueError(
bot_1 | ValueError: A...
Just for reference, i'll post some findings on the cause of the surprisingly high memory usage here.
To limit memory usage we set the rlimit RLIMIT_AS. This corresponds to "virtual memory", which includes memory in in ram or swap space, but also memory that isn't actually used (i.e. allocated to the process but not actually allocated to any hardware). I believe this "not actually allocated" memory is what numpy seems to...
Connected!
GitHub Actions run 1704479829 succeeded.
f"Please use a [{URLs.site_schema}{URLs.site_paste}](paste bin) instead."
-2 characters (/s)
Not really important but might make it clear they can use any pastebin, and the link to ours is just an option
Am I about to bikeshed a determiner?
If a link comes after a definite determiner, like "our", I would expect it to link to a specific thing. If it follows an indefinite determiner, I would expect it to link to information about what that thing is in general.
We can change the whole sentence to "You can use our paste bin instead".
Chris, this is absolutely excellent. One shudders to imagine a greater introduction into our Ansible repository than building the role for the World's Most Advanced Open Source Database, PostgreSQL. I have a few small nitpicks. They should not be much to implement. Feel free to ask me or Joe if you need help.
This can be integrated with the task below.
What's the reason behind the sleep here?
Thank you! I have one small question regarding the removed line.
What was the reason for removing this?
Reason :
- when we are mentioning
OAuthabove then why are we suggesting it optionally its the same thing - to avoid confusion
This possibly isn't needed now, as we don't have an init scripts that could cause odd behaviour by exiting immediately on getting a stop signal.
I'm not sure how likely we are to add those, so I think this could be safely removed.
That's fair. You can change it to your suggestion there or leave it as is. (our could also be part of the link to emphasise the link is to our paste bin even more :D)
GitHub Actions run 1705123511 succeeded.
Connected!
GitHub Actions run 1705125361 succeeded.
[python-discord/bot] branch deleted: swfarnsworth\-zapped\-message
7740f2e Shorten the TXT_EMBED_DESCRIPTION message (#2... - swfarnsworth
Connected!
GitHub Actions run 1705515827 succeeded.
GitHub Actions run 1705520040 succeeded.
Connected!
GitHub Actions run 1705522216 succeeded.
PR to fix pastebin hyperlink, it looked like this before. Hyperlink is now formatted to correct format.
GitHub Actions run 1707147704 succeeded.
Connected!
GitHub Actions run 1707535462 succeeded.
GitHub Actions run 1709547320 failed.
looks good, and works ๐
Looking forward to more botcore in the future ๐
751f386 Add bot-core as a dependancy - ChrisLovering
e9b72cc use regex from bot-core for discord invites - ChrisLovering
3ff21f1 Move single-use message ID regex to inside file... - ChrisLovering
8845e5b Use codeblock regex from bot-core in snekbox cog - ChrisLovering
cb4256f Merge branch 'main' into add-bot-core - wookie184
[python-discord/bot] branch deleted: add\-bot\-core
GitHub Actions run 1709558399 succeeded.
Connected!
GitHub Actions run 1709581544 succeeded.
GitHub Actions run 1709633171 succeeded.
doesn't match the typehint
doesn't match the typehint
doesn't match the typehint
Yeah that makes sense. Do you think it would also make more sense to say f"Your {job_name} job has failed", along with the other messages, rather than just `f"Your eval job has failed"?
GitHub Actions run 1710148518 succeeded.
GitHub Actions run 1710160002 succeeded.
Absolutely great, rock solid, infra structure code. Thank you Chris. I could not expect any better, and was still positively surprised. Thank you. Thank you.
Hi, @janine9vn I would like to work on this issue . Can you please assign this issue and clearly specify your requirements and expectations : )
Instead of manually mapping each value, you can expand the entire dict. See my ufw PR for reference.
Oh, this is very nice, thanks! Should help us if we want to add more in future, since the built-in supports quite a few fields
4cc1d16 Epand entire dict when adding psql users and da... - ChrisLovering
If the code is to be re-evaluated, return the new code, and the args if the command is the timeit command.
Otherwise return None as the first element if the eval session should be terminated.
It took me a bit to understand these two sentences, I believe the above suggestion makes it a bit better but maybe it could use a full reword. The code also never returns None alone so the second sentence should mention it'll return None for the code in the tuple i...
While going through this I noticed we don't check for None on the code result which can cause an error down the line
GitHub Actions run 1714151955 succeeded.
I'll start working on helpdm for now.
GitHub Actions run 1717708589 succeeded.
GitHub Actions run 1718123229 succeeded.
552fad9 Display a mention and thumbnail to the claimant - Qwerty-133
[python-discord/bot] New branch created: helpdm
c183150 count anonymous replies as mod replies - Qwerty-133
[python-discord/modmail-plugins] New branch created: anon\-messagesping
Replies sent using ?areply weren't being counted as mod replies.
[python-discord/modmail-plugins] branch deleted: anon\-messagesping
async def _maybe_kick_user(self, member: discord.Member) -> bool:
Clicking the button simply doesn't do anything
Device information:

Which page is this button on?
Description
We currently have a message in #helpers that goes out when all help channels are used and no new ones can be pulled up/created that pings all Helpers.
Unfortunately, this message is a bit too late as all the channels are already taken.
We'd like to add a non-pinging message when we're at 90% help channel usage, to let people know we're running low on help channels. If helpers are free they can try to clear up some overdue channels before we run out.
We'd like to imp...
GitHub Actions run 1724813866 failed.
It seems like if any more job types are added, they'll all use the prepare input function, what do you think of making it a converter that'd be applied to the code parameter?
Some of the methods are still using the eval naming (in both their names, and some strings inside), I think send_eval and post_eval should be changed to job like the others. There's also filter_eval from the Filtering cog, but in that case I think it's clearer to use eval as it doesn't have the context of bein...
async def timeit_command(self, ctx: Context, *, code: str) -> None:
GitHub Actions run 1726332393 succeeded.
GitHub Actions run 1726365993 succeeded.
GitHub Actions run 1726376265 succeeded.
GitHub Actions run 1726386666 succeeded.
[python-discord/sir-lancebot] branch deleted: filter\-them\-topics
caf36c6 Added even more conversation starter topics. (#... - Xithrius
Connected!
GitHub Actions run 1726570186 succeeded.
Adding explicit changes request because I'm in agreement that without effective memory management we should try offload this to an API which reduces attack vectors on our infrastructure.
Adding explicit changes request because I'm in agreement that without effective memory management we should try offload this to an API which reduces attack vectors on our infrastructure.
We could run a regex upon getting a CommandNotFound exception to determine if !eval or !e is followed by a back-tick, and if so, add a space in between. We could then just process the command again.
As far as I can tell, this is already using an API
Purely a code-review at this point, haven't tested it.
Changing this will require us to alter the deployment manifest too, as by default sir-lance has a read-only file system. We have specifically given a writable volume to _latex_cache/
This file should be in bot/resources/fun.
Ideally we would use the regex from bot-core for this.
However, it hasn't been installed on sir-lance yet. So if you don't want to implement that as part of this PR it's fine.
This is more of a note for my reference. I think if we want to change to this new path, we should have it be _cache though, so that the walk_extensions func doesn't even attempt to import it as a module
Should the cache directory by bot/exts/fun/cache then?
Maybe something like bot/exts/fun/_latex_cache to make it clear.
GitHub Actions run 1729266082 succeeded.
GitHub Actions run 1729279887 succeeded.
54deb24 Don't include user mention for anonymous form s... - ChrisLovering
[python-discord/forms-backend] New branch created: anon\-webhooks
We currently use WEBHOOK_ENABLED to determine whether user data should be stored to the db. However, when webhooking a form submission this config is ignored, and the user mention is always included if available.
This means that if a user login in using anohter form, and then submits an anonymous form with the same session, their name will be included in the webhook.
GitHub Actions run 1729580520 failed.
GitHub Actions run 1729597119 failed.
GitHub Actions run 1729613478 succeeded.
This doesn't currently seem to enforce any memory limits on the subprocesses created, which means the command is exploitable by running a command like .latex $\genfrac{}{}{10000000}{1}{1}{1}$ (tailoring that number to allocate as much memory as is available).
This can probably be done using the resources module, https://docs.python.org/3/library/resource.html, and setting some limits before running the render in _renderer.py.
resources, however, does not support windows. Because o...
Connected!
GitHub Actions run 1730204547 succeeded.
I must've forgotten to Approve.
Regarding my last question, for reference, I was doing \:sweat_smile: which becomes \๐
in the message content (displayed as ๐
instead of the Twemoji representation). That was the only blocker for my approval.
Nice work here, thanks!
Unfortunately, I don't think we're going to be needing this system right now, since we don't host user events anymore and can handle staff event management without it. With the introduction of the new Discord Events system we can handle interest registration and notifications for events both privately and privately. Thank you for the contributions nonetheless though, it is greatly appreciated!
@rtk-rnjn I will be closing this for the time being. The contribution guidelines mentioned by @bsoyka shall be followed, so please open an issue here.
Thanks!
As part of our core developer meeting, we have decided that in order to have the site pull request taken care of for now, @ChrisLovering will implement a minimal patch in the bot to adjust the infraction type name in the backend to match the new name in the site, which will be merged together with the site pull request.
The main functionality of creating a new voice ban command will be implemented separately, but this way we keep work on the site project to a minimum (e.g. conflict resolut...
[python-discord/forms-backend] branch deleted: anon\-webhooks
GitHub Actions run 1730660900 succeeded.
Hi,
Please follow the proper contribution guidelines before making a PR to open source projects.
Is there a reason for this change? Running a regex over this field seems kind of pointless.
This is no longer relevant now that Discord has an event calendar.
I can't imagine this is still relevant. We don't really use the admin interface in our site anymore, so let's close this.
This is no longer relevant. Most of the documentation mentioned here is already quite good in the official Django docs (like how to make migrations), and some of the stuff that's referred to (like deployment.md) no longer exists in this repo. This probably made sense two years ago, but I don't think it makes sense now.
@hedyhli
Hi there! Are you still interested in working on this?
We should edit and update this issue, since it has screenshots of a very old version of the site. The idea is still good, though. Maybe we can put an invite widget of some kind under the video on our current landing page?
The amount of people who use codespaces is low enough to where it's not necessary for us to implement explicit support.
The amount of people who use codespaces is low enough to where it's not necessary for us to implement explicit support.
This is easy enough to do, it wouldn't hurt.
This is probably blocked by #582, but we should still do it after we're done with that.
We've looked over this in a site issue review meeting among the core devs today.
We're going to close this, partially because it's quite old without seeing any interest, secondly because we don't think it belongs in the site. If we decide we want something like this later, it seems like a good candidate for CloudFlare Workers.
We're no longer best friends with Hacktoberfest, and will therefore be closing this. (The event is no longer mentioned on our website)
I will take a second look at it and check whether this is fixed in more recent versions of DRF. If that doesn't work, we're going to close it, as we can't cleanly fix it on our side.
I think now that we have this in Sir Lancebot, I don't think this is necessary anymore.
This ties into our roadmap issue for this year to make it easier to contribute to our repos. Let's look into this within that context, at some point in 2022.
@minalike will take care of this in #624
[python-discord/bot] New branch created: voicemute
We currently do not synchronize channels with the names, so the channel IDs would be natural here.
To have the channel names here, we would either have to:
- Use metricity (it is a bit messy, in my opinion)
- Call to Discord (would require embedding an API key in the site)
- Synchronizing channel names from bot with site
Having channel IDs on its own would be nice.
This PR changes everything related to voice_bans to instead use voice_mute so that the bot is in line with the new site API.
As such, this should be merged at the same time as https://github.com/python-discord/site/pull/608
This also adds stub commands for voice_ban , as they are useful for moderators during the change over from voice_ban to voice_mute, to remind them that the command has been renamed.
Reviewing may be easier by reviewing individual commits, rather than the full diff.
d061ab1 Add active field to OffTopicChannelName model. - RohanJnr
8232b11 Serialize name and active attribute. - RohanJnr
b2819a4 Use ModelViewSet to add support for PUT and PAT... - RohanJnr
28de14b Return a list of ot-names only for GET request ... - RohanJnr
69f4dc1 Return a list of ot-names only for GET request ... - RohanJnr
GitHub Actions run 1730961953 failed.
Hi,
Please follow the proper contribution guidelines before making a PR to open source projects.
Is there a reason for this change? Running a regex over this field seems kind of pointless.
To be frankly honest the contributing.md was hidden in the .github folder, my bad for not looking for it more in depth.
I think running a regex over the field would be more beneficial as it is more lenient on the webhook url format
The contributing guidelines are placed in the recommended folder, as per github's instructions, to ensure they show up in the side bar or when you try to open a PR.
As for using the regex here, I don't think it makes sense to add. The only benefit it has over the current implementation is that it enables the discordapp doma...
GitHub Actions run 1731111342 succeeded.
The contributing guidelines are placed in the recommended folder, as per github's instructions, to ensure they show up in the side bar or when you try to open a PR.
As for using the regex here, I don't think it makes sense to add. The only benefit it has over the current implementation is that it enables the discordap...
3e786da Add Helper Functions For Managing Roles - HassanAbouelela
[python-discord/forms-backend] New branch created: roles
[python-discord/bot-core] New branch created: port\-utilities
This is a huge PR, and it improves our codebase significantly. Thanks for putting in all this work. Everything looks good to me.
751f386 Add bot-core as a dependancy - ChrisLovering
e9b72cc use regex from bot-core for discord invites - ChrisLovering
3ff21f1 Move single-use message ID regex to inside file... - ChrisLovering
8845e5b Use codeblock regex from bot-core in snekbox cog - ChrisLovering
7740f2e Shorten the TXT_EMBED_DESCRIPTION message (#2... - swfarnsworth
Got a few errors while testing this out in the test server they all seem to be caused by the same thing though
[python-discord/bot] branch deleted: enhance/backend/time\-util\-refactor
6b280b1 Time: remove RFC1123 support - MarkKoz
469cd57 Time: qualify uses of functions with the module... - MarkKoz
0bfdc16 Time: rename time_since to format_relative - MarkKoz
ad1fcfb Time: replace discord_timestamp calls with form... - MarkKoz
3ac1ef9 Time: remove absolute param from format_infract... - MarkKoz
GitHub Actions run 1731235109 succeeded.
Connected!
GitHub Actions run 1731251656 succeeded.
Sentry Issue: BOT-2JY
The function call was not updated in https://github.com/python-discord/bot/commit/94936e499f303deeae785d4b643dbf598ae0a4cc
TypeError: notify_infraction() missing 2 required positional arguments: 'bot' and 'infr_id'
File "discord/client.py", line 351, in _run_event
await coro(*args, **kwargs)
File "bot/exts/moderation/infraction/superstarify.py", line 73, in on_m...
Description
Uptime command
https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/core/ping.py#L29-L40
Reasoning
It look cool
Proposed Implementation
Use Relative timestamp of discord ``
Would you like to implement this yourself?
- [ ] I'd like to implement this feature myself
- [x] Anyone can implement this feature
GitHub Actions run 1732763706 was cancelled.
GitHub Actions run 1732763982 succeeded.
I fixed the noqas, but I did something and now I have 64 changed files ๐
e54b4fc Add missing arguments to notify_infraction call - TizzySaurus
[python-discord/bot] New branch created: fix\-issue\-2053
[python-discord/bot] Pull request opened: #2055 Add missing arguments to \`notify\_infraction\` call
Closes #2053.
Fixes an issue caused by a missed migration in #1951 (if a user attempted to change their nickname when superstarified, an error would raise when trying to notify them that they can't change nickname due to being superstarified).
Use git reset to remove that commit, then rebase your old commit off of upstream/main and force push?
I get this error when running b!modpings s 9pm 9am:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(*args, **kwargs)
File "/bot/bot/exts/moderation/modpings.py", line 266, in schedule_modpings
f"{discord_timestamp(start, TimestampFormats.TIME)} to "
File "/bot/bot/utils/time.py", line 71, in discord_timestamp
timestamp = (timestamp - arrow.get(0)).total_seconds(...
If you're changing other things, add a . here at the end. Not necessary unless you're changing other things though because it is not that important.
I want to apologize to the staff that I pinged while attempting to test this... that said thank you for the PR, works nicely!
@RohanJnr should this be marked as ready for review?
Background
- PR #508 added the
activeattribute to theoff topic channel namestable. - It also added the ability to send PATCH and PUT requests to modify the instance attributes.
Changes
- This PR filters the off topic channels names and only sends the
active namesas response to an incomingGETrequest tobot/off-topic-channel-names?random_items=x - Test cases were modified which were relevant to the above change.
GitHub Actions run 1735509823 failed.
GitHub Actions run 1735533077 succeeded.
GitHub Actions run 1735572922 was cancelled.
GitHub Actions run 1735574419 succeeded.
@Bluenix2 it is now. Updated PR description.
Implements part 1 of #1960
GitHub Actions run 1735777064 succeeded.
@Akarys42 Could you please specify which button you are referring to.
cacbece Prevent page title from overlapping dropdown bu... - kosayoda
[python-discord/site] New branch created: fix\-subarticles\-button
On clients with a small viewport width, the content title of pages overlap the "Sub-Articles" dropdown button due to having the same z-index, causing the element last positioned in the HTML to show up on top.
Fixes #643.
GitHub Actions run 1736857477 succeeded.
Currently whenever you paste a forms link is discord, the embed looks like this:

Using og tags we can set what this embed looks like, we should include the form title in there at least, so it's easy to see at a glance what form it is pointing to.
Useful reference:
https://www.reddit.com/r/discordapp/comments/82p8i6/a_basic_tutorial_on_how_to_get_the_most_out_of/
Thank you Rohan! Concise and tested. Excellent!
Thank you kosayoda. Concise, reasonable, and good. Excellent work!
This is still the current behaviour in DRF. For what it's worth, somehow working around this in DRF is probably rather tough, but it's not something we can fix on our side.
[python-discord/site] Checks Successful on PR: #626 feat: Edit on GitHub button for content articles
GitHub Actions run 1737348663 succeeded.
Hey @ks129 when you get some time, could you resolve the multiple leaf nodes issue in the migrations? I merged in main so that I could test this against the bot's main branch, but then got some migration conflicts :D
e485629 Remove dev-contrib and bot-commands from featur... - jb3
[python-discord/bot] New branch created: jb3/feature\-channel\-changes
This removes public channels since it makes the embed obtuse and the information has little value.
GitHub Actions run 1739861971 succeeded.
[python-discord/bot] branch deleted: jb3/feature\-channel\-changes
e7f6c4e Remove dev-contrib and bot-commands from featur... - jb3
Connected!
GitHub Actions run 1740586486 succeeded.
In certain situations, multiple users invoking the same command with static output is common, resulting in duplicate messages from the bot. The bot currently handles a per channel cooldown on tags
GitHub Actions run 1742615255 succeeded.
Hey @dawnofmidnight are you planning to continue work on this?
Hey @dawnofmidnight are you planning to continue work on this?
I am not, no. Would you like to?
Hey @dawnofmidnight are you planning to continue work on this?
I am not, no. Would you like to?
Yes, that'd be great ๐
GitHub Actions run 1744229539 succeeded.
Next time please follow said guide and get assigned to the issue first. Thanks.
[python-discord/sir-lancebot] New branch created: aoc\-logging
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Approved by myself.
Description
When browsing the prod logs looking for a specific error, I noticed that the AOC cog produced a bunch of mostly pointless logs which contributed heavily to making the logs unbrowsable. This PR removes the main offenders while not losing any important information.
This PR adds a few unrelated changes to the config, but they are minor a...
I've asked Xith to remove me from this issue and put it up for grabs, but an important note for whoever merges this:
The change to the insert/delete command will make any URLs in prod inaccessible if they have https in the name. I've already deleted a majority of the ones that existed at the time, but before you merge, it's a good idea to go through and clean up any that have been added since.
d6e483a Bump isort Version - HassanAbouelela
GitHub Actions run 1744654071 failed.
GitHub Actions run 1744674226 failed.
GitHub Actions run 1744692919 failed.
GitHub Actions run 1744696416 succeeded.
GitHub Actions run 1744701523 failed.
The actions are currently failing for an unknown reason. We've identified that there was a minor version bump from 3.9.9 to 3.9.10, but the cause of the failure, and the solution remain unknown.
What feature are you proposing?
Edit the "Available help channel" embed

to

What is your justification for the proposed feature?
I've been visiting some help channels,
I found that some claimers delete their messages. Then, someone else who isn't the claim...
Below is one example of a scenario that can potentially be avoided

Below is an example of a scenario that can potentially be avoided, or resolved a bit more quickly. This was a perfectly civil resolution, but sometimes these situations can also spiral.

Myself, @HassanAbouelela and @Qwerty-133 discussed this in #dev-contrib around [here](#dev-contrib message) and came to the conclusion that sending an embed after pinning the opener message would be better than editing the available one.
This is in-line with what we do for the available and dormant embeds, and also leads to better UX, especially if the opener message is long, since there's little use editing a message ...
For anyone wanting to pick this up, this is the function that manages what gets executed when a channel is claimed.
https://github.com/python-discord/bot/blob/main/bot/exts/help_channels/_cog.py#L104
Connected!
GitHub Actions run 1747065263 succeeded.
Yup, works well! Tested with the bot side (https://github.com/python-discord/bot/pull/2052) and infractions get saved, rescheduled etc and all looks good, thanks! ๐
"""Activate an existing off-topic name."""
# Channel rename endpoint rate limited. The task was cancelled by asyncio.
There's recently been a lot of contreversy around the master branch and words such as "whitespace". "whitelist" and "blacklist" are another pair of words that have been pointed out as harmful, is there any downside to keep the "active" naming surrounding it?
await ctx.send(f"Off topic name `{name}` has been {'activated' if active else 'deactivated'}.")
f4ef466 setuptools use stdlib distutils over embedded - ChrisLovering
[python-discord/sir-lancebot] New branch created: test\-actions
This is caused by an upstream issue with setuptools 60.* (via virtualenv) changeing the default to using the setuptools-embedded distutils rather than the stdlib distutils, which breaks within pip's isolated builds.
This is explained quite well here https://github.com/pre-commit/pre-commit/issues/2178#issuecomment-1002163763
[python-discord/bot] New branch created: fix\-pre\-commit\-issue
This is caused by an upstream issue with setuptools 60.* (via virtualenv) changeing the default to using the setuptools-embedded distutils rather than the stdlib distutils, which breaks within pip's isolated builds.
This is explained quite well here https://github.com/pre-commit/pre-commit/issues/2178#issuecomment-1002163763
This also fixes a small inconsistency with our docker-compose file.
GitHub Actions run 1747897318 succeeded.
Connected!
Connected!
GitHub Actions run 1748973262 succeeded.
1faadcf Rename contributing guidelines to contributi... - novialriptide [da315f0`](https://github.com/python-discord/bot/commit/da315f0d1888427f71cdd793e7339fb2dd1801e5) Merge pull request #2059 from novialriptide/nov... - HassanAbouelela
Connected!
GitHub Actions run 1749067366 succeeded.
e7f6c4e Remove dev-contrib and bot-commands from featur... - jb3
1faadcf Rename contributing guidelines to contributi... - novialriptide [da315f0](https://github.com/python-discord/bot/commit/da315f0d1888427f71cdd793e7339fb2dd1801e5) Merge pull request #2059 from novialriptide/nov... - HassanAbouelela [68aedf2`](https://github.com/python-discord/bot/commit/68aedf2f53f16bb46e2f89379270bfa28fe31cfb) Merge branch 'main' into fix-issue-2053 - MarkKoz
10186af Add missing arguments to notify_infraction call - TizzySaurus
[python-discord/bot] branch deleted: fix\-issue\-2053
GitHub Actions run 1749269237 succeeded.
Connected!
GitHub Actions run 1749279125 succeeded.
I'd rather see most, if not all the help dm code in the _messages.py file or some new module rather than in the cog's file. The cog already has quite a lot going on, and we should try to avoid making it even harder to read.
What's up with the restart policy Chris. I want clean PRs Chris.
1faadcf Rename contributing guidelines to contributi... - novialriptide [da315f0](https://github.com/python-discord/bot/commit/da315f0d1888427f71cdd793e7339fb2dd1801e5) Merge pull request #2059 from novialriptide/nov... - HassanAbouelela [10186af](https://github.com/python-discord/bot/commit/10186afb0a376c82f71235b06f8f5af87f41bcb6) Add missing arguments to notify_infraction call - TizzySaurus [e1d3bf6`](https://github.com/python-discord/bot/commit/e1d3bf655df15195824635d824679bf7db670811) Merge branch 'main' into fix-pre-commit-issue - HassanAbouelela
[python-discord/bot] branch deleted: fix\-pre\-commit\-issue
GitHub Actions run 1750294362 succeeded.
Connected!
GitHub Actions run 1750312728 succeeded.
Testing this locally it works very well, and is good to go.
However, the output from the API really isn't designed for Discord dark mode!
Darkmode:

Lightmode:

Could we use PIL (or similar) to put a white background on the image returned by the API? I think this...
@ChrisLovering that's weird - it looks a lot better for me

But yeah, I'll look into adding a background
@ChrisLovering that's weird - it looks a lot better for me
But yeah, I'll look into adding a background
Yea, that example looks fine for me too, guess it's dependent on what it's outputing.

GitHub Actions run 1751217937 succeeded.
Not really, we can totally replace those words with "active" naming.
d061ab1 Add active field to OffTopicChannelName model. - RohanJnr
8232b11 Serialize name and active attribute. - RohanJnr
b2819a4 Use ModelViewSet to add support for PUT and PAT... - RohanJnr
28de14b Return a list of ot-names only for GET request ... - RohanJnr
69f4dc1 Return a list of ot-names only for GET request ... - RohanJnr
GitHub Actions run 1752336971 failed.
[python-discord/site] New branch created: update\-bot\-contrib\-guide
The python news cog relies on the python_news section of the config being filled in via a named alias. Since we were using the DEV_ prefix, this meant it was not being populated, leading to the cog throwing an error on boot.
This also added the new incidents webhook that is used for message unfurling.
GitHub Actions run 1753508915 succeeded.
[site] Branch update\-bot\-contrib\-guide was force-pushed to `0db8dfc`
[site] Branch update\-bot\-contrib\-guide was force-pushed to `85352ea`
Description
@Shom770 had asked [here](#dev-contrib message) about potentially adding the topics mentioned [here](#pedagogy message) to the .topic command and I think it should be done.
Reasoning
Not sure exactly how to explain the reasoning, but I personally think that there is no reason not to add some topics from the `#programming-pedago...
6330e19 Fix broken yaml in kivy.yaml. - lemonsaurus
4ee8d52 Greatly simplify the backend. - lemonsaurus
008d693 Add a template tag for css-classifying things. - lemonsaurus
231ed09 Add a FontAwesome token that we actually control. - lemonsaurus
64c6ea9 Clean up dependency file and bump simple-bulma. - lemonsaurus
GitHub Actions run 1755411936 failed.
1faadcf Rename contributing guidelines to contributi... - novialriptide [da315f0](https://github.com/python-discord/bot/commit/da315f0d1888427f71cdd793e7339fb2dd1801e5) Merge pull request #2059 from novialriptide/nov... - HassanAbouelela [10186af](https://github.com/python-discord/bot/commit/10186afb0a376c82f71235b06f8f5af87f41bcb6) Add missing arguments to notify_infraction call - TizzySaurus [d7095c4](https://github.com/python-discord/bot/commit/d7095c40e83800cc379115ef45bd987a5deb4649) setuptools use stdlib distutils over embedded - ChrisLovering [4383c13`](https://github.com/python-discord/bot/commit/4383c139637025917645300cda8047f32926aa99) Add missing restart-policy to metricity container - ChrisLovering
61d652a Rename voice_ban type to voice_mute - ChrisLovering
32d77fa Refactor voice_ban function definitions to voic... - ChrisLovering
07211bb Add voice_ban stub commands - ChrisLovering
b9df3f2 Merge branch 'main' into voicemute - ChrisLovering
5f4b557 Merge pull request #2052 from python-discord/vo... - ChrisLovering
[python-discord/bot] branch deleted: voicemute
[python-discord/site] branch deleted: voicemute
53bbaac Implement voice mute + migration from voice mut... - ks129
721d313 Merge branch 'main' into voicemute - ChrisLovering
f390517 Try to add merge migration - ks129
d9ccf84 Merge branch 'main' into voicemute - ChrisLovering
c38d05a Merge pull request #608 from python-discord/voi... - ChrisLovering
Connected!
GitHub Actions run 1755988564 failed.
Can confirm these changes resolved errors when using the config.yml provided on the public contributing guide.
6b280b1 Time: remove RFC1123 support - MarkKoz
469cd57 Time: qualify uses of functions with the module... - MarkKoz
0bfdc16 Time: rename time_since to format_relative - MarkKoz
ad1fcfb Time: replace discord_timestamp calls with form... - MarkKoz
3ac1ef9 Time: remove absolute param from format_infract... - MarkKoz
GitHub Actions run 1756975114 succeeded.
GitHub Actions run 1757024330 succeeded.
7b84217 fix: Change the return type of the timeit comma... - ToxicKidz
Closes python-discord/bot#2060
This PR adds a message by the bot stating who the help channel claimant is.

This is my first code contribution to Python Discord and my first time working with discord.py so during your review it is safe to assume that I know nothing.
I'm not sure if the embed should be sent before or after the channel is moved. But I would like it to be sent...
GitHub Actions run 1757113794 succeeded.
Works well and looks good to me, thanks for the change!
Tested out locally, seems to be working fine.
Thank you for the PR!
GitHub Actions run 1757414668 succeeded.
Connected!
GitHub Actions run 1757432593 succeeded.
[site] Branch update\-bot\-contrib\-guide was force-pushed to `8b50bef`
[python-discord/site] branch deleted: update\-bot\-contrib\-guide
[python-discord/site] New branch created: voice\-mute\-in\-metricity\-endpoint
3e10b0c Use voice_mute and voice_ban to determine voice... - ChrisLovering
Previously only voice_ban was used, but now having either of these infractions should mean the user is blocked from reciving the role.
[python-discord/site] Checks Failed on PR: #647 Use voice_mute and voice_ban to determine voice_gate
GitHub Actions run 1758327210 failed.
01df374 Use voice_gate_blocked field from API for voi... - ChrisLovering
[python-discord/bot] New branch created: fix\-voice\-gate
This new field is true when the user has any voice exception, which means the user is blocked from receiving the role.
GitHub Actions run 1758337709 succeeded.
GitHub Actions run 1758417348 succeeded.
Sentry Issue: BOT-2KN
KeyError: 'voice_muted'
File "discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(*args, **kwargs)
File "bot/exts/moderation/voice_gate.py", line 173, in voice_verify
"voice_muted": data["voice_muted"],
Error executing command invoked by sherifu.#8349: !voiceverify
Sentry Issue: BOT-2KQ
KeyError: 'voice_muted'
File "discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(*args, **kwargs)
File "bot/exts/moderation/voice_gate.py", line 173, in voice_verify
"voice_muted": data["voice_muted"],
Error executing command invoked by cjamesl#5551: !voiceverify
Yeah, this is reasonable. ๐ฆ
This is quite an excellent PR, and I can't find any problems with it.
[python-discord/bot] branch deleted: fix\-voice\-gate
[python-discord/site] branch deleted: voice\-mute\-in\-metricity\-endpoint
Absolutely brilliant, Dr. Lovering! Thank you!
Connected!
Brand new events page!
Weโve all been waiting for it, so here it is. I present to you a redesigned events page... after I finish the following:
- [ ] New text bodies (existing ones can be re-used)
- [ ] An interactive calendar pulling events from Discord
- [ ] A โComing up:โ box
- [ ] Info about each event, Iโm thinking of having a card for each event, like each project in the contributing docs
Thereโs probably more, just let me know.
Closes site#494.
GitHub Actions run 1758786019 succeeded.
GitHub Actions run 1759047164 failed.
Sentry Issue: SIR-LANCEBOT-7P
ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: application/json', url=URL('http://api.wolframalpha.com/v2/query?input=y+%3D+W%E2%88%921(x)+if+%E2%88%921/e+%E2%89%A4+x+%3C+0&appid=EJTXQJ-PHQXE29HLK&output=JSON&format=image,plaintext&location=the+moon&latlong=0.0,0.0&ip=1.1.1.1')
File "discord/ext/commands/core.py", line 167, in wr...
In addition to the issue that was fixed in the above PR, we are now seeing this happen again.
The issue is that the edited message could be in a DM, so waiting for guild available isn't enough. We should move the message.guild check from self.is_message_blacklisted() "further up" this function, before we try to get the channel.
GitHub Actions run 1761411352 failed.
PR Author
Workflow Run
Source Branch
chris/fix/119-tld...
[python-discord/kubernetes] Checks Successful on PR: #120 Mount a cache volume to bot for tldextract
GitHub Actions run 1761418655 succeeded.
PR Author
Workflow Run
Source Branch
chris/fix/119-tld...
[python-discord/kubernetes] Checks Successful on PR: #120 Mount a cache volume to bot for tldextract
GitHub Actions run 1761422037 succeeded.
PR Author
Workflow Run
Source Branch
chris/fix/119-tld...
GitHub Actions run 1763130279 succeeded.
Connected!
GitHub Actions run 1764767754 succeeded.
GitHub Actions run 1765683850 failed.
GitHub Actions run 1765688068 failed.
GitHub Actions run 1765713296 failed.
GitHub Actions run 1765754613 failed.
GitHub Actions run 1765761515 failed.
GitHub Actions run 1765809997 failed.
GitHub Actions run 1765958591 failed.
GitHub Actions run 1766096621 failed.
[forms-frontend] Branch docker\-compose was force-pushed to `a67b488`
Yes it was, I've added it in my last push.
@Bluenix2 I had tested the watch options extensively when I made this PR, but it did not seem to work for me. I tested it again now with the same result (I've ensured the modified file is copied correctly into the container). Perhaps this is an OS-dependent problem? What environment are you running in? If it works for some people, might as well leave it in, but it's broken for me.
Also, did you mean to put those options in devServer? watchContentBase is (perhaps no longer) documented, so t...
GitHub Actions run 1768427434 failed.
GitHub Actions run 1768462603 failed.
aa1420a Clean up hover effects. - lemonsaurus
d8c5571 Support dashful redirects. - lemonsaurus
8e8a19e Replace is-goodreads-cream with is-black. - lemonsaurus
GitHub Actions run 1768530472 failed.
GitHub Actions run 1768533264 failed.
GitHub Actions run 1768534868 failed.
GitHub Actions run 1768540790 failed.
GitHub Actions run 1768546759 failed.
GitHub Actions run 1768590495 failed.
GitHub Actions run 1768722708 failed.
df51385 Show a "No filters selected" indicator. - lemonsaurus
301847a Remove italics from resource cards. - lemonsaurus
GitHub Actions run 1768781806 failed.
[python-discord/site] New branch created: update\-pyfakefs
This is required to allow running tests on 3.10.
GitHub Actions run 1768869503 succeeded.
656ae64 Allow searching users by username and discrimin... - jchristgit
[python-discord/site] New branch created: user\-information\-endpoint
A test case is added to demonstrate this functionality.
Closes #578.
GitHub Actions run 1768929305 failed.
GitHub Actions run 1768989226 succeeded.
This is a great change, and I recommend it to anyone willing to run tests on Python 3.10. Thank you, German colleague, for your hard work making site run on Python 3.10. I'm sure that your contributions will be beneficial to Python Discord for years to come.
Thank you Joe! I am honoured to be able to contribute to Python Discord in such a high-velocity fashion, and I am proud to hear that my contributions are deemed useful here.
Can you clarify why this is needed?
Can you add a comment on why using the image as a mask is needed here?
Here and also in _process_image, even though it's not required by the linter, it would be nice if there was a short description of what each function does.
A comment about the caching mechanism would be nice here.
GitHub Actions run 1769191468 succeeded.
I actually quite like that the embed is not flashy (no icon, plain black border).
We should link #how-to-get-help in the dormant help channel embed.
Uses a red
xicon
I don't think that sends the right message. Channels are often closed with successes (problems were fixed) too, and I don't think that conveys that.
[python-discord/site] branch deleted: dewikification
53bbaac Implement voice mute + migration from voice mut... - ks129
721d313 Merge branch 'main' into voicemute - ChrisLovering
cacbece Prevent page title from overlapping dropdown bu... - kosayoda
41fac4c Merge pull request #645 from python-discord/fix... - jchristgit
f390517 Try to add merge migration - ks129
GitHub Actions run 1769715700 failed.
Around 23% of help channel sessions go completely unanswered.
We have a theory that a large proportion of this stat are from people who don't ask their question well, or don't provide enough information for helpers to help them.
To try and reduce this issue, this issue proposes that we send a message in help channels after 15 minutes if no one other than the claimant has sent a message.
I believe this message should include:
- An explanation that everyone here is a volunteer, and...
We should link
#how-to-get-helpin the dormant help channel embed.
Is the justification for this because users will click on a channel in the Dormant category?
Thinking about the call to action the embed represents, I think a color could make it more immediately notable to the eye but that color should be neutral. Blurple perhaps? Happens to align the Zzz emote used presently.
GitHub Actions run 1770977972 succeeded.
I've updated category names where applicable and also have updated screenshots.
I believe these are addressed in the re-write. Please take a look!
I added an additional separate question that explains the 3 categories, including dormant ones.
I went with your wording.
I actually quite like that the embed is not flashy (no icon, plain black border).
@minalike I agree. My stance today is that we could make the embed less cluttered, but still keep it neutral.
Why was this issue revived all of a sudden?
GitHub Actions run 1772144559 failed.
GitHub Actions run 1772174172 failed.
GitHub Actions run 1772207379 failed.
GitHub Actions run 1772267481 failed.
I was just looking for possible issues to put on staff meeting agenda.
GitHub Actions run 1773263297 failed.
GitHub Actions run 1773841998 failed.
GitHub Actions run 1773864973 failed.
GitHub Actions run 1774048254 failed.
GitHub Actions run 1774099420 failed.
GitHub Actions run 1774313064 failed.
GitHub Actions run 1774357477 failed.
GitHub Actions run 1774366813 failed.
GitHub Actions run 1774412284 failed.
GitHub Actions run 1774950429 failed.
GitHub Actions run 1775008872 failed.
GitHub Actions run 1775020779 failed.
GitHub Actions run 1775094936 succeeded.
Resource name
Python Graph Gallery
Resource location
https://www.python-graph-gallery.com/
Payment type
Free (Open Source 0BSD)
Why it should be included
It contains information about multiple types of graphs and charts available in popular graphing libraries, and some General Knowledge about graphing.
Potential limitations
Some of the Graph examples are specific to one or two specific libraries, but it still provides a single-stop summary for what you...
GitHub Actions run 1775641520 succeeded.
[python-discord/sir-lancebot] New branch created: love\-calculator\-unsub\-footer
7fc90a6 Fix footer reference to deprecated unsubscribe ... - bsoyka
Relevant Issues
Description
This changes the embed footer in the .love command to point to !subscribe instead of the deprecated .lovefest unsub command.
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...
GitHub Actions run 1775728382 succeeded.
Worth noting that I haven't tested this live, but it's just a visual change to one string so I don't really see the need.
Just a suggestion, but maybe we could add "in #bot-commands" to the end of the footer? I ask that with the assumption that !subscribe can only be used in #bot-commands, but let me know if that's not the case.
I ask that with the assumption that
!subscribecan only be used in #bot-commands, but let me know if that's not the case.
For non-staff, it'll redirect the output to #bot-commands if it's used outside of there, so I don't think it matters too much.
I ask that with the assumption that
!subscribecan only be used in #bot-commands, but let me know if that's not the case.For non-staff, it'll redirect the output to #bot-commands if it's used outside of there, so I don't think it matters too much.
Ah gotcha.
GitHub Actions run 1775842082 succeeded.
embed.set_footer(text="You can unsubscribe from lovefest by using `!subscribe`.")
Not necessary, but maybe?
I was thinking the same thing, actually.
Unfortunately, footers are plain text and don't render any Markdown.

Oh, good to know.
Unfortunately, footers are plain text and don't render any Markdown.
Oh, good to know.
1f41d18 Sort resources alphabetically, disregarding 'the'. - lemonsaurus
GitHub Actions run 1775917642 failed.
e07d21a Fix delay when collapsing collapsibles. - lemonsaurus
Well then, perhaps you could still add a period, but ignore the backticks?
GitHub Actions run 1775951848 failed.
GitHub Actions run 1775955811 succeeded.
GitHub Actions run 1775966675 succeeded.
GitHub Actions run 1776365157 failed.
GitHub Actions run 1776375872 succeeded.
Missed one.
Fixed in https://github.com/python-discord/sir-lancebot/pull/1020/commits/a400f81de9f14aba698c47f965824cb7e9b4ed10, and ran the bot to test now that it's more than a simple string.
GitHub Actions run 1776429038 succeeded.
GitHub Actions run 1776524870 succeeded.
Description
Code-golf competition!
Proposed Implementation
- The bot stores a queue of challenges. Staff members should be able to add new questions to the queue with a command (say,
.cg add). Questions should be uploaded as a .json file, containing the problem description, visible test cases and hidden test cases. - The bot should maintain per-day leaderboards, as well as an overall one in a configured channel (top 25 entries).
- Per-day leaderboards should display...
Connected!
Connected!
GitHub Actions run 1777662669 succeeded.
Currently, moderators receive a non-pinging alert in #mod-alerts when a username containing a filtered word sends a message. The moderators would like to add a Moderators ping to this alert.
We also discussed adding the same ping for when such a user joins a voice channel. However, this type of alert is not currently in the code and would require another listener.
Looking over the file, there's also some inconsistencies in imports which could be addressed in the same PR:
L690 uses the from discord import NotFound import, whilst [L356](https://github.com/python-discord/bot/blob/2f64912bf4fd0d8bf1f55cf97cb4d4ae...
11cbc00 Kaizen: Make jchrists wildest dreams come true - lemonsaurus
We should just delete this file. There are no utils to retrieve tags anymore.
Why aren't we just using the as_css_class template tag here? This is just duplicating code from there.
yeah so here the colors are both in the span class (is-primary) and in the delete button (has-background-primary-light), so you'd need twice as many if's, which wouldn't really be that much simpler. The only way to simplify it down to a single span would be to store all these colors somewhere in the view and make sure I can get them from filters.items, which adds more clutter to the view.. but might be a better solution. I'm not sure.
GitHub Actions run 1780261402 succeeded.
GitHub Actions run 1780268807 succeeded.
closing #2068
Enjoy the gitmojis ๐
GitHub Actions run 1780337208 succeeded.
GitHub Actions run 1780401025 succeeded.
Lemon, this is absolutely brilliant. Rest assured that I will approve this when requested.
Regarding "Configure Podman services to use host cgroup and run managed by systemd":
[Unit]
Description = Gobble the memory
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Type = forking
PIDFile=%t/%n-pid
RuntimeDirectory= %n
ExecStartPre = /bin/rm -f %t/%n-pid %t/%n-cid
ExecStart = /usr/bin/podman run \
--cgroups=no-conmon \
--cgroups=disabled \
--log-driver=journald \
--cidfile %t/%n-cid \
--conmon-pidfile %t/%n-pid \
--detach \
--name gobbler \
gobb...
47d5210 Add podman role and improve playbook organization - jchristgit
[python-discord/infra] New branch created: install\-podman
This PR adds a new podman role, see #18.
The playbook is merged into sections for each group of hosts that we
want to deploy to. To limit by role now, use tags, such as -t role::podman.
e144d4d Complete refactor of collapsibles. - lemonsaurus
GitHub Actions run 1780861491 succeeded.
Refactoring this turns out to be quite a big job, and I'm not sure I think it's a good idea to start storing lots of CSS classes in the view logic. #wontfix.
Same thing here - I don't wanna store these color classes in the view. It violates the locality of reference principle, which feels like too great a cost to pay for cleaner template code.
The classes belong with the HTML element, not in some dict in the Python view.
@jchristgit
All review comments addressed. Thanks for the review!
I've addressed all the issues I was able to find with my own code.
GitHub Actions run 1781073067 succeeded.
GitHub Actions run 1781187493 succeeded.
By the power vested in me, this LGTM
[python-discord/site] branch deleted: swfarnsworth/smarter\-resources/merge\-with\-main
Currently the unfurl embeds provided for messages that are reported in #incidents are very helpful because they provide moderators a quick preview of the reported message, the message author ID, channel name, etc.
Moderators would also like to add the reported message's author's profile picture in the unfurl embed.
This will help give moderators a visual cue and anchor for the user's messages when reading longer conversations in public channels.
.
GitHub Actions run 1784114708 failed.
Actually, just noticed this `apt-get` won't format it as code, not sure if we have another way to do this.
4c1b884 linting: remove trailing spaces - swfarnsworth
We can just delete that part and say "support for Debian packages".
GitHub Actions run 1784977220 succeeded.
Main point is just a minor issue with the docstring.
Side notes:
* [L418](https://github.com/python-discord/bot/blob/fdb702d3e186a6d5020c9b3cd32c2f0588542c56/bot/exts/filters/filtering.py#L418) uses `discord.Message` despite `Message` being imported separately (we should probably change to `Message`). * If we change above, the only remaining usage of `discord.xxx` is `discord.Embed` and `discord.ChannelType`. If we wanted to we could remove these in favour of a ...
There's multiple instances of doing something along the lines of
from discord import (
ChannelType, Colour, ...
)```which would fit within the 120 lines, so that would be the approach should you want to implement this.
The "joins" should technically be singular, but I think that's too small to be worth fixing. Thanks for updating :+1:
I cannot find any examples in the repo of how it would like to be handled when the imports exceed the line length. And I don't want to be the one to figure it out.
There's multiple instances of doing something along the lines of
from discord import ( ChannelType, Colour, ... )which would fit within the 120 lines, ...
GitHub Actions run 1785949567 succeeded.
All parts for this are done save for the statistics command, and like mentioned we have grafana for this. If a need arises for seeing the actual infractions in the timespan via a command we can open a separate issue.
Connected!
Closes #2051
This PR adds a non-pinging notification to #helpers to alert staff when we are running low on dormant channels. The threshold for when this notification is triggered is added as a configurable.
GitHub Actions run 1786692831 succeeded.
The parenthesis isn't necessary and I don't feel that it clarifies anything.
You should add stat for this similar to help.out_of_channel_alerts.
I think it'd be better to put in the else of the try-except, since the exception being caught has nothing to do with this code.
Also, what do you think about defining a predicate for this in _messages.py to reduce the amount of code in the cog? I'm always concerned that the cog is growing too big and things need to be refactored out of it to stay manageable. Such predicate could probably be used by both this code and the code in the except block.
Haven't tested anything but the code is looking good :+1:
I'll test this as soon as I get a chance, and leave a formal review after :+1:
Are these just arbitrarily low dates? If so doing arrow.get(datetime.min) might make it more clear what this is trying to do.
GitHub Actions run 1790278549 succeeded.
[python-discord/site] branch deleted: swfarnsworth\-google\-colab
6db463b Rewrite Google Colab resource to emphasize GPU ... - swfarnsworth
GitHub Actions run 1790302516 succeeded.
it is Ada Lovelace's birthday as a little "easter egg". it is just a very old date, so we don't have to use Optional typing.
Would you like for me to change it or comment it?
Yea, I think just a comment that it's just an arbitrarily old date is fine.
I agree, the notify_channel is already configurable via the config.yml
1d3101a Emphasize reason for sharing traceback - swfarnsworth
[python-discord/bot] New branch created: swfarnsworth\-traceback\-tag
The previous version talks about how to read a traceback, but this tag is most often used to help the asker provide the traceback. This version is more brief and emphasizes why they are being asked to provide the traceback, and uses an example that I think is slightly more illustrative.
GitHub Actions run 1791639337 succeeded.
[python-discord/bot] Pull request opened: #2073 Add message author's profile picture to unfurl embed
Closes https://github.com/python-discord/bot/issues/2070
This PR adds the reported message author's profile picture to incident embed.
GitHub Actions run 1792610189 succeeded.
I have one small reservation about this that I need to discuss with mods first before merging.
Relevant Issues
Closes #1018
Description
This PR adds topics to the .topic command for the new #programming-pedagogy channel that was recently added.
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://pythondiscord.com/pages/contributing/contributi...
GitHub Actions run 1795808111 succeeded.
Besides perhaps the third question, these questions/topics are not well-suited for the .topic command. These were suggestions provided by @swfarnsworth as a primer or introduction to what pedagogy is about. However, using these questions verbatim that mention non-specific X and Ys would not be conducive to starting a discussion in that channel.
Besides perhaps the third question, these questions/topics are not well-suited for the
.topiccommand. These were suggestions provided by @swfarnsworth as a primer or introduction to what pedagogy is about. However, using these questions verbatim that mention non-specific X and Ys would not be conducive to starting a discussion in that channel.
Oh alright, I see what you mean. I could try to think of some more specific ones then.
GitHub Actions run 1795928995 succeeded.
f178ea0 Replace FA pro issue icon with the regular icon - ChrisLovering
[python-discord/site] New branch created: remove\-fa\-pro\-icons
We stopped using FA pro, as we wanted it was using an ex-admin's person FA pro subscription, which we didn't control.
Hi, my name is Leon Sandรธy and I approve of this code.
63b464b Replace FA pro issue icon with the regular icon - ChrisLovering
[python-discord/site] branch deleted: remove\-fa\-pro\-icons
GitHub Actions run 1795999927 succeeded.
I meant to include a link to the pastebin for long tracebacks. Please don't merge this until I add that.
GitHub Actions run 1796130396 succeeded.
Connected!
I've spoken with Zig, and we think it's best if on top of the other PR, we try to decouple the reliance on member objects for this cog where possible. Replacing member.mention with manual mentions, and adding a fallback default for role checks are examples of how we could go about that.
There's nothing wrong with both _scheduler.py and management.py from what I see.
0641313 Disable Reminders Cog - HassanAbouelela
[python-discord/bot] New branch created: disable\-reminders
The reminders cog is being temporarily disabled until issue #1916 is resolved.
GitHub Actions run 1797270755 succeeded.
This is more stalled as the reminder command is currently disabled due to bugs.
I've been having a quick look into this and how it could be implemented. This is the first time I've looked into using a server-side rendered website, let alone Django.
I am trying to get my head around how you could implement something that would use state (the user's requested theme) to serve up different stylesheets when we are using server-side rendering. I understand that Bulma is being used to created multiple themes that are {theme_name}_variables and can be served up using the `...
File watching works without further modifications on my linux machine. Since it's not a necessary feature, we can move ahead with the PR.
Everything else works as expected ๐๐ป
This workaround requires at least an empty node_modules folder in the repo. I'll add that to the notion docs for now.
The main thing missing from these changes is that file reloading does not work. Webpack-dev-server by default enables the webpack watch option, but for whatever reason, it doesn't work in the docker build. I've stumbled upon this SO post multiple times in my search, but nothing I tried worked.
Ultimately, file watching is a QoL feature. I think not having it slows down development significantly, bu...
I only have one code-specific comment, but can you add a few timeit tests as well? I'd say the following two will do:
- Test setup codeblock detection
- Submitting timeit jobs carries the correct args
I did also get an issue running this locally:
Traceback (most recent call last):
bot_1 | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 167, in wrapped
bot_1 | ret = await coro(*args, **kwargs)
bot_1 | File "/bo...
I don't understand this, when would sys.stdout be falsely?
[python-discord/forms-frontend] branch deleted: docker\-compose
If the queue is empty.
GitHub Actions run 1798400867 succeeded.
GitHub Actions run 1798513654 succeeded.
Special thank you to @Shivansh-007 for helping me fix my git stuff ๐๐ป
GitHub Actions run 1798612628 succeeded.
Hello Joe!
I was heavily honoured to receive a review from this on this matter today. I know that time is short for everyone here, especially you, and I am glad that you managed to grant me three minutes of your free time to review this pull request.
Rest assured that I have addressed your review comment to fullest correctness by running a so-called "search-and-replace" via my text editor "neovim" by using :%s/podman/postgres/g in this file, roles/postgres/tasks/main.yml. Therefore,...
761a8e1 Add podman role and improve playbook organization - jchristgit
[python-discord/infra] branch deleted: install\-podman
1f516d6 Add Docs For Editors & Response Readers Props - HassanAbouelela
This PR overhauls the forms access system to be more dynamic and malleable using discord roles. The PR adds utilities to interact with the discord API to fetch roles and member objects, as well as modified preexisting resources to work with the new system.
Important highlights of modified resources:
- Discord Admins can now access all forms, instead of forms admins
- Helpers can create forms
- Forms can be modified by anyone in any role specified in the
editorsin the form object (exc...
GitHub Actions run 1799691130 failed.
GitHub Actions run 1799710029 succeeded.
GitHub Actions run 1799715510 succeeded.
GitHub Actions run 1799718668 succeeded.
GitHub Actions run 1799718689 succeeded.
GitHub Actions run 1799719308 succeeded.
GitHub Actions run 1799717069 failed.
GitHub Actions run 1799719401 succeeded.
GitHub Actions run 1799719407 succeeded.
GitHub Actions run 1799719329 succeeded.
GitHub Actions run 1799722871 failed.
GitHub Actions run 1799726574 succeeded.
GitHub Actions run 1799726201 succeeded.
GitHub Actions run 1799726218 succeeded.
GitHub Actions run 1799726888 succeeded.
GitHub Actions run 1799726904 succeeded.
GitHub Actions run 1799726868 succeeded.
GitHub Actions run 1799734657 succeeded.
GitHub Actions run 1799734704 succeeded.
GitHub Actions run 1799734662 succeeded.
GitHub Actions run 1799731200 failed.
GitHub Actions run 1799734862 succeeded.
GitHub Actions run 1799734675 succeeded.
GitHub Actions run 1799737174 succeeded.
GitHub Actions run 1799737358 succeeded.
GitHub Actions run 1799737390 succeeded.
GitHub Actions run 1799737328 succeeded.
GitHub Actions run 1799740253 succeeded.
GitHub Actions run 1799740314 succeeded.
GitHub Actions run 1799740471 succeeded.
GitHub Actions run 1799737006 failed.
GitHub Actions run 1799741549 succeeded.
GitHub Actions run 1799743073 failed.
GitHub Actions run 1799747389 succeeded.
GitHub Actions run 1799747382 succeeded.
GitHub Actions run 1799747415 succeeded.
GitHub Actions run 1799762383 failed.
GitHub Actions run 1799766151 succeeded.
GitHub Actions run 1799766357 succeeded.
GitHub Actions run 1799769376 failed.
GitHub Actions run 1799772964 succeeded.
GitHub Actions run 1799777625 failed.
GitHub Actions run 1799814346 succeeded.
Does it... matter? We clear the entire cache because discord returns all the roles in one request, so clearing and adding everything is the most efficient course of action.
